layout/reftests/image-rect/background-common-usage-floating-point.html

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

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 test1 and test2 test -moz-image-rect() where the image rect is specified by
michael@0 7 mixed pixel values and percentage values.
michael@0 8
michael@0 9 -moz-image-rect() can also take a floating point value for each side, and
michael@0 10 each floating point value (after percent to pixel conversion) is rounded to
michael@0 11 the nearest integer. test3 and test4 test if the rounding operation is
michael@0 12 working as expected.
michael@0 13 -->
michael@0 14 <html>
michael@0 15 <head>
michael@0 16 <title>Testcases: -moz-image-rect() [bug 113577]</title>
michael@0 17 <style>
michael@0 18 div.wrapper {
michael@0 19 width: 32px;
michael@0 20 height: 32px;
michael@0 21 margin: 10px;
michael@0 22 background-color: red;
michael@0 23 }
michael@0 24 div.wrapper div {
michael@0 25 width: 32px;
michael@0 26 height: 32px;
michael@0 27 background: no-repeat;
michael@0 28 }
michael@0 29 #test1 {
michael@0 30 background-image: -moz-image-rect(url(green-16x16-in-blue-32x32.png), 0, 32, 100%, 0%);
michael@0 31 }
michael@0 32 #test2 {
michael@0 33 background-image: -moz-image-rect(url(transparent-16x16-in-blue-32x32.png), 0%, 32, 50%, 0);
michael@0 34 }
michael@0 35 #test3 {
michael@0 36 background-image: -moz-image-rect(url(green-16x16-in-blue-32x32.png), 0.3, 16.2, 15.5, 0.4);
michael@0 37 }
michael@0 38 #test4 {
michael@0 39 background-color: yellow;
michael@0 40 background-image: -moz-image-rect(url(transparent-16x16-in-blue-32x32.png), 51.2%, 100.4%, 99.2%, 48.9%);
michael@0 41 }
michael@0 42 </style>
michael@0 43 </head>
michael@0 44 <body>
michael@0 45 <div class="wrapper"><div id="test1"></div></div>
michael@0 46 <div class="wrapper"><div id="test2"></div></div>
michael@0 47 <div class="wrapper"><div id="test3"></div></div>
michael@0 48 <div class="wrapper"><div id="test4"></div></div>
michael@0 49 </body>
michael@0 50 </html>

mercurial