Title: [131464] trunk
Revision
131464
Author
[email protected]
Date
2012-10-16 09:23:43 -0700 (Tue, 16 Oct 2012)

Log Message

[Meta] [Shadow] contenteditable attribute for distributed nodes.
https://bugs.webkit.org/show_bug.cgi?id=90017

Patch by Takashi Sakamoto <[email protected]> on 2012-10-16
Reviewed by Dimitri Glazkov.

Source/WebCore:

If an element is distributed to an insertion point, the element's
webkit-user-modify is inherited from its shadow host.

No new tests, because the existing test: user-modify-inheritance.html
covers this change.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::styleForElement):
After an element inherits a style from its parent, override user-modify
by using the shadow host's style if the element is distributed.

LayoutTests:

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

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (131463 => 131464)


--- trunk/LayoutTests/ChangeLog	2012-10-16 16:21:49 UTC (rev 131463)
+++ trunk/LayoutTests/ChangeLog	2012-10-16 16:23:43 UTC (rev 131464)
@@ -1,3 +1,13 @@
+2012-10-16  Takashi Sakamoto  <[email protected]>
+
+        [Meta] [Shadow] contenteditable attribute for distributed nodes.
+        https://bugs.webkit.org/show_bug.cgi?id=90017
+
+        Reviewed by Dimitri Glazkov.
+
+        * fast/dom/shadow/user-modify-inheritance-expected.txt:
+        * fast/dom/shadow/user-modify-inheritance.html:
+
 2012-10-16  Vsevolod Vlasov  <[email protected]>
 
         Web Inspector: Get rid of (now empty) _javascript_Source and StyleSource, rename all usages to UISourceCode.

Modified: trunk/LayoutTests/fast/dom/shadow/user-modify-inheritance-expected.txt (131463 => 131464)


--- trunk/LayoutTests/fast/dom/shadow/user-modify-inheritance-expected.txt	2012-10-16 16:21:49 UTC (rev 131463)
+++ trunk/LayoutTests/fast/dom/shadow/user-modify-inheritance-expected.txt	2012-10-16 16:23:43 UTC (rev 131464)
@@ -10,7 +10,9 @@
 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"
-FAIL getUserModifyProperty("child-b") should be read-write. Was read-only.
+PASS getUserModifyProperty("child-b") is "read-write"
+PASS getUserModifyProperty("child-c") is "read-only"
+PASS getUserModifyProperty("child-d") is "read-only"
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/fast/dom/shadow/user-modify-inheritance.html (131463 => 131464)


--- trunk/LayoutTests/fast/dom/shadow/user-modify-inheritance.html	2012-10-16 16:21:49 UTC (rev 131463)
+++ trunk/LayoutTests/fast/dom/shadow/user-modify-inheritance.html	2012-10-16 16:23:43 UTC (rev 131464)
@@ -13,6 +13,7 @@
 <div id="non-contenteditable-host2"></div>
 <div id="non-contenteditable-host3"></div>
 <div id="sandbox"></div>
+<div id="sandbox2"></div>
 <pre id="console"></pre>
 <script>
 description("Tests to ensure that a '-webkit-user-modify' CSS porperty is not inherited across shadow boundaries.");
@@ -62,9 +63,19 @@
 document.body.offsetLeft;
 
 shouldBeEqualToString('getUserModifyProperty("child-a")', 'read-write');
-/* FIXME(90017): css property: -user-modify should be inherited from parent.*/
 shouldBeEqualToString('getUserModifyProperty("child-b")', 'read-write');
 
+document.getElementById('sandbox2').appendChild(
+    createDOM('div', {'id': 'host', 'contenteditable': 'false'},
+              createShadowRoot(createDOM('content', {'select': '#child-c'}),
+                               createDOM('div', {'contenteditable' : 'true'},
+                                         createDOM('content', {'select': '#child-d'}))),
+              createDOM('div', {'id': 'child-c'}),
+              createDOM('div', {'id': 'child-d'})));
+
+shouldBeEqualToString('getUserModifyProperty("child-c")', 'read-only');
+shouldBeEqualToString('getUserModifyProperty("child-d")', 'read-only');
+
 </script>
 <script src=""
 </body>

Modified: trunk/Source/WebCore/ChangeLog (131463 => 131464)


--- trunk/Source/WebCore/ChangeLog	2012-10-16 16:21:49 UTC (rev 131463)
+++ trunk/Source/WebCore/ChangeLog	2012-10-16 16:23:43 UTC (rev 131464)
@@ -1,3 +1,21 @@
+2012-10-16  Takashi Sakamoto  <[email protected]>
+
+        [Meta] [Shadow] contenteditable attribute for distributed nodes.
+        https://bugs.webkit.org/show_bug.cgi?id=90017
+
+        Reviewed by Dimitri Glazkov.
+
+        If an element is distributed to an insertion point, the element's
+        webkit-user-modify is inherited from its shadow host.
+
+        No new tests, because the existing test: user-modify-inheritance.html
+        covers this change.
+
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::styleForElement):
+        After an element inherits a style from its parent, override user-modify
+        by using the shadow host's style if the element is distributed.
+
 2012-10-16  Vsevolod Vlasov  <[email protected]>
 
         Web Inspector: Get rid of (now empty) _javascript_Source and StyleSource, rename all usages to UISourceCode.

Modified: trunk/Source/WebCore/css/StyleResolver.cpp (131463 => 131464)


--- trunk/Source/WebCore/css/StyleResolver.cpp	2012-10-16 16:21:49 UTC (rev 131463)
+++ trunk/Source/WebCore/css/StyleResolver.cpp	2012-10-16 16:23:43 UTC (rev 131464)
@@ -1543,6 +1543,13 @@
         cloneForParent = RenderStyle::clone(style());
         m_parentStyle = cloneForParent.get();
     }
+    // contenteditable attribute (implemented by -webkit-user-modify) should
+    // be propagated from shadow host to distributed node.
+    if (m_distributedToInsertionPoint) {
+        ASSERT(element->parentElement());
+        ASSERT(element->parentElement()->renderStyle());
+        m_style->setUserModify(element->parentElement()->renderStyle()->userModify());
+    }
 
     if (element->isLink()) {
         m_style->setIsLink(true);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to