1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/reftests/image-rect/background-draw-nothing-empty-rect.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,50 @@ 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 + Makes sure that no image is drawn when an empty region of the source image 1.10 + is specified by -moz-image-rect(). 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 + /* Zero width and height */ 1.28 + #test1 { 1.29 + background-image: -moz-image-rect(url(green-16x16-in-blue-32x32.png), 0, 0, 0, 0); 1.30 + } 1.31 + /* Negative height */ 1.32 + #test2 { 1.33 + background-image: -moz-image-rect(url(green-16x16-in-blue-32x32.png), 32, 32, 0, 0); 1.34 + } 1.35 + /* Image rect outside the source image */ 1.36 + #test3 { 1.37 + background-image: -moz-image-rect(url(green-16x16-in-blue-32x32.png), 100, 200, 200, 100); 1.38 + } 1.39 + /* Negative height */ 1.40 + #test4 { 1.41 + /* It is only after the source image size is available that it can be 1.42 + determined if this image is empty or not. */ 1.43 + background-image: -moz-image-rect(url(green-16x16-in-blue-32x32.png), 16, 32, 50%, 16); 1.44 + } 1.45 + </style> 1.46 + </head> 1.47 + <body> 1.48 + <div class="wrapper"><div id="test1"></div></div> 1.49 + <div class="wrapper"><div id="test2"></div></div> 1.50 + <div class="wrapper"><div id="test3"></div></div> 1.51 + <div class="wrapper"><div id="test4"></div></div> 1.52 + </body> 1.53 +</html>