layout/reftests/image-rect/background-monster-rect.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/reftests/image-rect/background-monster-rect.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,47 @@
     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 huge values that overflow when converted to PRInt32 and small
    1.10 +    non-zero values do not cause a crash or an unexpected behavior.
    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 +      }
    1.26 +      /* Huge values that exceed PR_INT32_MAX are clamped to PR_INT32_MAX, so
    1.27 +         all the tests below should display the entire 32x32 image. */
    1.28 +      #test1 {
    1.29 +        background-image: -moz-image-rect(url(green-16x16-in-blue-32x32.png), 0, 10000000000, 32, 0);
    1.30 +      }
    1.31 +      #test2 {
    1.32 +        background-image: -moz-image-rect(url(green-16x16-in-blue-32x32.png), 0%, 10000000000%, 100%, 0%);
    1.33 +      }
    1.34 +      /* Small values (smaller than machine epsilon) are rounded to zero, so
    1.35 +         all the tests below should display the entire 32x32 image. */
    1.36 +      #test3 {
    1.37 +        background-image: -moz-image-rect(url(green-16x16-in-blue-32x32.png), 0.00000000001, 32, 32, 0);
    1.38 +      }
    1.39 +      #test4 {
    1.40 +        background-image: -moz-image-rect(url(green-16x16-in-blue-32x32.png), 0.00000000001%, 100%, 100%, 0%);
    1.41 +      }
    1.42 +    </style>
    1.43 +  </head>
    1.44 +  <body>
    1.45 +    <div class="wrapper"><div id="test1"></div></div>
    1.46 +    <div class="wrapper"><div id="test2"></div></div>
    1.47 +    <div class="wrapper"><div id="test3"></div></div>
    1.48 +    <div class="wrapper"><div id="test4"></div></div>
    1.49 +  </body>
    1.50 +</html>

mercurial