layout/reftests/image-rect/background-draw-nothing-empty-rect.html

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

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 Makes sure that no image is drawn when an empty region of the source image
michael@0 7 is specified by -moz-image-rect().
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 /* Zero width and height */
michael@0 25 #test1 {
michael@0 26 background-image: -moz-image-rect(url(green-16x16-in-blue-32x32.png), 0, 0, 0, 0);
michael@0 27 }
michael@0 28 /* Negative height */
michael@0 29 #test2 {
michael@0 30 background-image: -moz-image-rect(url(green-16x16-in-blue-32x32.png), 32, 32, 0, 0);
michael@0 31 }
michael@0 32 /* Image rect outside the source image */
michael@0 33 #test3 {
michael@0 34 background-image: -moz-image-rect(url(green-16x16-in-blue-32x32.png), 100, 200, 200, 100);
michael@0 35 }
michael@0 36 /* Negative height */
michael@0 37 #test4 {
michael@0 38 /* It is only after the source image size is available that it can be
michael@0 39 determined if this image is empty or not. */
michael@0 40 background-image: -moz-image-rect(url(green-16x16-in-blue-32x32.png), 16, 32, 50%, 16);
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