-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#493 Failing test for CSS not passed to SVG renderer.
- Loading branch information
Showing
2 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
openhtmltopdf-examples/src/main/resources/visualtest/html/issue-493-svg-styles.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<html> | ||
<head> | ||
<style> | ||
@page { | ||
size: 200px 400px; | ||
margin: 0; | ||
} | ||
body { | ||
margin: 0; | ||
} | ||
svg { | ||
display: block; | ||
border: 2px solid red; | ||
margin: 2px; | ||
} | ||
svg rect { | ||
/* Ruleset should be passed to all SVGs. */ | ||
fill: rgb(0,0,255); | ||
visibility: visible; /* Property valid in both HTML and SVG. */ | ||
} | ||
svg .highlight, /* To all SVGs. */ | ||
.hl rect { /* To SVGs with class hl. */ | ||
fill: rgb(255,0,0); | ||
} | ||
div { | ||
height: 20px; | ||
background-color: orange; | ||
background-color: #000000000; /* Invalid value should not override valid value. */ | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<!-- Reference --> | ||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 150 100" style="width: 100px;"> | ||
<rect width="150" height="100" style="fill:rgb(0,0,255);" rx="15" /> | ||
</svg> | ||
|
||
<!-- Should look the same --> | ||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 150 100" style="width: 100px;"> | ||
<rect width="150" height="100" rx="15" /> | ||
</svg> | ||
|
||
<!-- Should have red rect --> | ||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 150 100" style="width: 100px;"> | ||
<rect width="150" height="100" class="highlight" rx="15" /> | ||
</svg> | ||
|
||
<!-- Should have red rect --> | ||
<svg class="hl" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 150 100" style="width: 100px;"> | ||
<rect width="150" height="100" rx="15" /> | ||
</svg> | ||
|
||
<div></div> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters