layout/reftests/abs-pos/select-1-dynamic.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 <!DOCTYPE html>
     2 <html>
     3   <select style="position: relative" size=4>
     4     <option>bar</option>
     5   </select>
     6   <select style="position: relative">
     7     <option>bar</option>
     8   </select>
     9   <script>
    10     function injectAbsPosKid(s) {
    11       var option = document.createElement("option");
    12       option.appendChild(document.createTextNode("foo"));
    13       option.style.position = "absolute";
    14       option.style.top = "100px";
    15       s.insertBefore(option, s.firstChild);
    17       var div = document.createElement("div");
    18       div.appendChild(document.createTextNode("bar"));
    19       div.style.position = "absolute";
    20       div.style.top = "200px";
    21       s.appendChild(div);
    22     }
    23     onload = function() {
    24       var s1 = document.querySelectorAll("select")[0];
    25       var s2 = document.querySelectorAll("select")[1];
    26       injectAbsPosKid(s1);
    27       injectAbsPosKid(s2);
    28       s2.selectedIndex = 0;
    29     };
    30   </script>
    31 </html>

mercurial