1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/reftests/image-rect/background-common-usage-floating-point.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 + test1 and test2 test -moz-image-rect() where the image rect is specified by 1.10 + mixed pixel values and percentage values. 1.11 + 1.12 + -moz-image-rect() can also take a floating point value for each side, and 1.13 + each floating point value (after percent to pixel conversion) is rounded to 1.14 + the nearest integer. test3 and test4 test if the rounding operation is 1.15 + working as expected. 1.16 +--> 1.17 +<html> 1.18 + <head> 1.19 + <title>Testcases: -moz-image-rect() [bug 113577]</title> 1.20 + <style> 1.21 + div.wrapper { 1.22 + width: 32px; 1.23 + height: 32px; 1.24 + margin: 10px; 1.25 + background-color: red; 1.26 + } 1.27 + div.wrapper div { 1.28 + width: 32px; 1.29 + height: 32px; 1.30 + background: no-repeat; 1.31 + } 1.32 + #test1 { 1.33 + background-image: -moz-image-rect(url(green-16x16-in-blue-32x32.png), 0, 32, 100%, 0%); 1.34 + } 1.35 + #test2 { 1.36 + background-image: -moz-image-rect(url(transparent-16x16-in-blue-32x32.png), 0%, 32, 50%, 0); 1.37 + } 1.38 + #test3 { 1.39 + background-image: -moz-image-rect(url(green-16x16-in-blue-32x32.png), 0.3, 16.2, 15.5, 0.4); 1.40 + } 1.41 + #test4 { 1.42 + background-color: yellow; 1.43 + background-image: -moz-image-rect(url(transparent-16x16-in-blue-32x32.png), 51.2%, 100.4%, 99.2%, 48.9%); 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>