<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">
<!--======================================================================-->
<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
<!--= Institute of Technology, Institut National de Recherche en =-->
<!--= Informatique et en Automatique, Keio University). All Rights =-->
<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
<!--======================================================================-->
<!-- =====================================================================-->
<!-- style-selector-BE-01.svg -->
<!-- renamed for 1.1 suite to styling-css-01-b.svg -->
<!-- Author : Chris lilley, 22-Feb-2000 -->
<!-- Modified for svg 1.1 by Ola Andersson, 07-Mar-2002 -->
<!-- Revised for Mobile Profiles: Jun Fujisawa 16-Jul-2002 -->
<!--======================================================================-->
<svg version="1.1" baseProfile="basic" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
<SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
<OperatorScript version="$Revision: 1.3 $" testname="styling-css-01-b.svg">
<Paragraph>
Verify the basic capability to handle CSS2 selectors. The style sheet is contained in a style
element in the SVG file. The picture is in two halves. In each half there is a group of circle, a
rectangle and an irregular polygon. A style on the group makes all the children have green fill.
</Paragraph>
<Paragraph>
In the upper test, the selector is the element name. All 'rect' elements are selected and
made to have a red fill. (This selects the 'rect' in the lower test as well, and thus makes it red).
The rectangle should be red, with the circle and polygon green.
</Paragraph>
<Paragraph>
In the lower test, the selector is on the class attribute. There is a class of "warning" on
the circle in the lower test, and if correctly selected this circle will be filled red. The rectangle
should also be red. The polygon has class="foo bar baz" and there is a matching
selector ".bar" so it should be green.
</Paragraph>
<Paragraph>
The rendered picture should match the reference image exactly, except for possible
variations in the labelling text (per CSS2 rules).
</Paragraph>
<Paragraph>
This tests uses 'g', 'circle', 'rect' and 'polygon' elements, as well as
fill (solid CSS1 named colors), font-family ("Arial"), and
font-size properties within the 'style' attribute and style element.
</Paragraph>
</OperatorScript>
</SVGTestCase>
<title id="test-title">styling-css-01-b</title>
<desc id="test-desc">
Test that viewer handles combinations of the simple
CSS2 selectors: ancestor, child, sibling.</desc>
<!--======================================================================-->
<!--Content of Test Case follows... =====================-->
<!--======================================================================-->
<g id="test-body-content">
<defs>
<defs>
<style type="text/css"><![CDATA[
rect { fill: red }
.warning { fill: red }
.bar {fill: green}
]]></style>
</defs>
</defs>
<!-- ====================================================================== -->
<!-- Element (GI) selectors =============================================== -->
<!-- ====================================================================== -->
<text style="font-family:Arial;font-size:12;" x="40" y="14">Rectangle should be red not green</text>
<text style="font-family:Arial;font-size:12;" x="40" y="36">This tests
element (GI) selectors: <rect /> and the selector rect</text>
<g style="fill: green">
<circle cx="160" cy="100" r="30"/>
<rect x="220" y="80" width="60" height="40"/>
<polygon points="300,100, 320,120, 340,110, 360,120, 390,90, 340,70"/>
</g>
<!-- ====================================================================== -->
<!-- class selectors =============================================== -->
<!-- ====================================================================== -->
<g transform="translate(0, 150)">
<text style="font-family:Arial;font-size:12;" x="40" y="14">Circle should be red not green; rectangle still red</text>
<text style="font-family:Arial;font-size:12;" x="40" y="36">This tests
class selectors: <circle class="warning" /> </text>
<text style="font-family:Arial;font-size:12;" x="40" y="58">
and the selector .warning</text>
<g style="fill: blue">
<circle class="warning" cx="160" cy="100" r="30"/>
<rect x="220" y="80" width="60" height="40"/>
<polygon class="foo bar baz" points="300,100, 320,120, 340,110, 360,120, 390,90, 340,70"/>
</g>
</g>
</g>
<text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.3 $</text>
<!-- style attribute to override the test style rules and keep them simple -->
<rect id="test-frame" style="fill: none;stroke:#000" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
</svg>