chromium/third_party/blink/web_tests/svg/text/text-selection-text-04-t.svg

<?xml version="1.0" encoding="UTF-8"?>
<!--======================================================================-->
<!--=  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/.                =-->
<!--======================================================================-->
<!-- =====================================================================-->
<!--                                                                      -->
<!-- text-text-04-t.svg                                                   -->
<!--                                                                      -->
<!-- Tests that the viewer can handle the rotate attribute on the text    -->
<!-- element.                                                             -->
<!--                                                                      -->
<!-- Author : Vincent Hardy,  06-Jan-2004                                 --><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="tiny" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
    <SVGTestCase xmlns:testcase="http://www.w3.org/2000/02/svg/testsuite/description/" xmlns="http://www.w3.org/2000/02/svg/testsuite/description/" owner="VH" desc="Tests that the viewer can handle the rotate attribute on the text element" status="accepted" version="$Revision: 1.13 $" testname="$RCSfile: text-text-04-t.svg,v $">
        <OperatorScript>
            <Paragraph>
                The purpose of this test is to validate proper handling of
                the text element's x and y attributes.
                In the various samples, a red marker shows the text's (0,0)
                coordinate. The blue markers show the current text positions.
                These are either defined by absolute x/y positioning or they
                are computed from the embeded font's glyphs advances.
            </Paragraph>
        <Paragraph>
                The first text sample shows a reference piece of text.
        </Paragraph>
        <Paragraph>
                The second text sample (x all) shows a piece of text where 
                all the glyphs are positioned along the x axis.
        </Paragraph>
        <Paragraph>
                The third text sample (x more) is a text element where there 
                are more x values than characters (5 values for 4 characters).
                The last x value should be ignored and the result should
                be the same as the third sample.
        </Paragraph>
        <Paragraph>
                The fourth text sample (x fewer) is a text element where there
                are fewer x values than characters (3 values for 4 characters).
                The last character should not be positioned but laid out normally,
                following its previous character sibling.
        </Paragraph>
        <Paragraph>
                The fifth (y all), sixth (y more) and seventh (y fewer) text sample 
                parallel the second,
                third and fourth test, but for the y attribute values.
        </Paragraph>
        <Paragraph>
                The samples in the right column show combinations of x/y 
                value sets.
        </Paragraph>
        <Paragraph>
                In all the above tests, blue markers represent the expected glyph 
                positions. The red markers are showing positions where no glyph
                should appear. The glyphs are black squares of increasing sizes.
        </Paragraph>
        </OperatorScript>
    </SVGTestCase>
        <defs>
            <font id="embeded" horiz-adv-x="224">
