layout/reftests/image-element/mozsetimageelement-01.html

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     1 <!--
     2      Any copyright is dedicated to the Public Domain.
     3      http://creativecommons.org/licenses/publicdomain/
     5      Test document.mozSetImageElement() DOM API and check if ID targets are
     6      correctly overridden.
     7 -->
     8 <html>
     9   <head>
    10     <style>
    11       div {
    12         width: 10px;
    13         height: 10px;
    14       }
    15     </style>
    16   </head>
    17 <body style="margin:0">
    18   <div style="background:-moz-element(#d1);"></div>
    19   <div style="background:-moz-element(#d2);"></div>
    20   <div style="background:-moz-element(#d3);"></div>
    22   <div style="overflow:hidden; height:0;">
    23     <div id="d1" style="background:red;"></div>
    24     <div id="d2" style="background:blue;"></div>
    25     <!-- two elements with the same ID: the former one will be used -->
    26     <div id="d3" style="background:black;"></div>
    27     <div id="d3" style="background:yellow;"></div>
    28   </div>
    30   <script>
    31       var d1 = document.getElementById("d1");
    32       var d2 = document.getElementById("d2");
    33       var d3 = document.getElementById("d3");
    34       document.mozSetImageElement("d1", d3);
    35       document.mozSetImageElement("d2", null);
    36       document.mozSetImageElement("d3", d1);
    37       document.mozSetImageElement("d3", null);
    38       document.mozSetImageElement("d4", d1);
    39       document.mozSetImageElement("", d1);
    40       d1.id = "d2";
    41       d2.id = "d1";
    42   </script>
    43 </body>
    44 </html>

mercurial