layout/reftests/bugs/323656-3.html

Wed, 31 Dec 2014 07:16:47 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:16:47 +0100
branch
TOR_BUG_9701
changeset 3
141e0f1194b1
permissions
-rw-r--r--

Revert simplistic fix pending revisit of Mozilla integration attempt.

michael@0 1 <!DOCTYPE html>
michael@0 2 <html>
michael@0 3 <head>
michael@0 4 <title>Test inheritance through various anonymous boxes: {ib}
michael@0 5 situations, buttons, overflow, columns, listboxes, first-line</title>
michael@0 6 <style>
michael@0 7 /**
michael@0 8 * The idea is that "color" inherits by default while "border-color" does
michael@0 9 * not. So if the former is red and the latter is green on a parent, and
michael@0 10 * the child's border-color is set to "inherit", it'll be green only if
michael@0 11 * the child is inheriting from the parent. If not, it'll either be
michael@0 12 * whatever the border-color is on what it's inheriting from, which will
michael@0 13 * be red if what it's inheriting from has the default (currentColor)
michael@0 14 * border-color).
michael@0 15 */
michael@0 16
michael@0 17 /* 't' for "test" */
michael@0 18 * { color: red; border: 0px hidden red; background: transparent }
michael@0 19 .t { border-color: green }
michael@0 20 .t:not(.d2) > :first-child
michael@0 21 { border-color: inherit; border-style: solid; border-width: 10px }
michael@0 22 .d2 > span { border-style: solid; border-width: 10px }
michael@0 23 .f::first-line { border-color: green }
michael@0 24 </style>
michael@0 25 <script>
michael@0 26 function make(str) {
michael@0 27 return document.createElement(str);
michael@0 28 }
michael@0 29
michael@0 30 function makeDiv() {
michael@0 31 return make("div");
michael@0 32 }
michael@0 33
michael@0 34 window.onload = function() {
michael@0 35 var lst = document.getElementsByClassName("d");
michael@0 36 for (var i = 0; i < lst.length; ++i) {
michael@0 37 if (lst[i].nodeName != "select") {
michael@0 38 lst[i].appendChild(makeDiv());
michael@0 39 } else {
michael@0 40 lst[i].appendChild(make("option"));
michael@0 41 }
michael@0 42 }
michael@0 43
michael@0 44 lst = document.getElementsByClassName("d2");
michael@0 45 for (i = 0; i < lst.length; ++i) {
michael@0 46 var span = lst[i].getElementsByTagName("span")[0];
michael@0 47 span.style.cssText =
michael@0 48 "border-color: inherit; border-style: solid; border-width: 10px";
michael@0 49 }
michael@0 50
michael@0 51 var x = document.getElementsByClassName("f d")[0];
michael@0 52 x.appendChild(make("span"));
michael@0 53 x.appendChild(make("br"));
michael@0 54 x.appendChild(make("span"));
michael@0 55 }
michael@0 56 </script>
michael@0 57 </head>
michael@0 58 <body>
michael@0 59 <div class="t"><div></div></div>
michael@0 60 <span class="t"><div></div></span>
michael@0 61 <span style="position: relative" class="t"><div></div></span>
michael@0 62 <div class="f"><span></span><br><span></span></div>
michael@0 63 <button class="t"><div></div></button>
michael@0 64 <div style="overflow: auto" class="t"><div></div></div>
michael@0 65 <div style="-moz-column-count: 2" class="t"><div></div></div>
michael@0 66 <select size="2" class="t">
michael@0 67 <option></option>
michael@0 68 </select>
michael@0 69
michael@0 70 <div class="t d"></div>
michael@0 71 <span class="t d"></span>
michael@0 72 <span style="position: relative" class="t d"></span>
michael@0 73 <div class="f d"></div>
michael@0 74 <button class="t d"></button>
michael@0 75 <div style="overflow: auto" class="t d"></div>
michael@0 76 <div style="-moz-column-count: 2" class="t d"></div>
michael@0 77 <select size="2" class="t d">
michael@0 78 <option></option>
michael@0 79 </select>
michael@0 80
michael@0 81 <span class="t d2"><div></div><span></span></span>
michael@0 82 <span style="position: relative" class="t d2"><div></div><span></span></span>
michael@0 83 </body>
michael@0 84 </html>

mercurial