Index: LayoutTests/fast/dom/shadow/lang-attribute-inherit.html |
diff --git a/LayoutTests/fast/dom/shadow/lang-attribute-inherit.html b/LayoutTests/fast/dom/shadow/lang-attribute-inherit.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ba3f7974887e9c848a6247b5cbb606f56ee4eef1 |
--- /dev/null |
+++ b/LayoutTests/fast/dom/shadow/lang-attribute-inherit.html |
@@ -0,0 +1,26 @@ |
+<!DOCTYPE html> |
+<script src="../../../resources/testharness.js"></script> |
+<script src="../../../resources/testharnessreport.js"></script> |
+<div id="container" lang="ja"> |
+ <div id="host"></div> |
+ <div id="hostWithContent"><div>Should be visible</div></div> |
+</div> |
+<script> |
+var host = document.getElementById("host"); |
+var root = host.createShadowRoot(); |
+root.innerHTML = "<style>:lang(ja) { display:none; }</style><div lang='fr'>Should be visible</div><div>Should be hidden</div>"; |
+test(function () { |
+ var japanese = root.lastChild; |
+ assert_equals(japanese.offsetHeight, 0); |
hayato
2015/01/21 09:04:50
Could you also assert "<div lang='fr'>Should be vi
kojii
2015/01/21 16:46:20
Done.
|
+}, "lang inherits into shadow tree"); |
+ |
+host = document.getElementById("hostWithContent"); |
+root = host.createShadowRoot(); |
+root.innerHTML = "<style>:lang(ja) { display:none; }</style><div lang='fr'><content></content></div>"; |
+test(function () { |
+ var content = host.firstChild; |
+ assert_not_equals(content.offsetHeight, 0); |
+}, "lang of distributed content traverses composed tree"); |
+if (window.testRunner) |
+ container.style.display = "none"; |
+</script> |