Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-transforms/document-styles/svg-document-styles-002.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html>
<head>
<title>CSS Test: Document transform style on SVG child element with presentation attribute styles on the parent and child elements</title>
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
<link rel="match" href="reference/svg-document-styles-ref.html">
<meta name="flags" content="svg">
<meta name="assert" content="Document transform styles on SVG elements should override presentation attribute styles on the same element. Presentation attribute styles on its parent should also be applied. The rect in the test should be rotated by 90 degrees clockwise, moved up 100 pixels, and not scaled.">
<style type="text/css">
svg {
height: 300px;
width: 300px;
}
rect.testRect {
transform: translateY(-100px);
}
</style>
</head>
<body>
<p>The test passes if there is a vertical green stripe to the left of a yellow vertical stripe. You should see no red.</p>
<svg>
<!-- Fill with Gradient to avoid false positive. -->
<defs>
<linearGradient id="grad" x2="0%" y2="100%">
<stop offset="50%" stop-color="yellow"/>
<stop offset="50%" stop-color="green"/>
</linearGradient>
</defs>
<rect x="1" y="1" width="98" height="98" fill="red"/>
<g transform="rotate(90)">
<rect class="testRect" width="100" height="100" fill="url(#grad)" transform="scale(0.5)"/>
</g>
</svg>
</body>
</html>