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