<font-face font-family="embeded" units-per-em="1000" ascent="1000" descent="-250" alphabetic="0"/>
                <missing-glyph horiz-adv-x="800" d="M50 0V800H750V0H50ZM700 50V750H100V50H700Z"/>
                <glyph unicode="1" glyph-name="gl_1" horiz-adv-x="750" d="M 0 0 L 250 0 L 250 250 L 0 250 Z"/>
                <glyph unicode="2" glyph-name="gl_2" horiz-adv-x="750" d="M 0 0 L 500 0 L 500 500 L 0 500 Z"/>
                <glyph unicode="3" glyph-name="gl_3" horiz-adv-x="750" d="M 0 0 L 750 0 L 750 750 L 0 750 Z"/>
                <glyph unicode="4" glyph-name="gl_4" horiz-adv-x="750" d="M 0 0 L 1000 0 L 1000 1000 L 0 1000 Z"/>
             </font>

    </defs>

    <title id="test-title">text-fontSize-01-t.svg</title>
    <desc id="test-desc">Test that viewer has the basic capability to handle different font sizes </desc>

    <!--======================================================================-->
    <!--Content of Test Case follows...                  =====================-->
    <!--======================================================================-->
    <g id="test-body-content" font-size="16">
                <g id="reference" transform="translate(130, 40)">
                    <text text-anchor="end" x="-30">Reference</text>
                    <g>
                        <use xlink:href="#marker" x="0" fill="#8888FF"/>        
                        <use xlink:href="#marker" x="15" fill="#8888FF"/>        
                        <use xlink:href="#marker" x="30" fill="#8888FF"/>        
                        <use xlink:href="#marker" x="45" fill="#8888FF"/>        
                        <text id="ref" font-family="embeded" font-size="20">1234</text>
                    </g>
                </g>
                <defs>
                    <rect id="marker" x="-4" y="-4" width="8" height="8"/>
                </defs>
                <g id="xAll" transform="translate(130, 80)">
                    <text text-anchor="end" x="-30">x all</text>
                    <use xlink:href="#marker" x="0" fill="red"/>        
                    <use xlink:href="#marker" x="20" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="40" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="60" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="80" fill="#8888FF"/>        
                    <text font-family="embeded" font-size="20" x="20 40 60 80">1234</text>        
                </g>

                <g id="xMore" transform="translate(130, 120)">
                    <text text-anchor="end" x="-30">x more</text>
                    <use xlink:href="#marker" x="0" fill="red"/>        
                    <use xlink:href="#marker" x="20" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="40" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="60" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="80" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="100" fill="red"/>        
                    <text font-family="embeded" font-size="20" x="20 40 60 80 100">1234</text>        
                </g>

                <g id="xFewer" transform="translate(130, 160)">
                    <text text-anchor="end" x="-30">x fewer</text>
                    <use xlink:href="#marker" x="0" fill="red"/>        
                    <use xlink:href="#marker" x="20" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="40" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="60" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="75" fill="#8888FF"/>        
                    <text font-family="embeded" font-size="20" x="20 40 60">1234</text>        
                </g>

                <g id="yAll" transform="translate(130, 200)">
                    <text text-anchor="end" x="-30">y all</text>
                    <use xlink:href="#marker" x="0" y="-10" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="15" y="-5" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="30" y="5" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="45" y="10" fill="#8888FF"/>        
                    <text font-family="embeded" font-size="20" y="-10 -5 5 10">1234</text>        
                </g>

                <g id="yMore" transform="translate(130, 250)">
                    <text text-anchor="end" x="-30">y more</text>
                    <use xlink:href="#marker" x="0" y="-10" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="15" y="-5" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="30" y="5" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="45" y="10" fill="#8888FF"/>        
                    <text font-family="embeded" font-size="20" y="-10 -5 5 10 20">1234</text>        
                </g>

                <g id="yFewer" transform="translate(130, 300)">
                    <text text-anchor="end" x="-30">y fewer</text>
                    <use xlink:href="#marker" x="0" y="-10" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="15" y="-5" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="30" y="5" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="45" y="5" fill="#8888FF"/>        
                    <text font-family="embeded" font-size="20" y="-10 -5 5">1234</text>        
                </g>

                <g transform="translate(220, 0)">
                <g id="xyAll" transform="translate(130, 80)">
                    <text text-anchor="end" x="-30">x/y all</text>
                    <use xlink:href="#marker" x="0" fill="red"/>        
                    <use xlink:href="#marker" x="20" y="-10" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="40" y="-5" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="60" y="5" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="80" y="10" fill="#8888FF"/>        
                    <text font-family="embeded" font-size="20" x="20 40 60 80" y="-10 -5 5 10">1234</text>        
                </g>

                <g id="xyMore" transform="translate(130, 120)">
                    <text text-anchor="end" x="-30">x/y more</text>
                    <use xlink:href="#marker" x="0" fill="red"/>        
                    <use xlink:href="#marker" x="20" y="-10" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="40" y="-5" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="60" y="5" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="80" y="10" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="100" y="20" fill="red"/>        
                    <text font-family="embeded" font-size="20" x="20 40 60 80 100" y="-10 -5 5 10 20">1234</text>        
                </g>

                <g id="xyFewer" transform="translate(130, 160)">
                    <text text-anchor="end" x="-30">x/y fewer</text>
                    <use xlink:href="#marker" x="0" fill="red"/>        
                    <use xlink:href="#marker" x="20" y="-10" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="40" y="-5" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="60" y="5" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="75" y="5" fill="#8888FF"/>        
                    <text font-family="embeded" font-size="20" x="20 40 60" y="-10 -5 5">1234</text>        
                </g>

                <g id="xAllyFewer" transform="translate(130, 200)">
                    <text text-anchor="end" x="-30">x all y fewer</text>
                    <use xlink:href="#marker" x="0" fill="red"/>        
                    <use xlink:href="#marker" x="20" y="-10" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="40" y="-5" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="60" y="5" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="80" y="5" fill="#8888FF"/>        
                    <text font-family="embeded" font-size="20" x="20 40 60 80" y="-10 -5 5">1234</text>        
                </g>

                <g id="xFewerYall" transform="translate(130, 240)">
                    <text text-anchor="end" x="-30">x fewer y all</text>
                    <use xlink:href="#marker" x="0" fill="red"/>        
                    <use xlink:href="#marker" x="20" y="-10" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="40" y="-5" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="60" y="5" fill="#8888FF"/>        
                    <use xlink:href="#marker" x="77.52" y="10" fill="#8888FF"/>        
                    <text font-family="embeded" font-size="20" x="20 40 60" y="-10 -5 5 10">1234</text>        
                </g>
                </g>
    </g>


    <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.13 $</text>
    <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
    
<script>
if (window.testRunner)
    testRunner.dumpSelectionRect();
var range = document.createRange();
range.selectNode(window.document.documentElement);
var selection = window.getSelection();
selection.removeAllRanges();
selection.addRange(range);
</script>
</svg>