layout/reftests/image-rect/background-test-parser.html

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

     1 <!DOCTYPE html>
     2 <!--
     3     Any copyright is dedicated to the Public Domain.
     4     http://creativecommons.org/licenses/publicdomain/
     6     Checks if the CSS parser can parse variations of -moz-image-rect() syntax
     7     correctly or fail gracefully.
     8 -->
     9 <html>
    10   <head>
    11     <title>Testcases: -moz-image-rect() [bug 113577]</title>
    12     <style>
    13       div.wrapper {
    14         width: 32px;
    15         height: 32px;
    16         margin: 10px;
    17         background-color: red;
    18       }
    19       div.wrapper div {
    20         width: 32px;
    21         height: 32px;
    22         background: no-repeat;
    23       }
    24       #test1 {
    25         /* tests shorthand notation */
    26         background: transparent scroll no-repeat 0px 0px -moz-image-rect(url(green-16x16-in-blue-32x32.png), 0, 16, 16, 0);
    27       }
    28       #test2 {
    29         /* URL can be a quoted string */
    30         background-image: -moz-image-rect('green-16x16-in-blue-32x32.png',0,16,16,0);
    31       }
    32       #test3 {
    33         /* URL can be a quoted string */
    34         background-image: -moz-image-rect( "green-16x16-in-blue-32x32.png" , 0 , 16 , 16 , 0 );
    35       }
    36       #test4 {
    37         /* Non-quoted URL is not allowed. When the parser encounters a syntax
    38            error, it skips until the closing parenthesis, so background-color
    39            should be painted with yellow since -moz-image-rect(...) is ignored. */
    40         background-image: -moz-image-rect(green-16x16-in-blue-32x32.png, 0, 16, 16, 0);
    41         background-color: yellow;
    42       }
    43       #test5 {
    44         /* Non-quoted URL is not allowed. When the parser encounters a syntax
    45            error, it skips until the closing parenthesis, so background-color
    46            should be ignored since there is no matching closing parenthesis. */
    47         background-image: -moz-image-rect(green-16x16-in-blue-32x32.png, 0, 16, 16, 0;
    48         background-color: yellow;
    49       }
    50       #test6 {
    51         /* this is ignored due to the missing closing parenthesis in #test5 */
    52         background-color: yellow;
    53       }
    54     </style>
    55   </head>
    56   <body>
    57     <div class="wrapper"><div id="test1"></div></div>
    58     <div class="wrapper"><div id="test2"></div></div>
    59     <div class="wrapper"><div id="test3"></div></div>
    60     <div class="wrapper"><div id="test4"></div></div>
    61     <div class="wrapper"><div id="test5"></div></div>
    62     <div class="wrapper"><div id="test6"></div></div>
    63   </body>
    64 </html>

mercurial