Add a test for a 'user-modify' css property of distributed nodes.
authorhayato@chromium.org <hayato@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jun 2012 00:59:37 +0000 (00:59 +0000)
committerhayato@chromium.org <hayato@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jun 2012 00:59:37 +0000 (00:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=90197

Reviewed by Ryosuke Niwa.

* fast/dom/shadow/user-modify-inheritance-expected.txt:
* fast/dom/shadow/user-modify-inheritance.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121495 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/dom/shadow/user-modify-inheritance-expected.txt
LayoutTests/fast/dom/shadow/user-modify-inheritance.html

index fef8cd1..71cd1b2 100644 (file)
@@ -1,3 +1,13 @@
+2012-06-28  Hayato Ito  <hayato@chromium.org>
+
+        Add a test for a 'user-modify' css property of distributed nodes.
+        https://bugs.webkit.org/show_bug.cgi?id=90197
+
+        Reviewed by Ryosuke Niwa.
+
+        * fast/dom/shadow/user-modify-inheritance-expected.txt:
+        * fast/dom/shadow/user-modify-inheritance.html:
+
 2012-06-28  Elliott Sprehn  <esprehn@gmail.com>
 
         frameborder="no" on frameset is ignored if border attribute set
index 5296d36..c76e10d 100644 (file)
@@ -9,6 +9,8 @@ PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("contentedita
 PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host1"), null), userModifyPropertyName) is "read-only"
 PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host2"), "false"), userModifyPropertyName) is "read-only"
 PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host3"), "true"), userModifyPropertyName) is "read-write"
+PASS getUserModifyProperty("child-a") is "read-write"
+PASS getUserModifyProperty("child-b") is "read-write"
 PASS successfullyParsed is true
 
 TEST COMPLETE
index 49c00e8..9905436 100644 (file)
@@ -2,6 +2,7 @@
 <html>
 <head>
 <script src="../../js/resources/js-test-pre.js"></script>
+<script src="resources/shadow-dom.js"></script>
 </head>
 <body>
 <p id="description"></p>
@@ -11,6 +12,7 @@
 <div id="non-contenteditable-host1"></div>
 <div id="non-contenteditable-host2"></div>
 <div id="non-contenteditable-host3"></div>
+<div id="sandbox"></div>
 <pre id="console"></pre>
 <script>
 description("Tests to ensure that a '-webkit-user-modify' CSS porperty is not inherited across shadow boundaries.");
@@ -26,6 +28,10 @@ function computedStyle(element, style) {
     return undefined;
 }
 
+function getUserModifyProperty(id) {
+    return computedStyle(document.getElementById("child-a"), userModifyPropertyName);
+}
+
 function prepareNodeInShadowRoot(host, contentEditableAttributeValueForNode) {
     var shadowRoot = new WebKitShadowRoot(host);
     var nodeInShadow = document.createElement('div');
@@ -44,6 +50,20 @@ shouldBeEqualToString('computedStyle(prepareNodeInShadowRoot(document.getElement
 shouldBeEqualToString('computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host1"), null), userModifyPropertyName)', 'read-only');
 shouldBeEqualToString('computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host2"), "false"), userModifyPropertyName)', 'read-only');
 shouldBeEqualToString('computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host3"), "true"), userModifyPropertyName)', 'read-write');
+
+document.getElementById('sandbox').appendChild(
+    createDOM('div', {'id': 'host', 'contenteditable': 'true'},
+              createShadowRoot(createDOM('content', {'select': '#child-a'}),
+                               createDOM('div', {},
+                                         createDOM('content', {'select': '#child-b'}))),
+              createDOM('div', {'id': 'child-a'}),
+              createDOM('div', {'id': 'child-b'})));
+
+document.body.offsetLeft;
+
+shouldBeEqualToString('getUserModifyProperty("child-a")', 'read-write');
+shouldBeEqualToString('getUserModifyProperty("child-b")', 'read-write');
+
 </script>
 <script src="../../js/resources/js-test-post.js"></script>
 </body>