1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/reftests/image-rect/background-test-parser.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,64 @@ 1.4 +<!DOCTYPE html> 1.5 +<!-- 1.6 + Any copyright is dedicated to the Public Domain. 1.7 + http://creativecommons.org/licenses/publicdomain/ 1.8 + 1.9 + Checks if the CSS parser can parse variations of -moz-image-rect() syntax 1.10 + correctly or fail gracefully. 1.11 +--> 1.12 +<html> 1.13 + <head> 1.14 + <title>Testcases: -moz-image-rect() [bug 113577]</title> 1.15 + <style> 1.16 + div.wrapper { 1.17 + width: 32px; 1.18 + height: 32px; 1.19 + margin: 10px; 1.20 + background-color: red; 1.21 + } 1.22 + div.wrapper div { 1.23 + width: 32px; 1.24 + height: 32px; 1.25 + background: no-repeat; 1.26 + } 1.27 + #test1 { 1.28 + /* tests shorthand notation */ 1.29 + background: transparent scroll no-repeat 0px 0px -moz-image-rect(url(green-16x16-in-blue-32x32.png), 0, 16, 16, 0); 1.30 + } 1.31 + #test2 { 1.32 + /* URL can be a quoted string */ 1.33 + background-image: -moz-image-rect('green-16x16-in-blue-32x32.png',0,16,16,0); 1.34 + } 1.35 + #test3 { 1.36 + /* URL can be a quoted string */ 1.37 + background-image: -moz-image-rect( "green-16x16-in-blue-32x32.png" , 0 , 16 , 16 , 0 ); 1.38 + } 1.39 + #test4 { 1.40 + /* Non-quoted URL is not allowed. When the parser encounters a syntax 1.41 + error, it skips until the closing parenthesis, so background-color 1.42 + should be painted with yellow since -moz-image-rect(...) is ignored. */ 1.43 + background-image: -moz-image-rect(green-16x16-in-blue-32x32.png, 0, 16, 16, 0); 1.44 + background-color: yellow; 1.45 + } 1.46 + #test5 { 1.47 + /* Non-quoted URL is not allowed. When the parser encounters a syntax 1.48 + error, it skips until the closing parenthesis, so background-color 1.49 + should be ignored since there is no matching closing parenthesis. */ 1.50 + background-image: -moz-image-rect(green-16x16-in-blue-32x32.png, 0, 16, 16, 0; 1.51 + background-color: yellow; 1.52 + } 1.53 + #test6 { 1.54 + /* this is ignored due to the missing closing parenthesis in #test5 */ 1.55 + background-color: yellow; 1.56 + } 1.57 + </style> 1.58 + </head> 1.59 + <body> 1.60 + <div class="wrapper"><div id="test1"></div></div> 1.61 + <div class="wrapper"><div id="test2"></div></div> 1.62 + <div class="wrapper"><div id="test3"></div></div> 1.63 + <div class="wrapper"><div id="test4"></div></div> 1.64 + <div class="wrapper"><div id="test5"></div></div> 1.65 + <div class="wrapper"><div id="test6"></div></div> 1.66 + </body> 1.67 +</html>