Wed, 31 Dec 2014 07:16:47 +0100
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 into captions</title> |
michael@0 | 5 | <style> |
michael@0 | 6 | /** |
michael@0 | 7 | * The idea is that "color" inherits by default while "border-color" does |
michael@0 | 8 | * not. So if the former is red and the latter is green on a parent, and |
michael@0 | 9 | * the child's border-color is set to "inherit", it'll be green only if |
michael@0 | 10 | * the child is inheriting from the parent. If not, it'll either be |
michael@0 | 11 | * whatever the border-color is on what it's inheriting from, which will |
michael@0 | 12 | * be red if what it's inheriting from has the default (currentColor) |
michael@0 | 13 | * border-color). |
michael@0 | 14 | */ |
michael@0 | 15 | |
michael@0 | 16 | /* 't' for "test" */ |
michael@0 | 17 | * { color: red; border: 0px hidden red; background: transparent } |
michael@0 | 18 | .t, .t2 { border-color: green } |
michael@0 | 19 | .t > caption |
michael@0 | 20 | { border-color: inherit; border-style: solid; border-width: 10px } |
michael@0 | 21 | .t2 > caption |
michael@0 | 22 | { border-style: solid; border-width: 10px } |
michael@0 | 23 | .t2 > caption.test |
michael@0 | 24 | { border-color: inherit } |
michael@0 | 25 | </style> |
michael@0 | 26 | <script> |
michael@0 | 27 | function makeCaption() { |
michael@0 | 28 | return document.createElement("caption"); |
michael@0 | 29 | } |
michael@0 | 30 | |
michael@0 | 31 | window.onload = function() { |
michael@0 | 32 | var lst = document.getElementsByClassName("d"); |
michael@0 | 33 | for (var i = 0; i < lst.length; ++i) { |
michael@0 | 34 | lst[i].appendChild(makeCaption()); |
michael@0 | 35 | } |
michael@0 | 36 | |
michael@0 | 37 | var lst = document.getElementsByClassName("d2"); |
michael@0 | 38 | for (var i = 0; i < lst.length; ++i) { |
michael@0 | 39 | lst[i].firstChild.className = "test"; |
michael@0 | 40 | } |
michael@0 | 41 | } |
michael@0 | 42 | </script> |
michael@0 | 43 | </head> |
michael@0 | 44 | <body> |
michael@0 | 45 | <table class="t"><caption></caption></table> |
michael@0 | 46 | |
michael@0 | 47 | <table class="t2 d2"><caption></caption></table> |
michael@0 | 48 | |
michael@0 | 49 | <table class="t d"></table> |
michael@0 | 50 | <div class="t d"></div> |
michael@0 | 51 | <div style="display: table" class="t d"></div> |
michael@0 | 52 | |
michael@0 | 53 | <table class="t2 d d2"></table> |
michael@0 | 54 | <div class="t2 d d2"></div> |
michael@0 | 55 | <div style="display: table" class="t2 d d2"></div> |
michael@0 | 56 | </body> |
michael@0 | 57 | </html> |