Title: [118118] trunk
Revision
118118
Author
[email protected]
Date
2012-05-22 21:27:57 -0700 (Tue, 22 May 2012)

Log Message

REGRESSION(r116629) tests for <style scoped> is crashing
https://bugs.webkit.org/show_bug.cgi?id=87191

Source/WebCore:

Reviewed by Kent Tamura.

unregisterWithScopingNode() and registerWithScopingNode() doesn't follow
refactoring around removedFrom(), insertedInto() and willRemove().
This change aligns them to such recent changes.

No new tests. Covered by existing tests.

* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::unregisterWithScopingNode)
(WebCore::HTMLStyleElement::insertedInto):
- Allowed registerWithScopingNode() only for in-document traversal.
  That is how it originally did.
(WebCore::HTMLStyleElement::removedFrom):
- Gave ex-parent to unregisterWithScopingNode().
* html/HTMLStyleElement.h:
(WebCore::HTMLStyleElement::unregisterWithScopingNode):
(HTMLStyleElement):

LayoutTests:

- Unskipped accidentally skipped test for <style scoped>.
- Updated outdated expectations.

Reviewed by Kent Tamura.

* fast/css/style-scoped/style-scoped-in-shadow-expected.txt:
* platform/chromium/test_expectations.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (118117 => 118118)


--- trunk/LayoutTests/ChangeLog	2012-05-23 04:24:42 UTC (rev 118117)
+++ trunk/LayoutTests/ChangeLog	2012-05-23 04:27:57 UTC (rev 118118)
@@ -1,3 +1,16 @@
+2012-05-22  MORITA Hajime  <[email protected]>
+
+        REGRESSION(r116629) tests for <style scoped> is crashing
+        https://bugs.webkit.org/show_bug.cgi?id=87191
+
+        - Unskipped accidentally skipped test for <style scoped>.
+        - Updated outdated expectations.
+
+        Reviewed by Kent Tamura.
+
+        * fast/css/style-scoped/style-scoped-in-shadow-expected.txt:
+        * platform/chromium/test_expectations.txt:
+
 2012-05-21  Shawn Singh  <[email protected]>
 
         Improve W3C conformance of backface-visibility

Modified: trunk/LayoutTests/fast/css/style-scoped/style-scoped-in-shadow-expected.txt (118117 => 118118)


--- trunk/LayoutTests/fast/css/style-scoped/style-scoped-in-shadow-expected.txt	2012-05-23 04:24:42 UTC (rev 118117)
+++ trunk/LayoutTests/fast/css/style-scoped/style-scoped-in-shadow-expected.txt	2012-05-23 04:27:57 UTC (rev 118118)
@@ -14,4 +14,5 @@
 
 TEST COMPLETE
 AAA
+BBB
 DDD

Modified: trunk/LayoutTests/platform/chromium/test_expectations.txt (118117 => 118118)


--- trunk/LayoutTests/platform/chromium/test_expectations.txt	2012-05-23 04:24:42 UTC (rev 118117)
+++ trunk/LayoutTests/platform/chromium/test_expectations.txt	2012-05-23 04:27:57 UTC (rev 118118)
@@ -2778,8 +2778,6 @@
 BUGWK84800 SKIP WIN LINUX : css3/filters/custom/filter-repaint-custom.html = FAIL
 BUGWK84800 SKIP WIN LINUX : css3/filters/custom/effect-color-check.html = FAIL
 
-// <style scoped> not yet enabled.
-BUGWK49142 SKIP : fast/css/style-scoped = PASS
 // CSS Regions tests for region styling and scoped styles
 BUGWK49142 SKIP : fast/regions/style-scoped-in-flow-override-container-style.html = PASS
 BUGWK49142 SKIP : fast/regions/style-scoped-in-flow-override-region-styling-multiple-regions.html = PASS

Modified: trunk/Source/WebCore/ChangeLog (118117 => 118118)


--- trunk/Source/WebCore/ChangeLog	2012-05-23 04:24:42 UTC (rev 118117)
+++ trunk/Source/WebCore/ChangeLog	2012-05-23 04:27:57 UTC (rev 118118)
@@ -1,3 +1,27 @@
+2012-05-22  MORITA Hajime  <[email protected]>
+
+        REGRESSION(r116629) tests for <style scoped> is crashing
+        https://bugs.webkit.org/show_bug.cgi?id=87191
+
+        Reviewed by Kent Tamura.
+
+        unregisterWithScopingNode() and registerWithScopingNode() doesn't follow
+        refactoring around removedFrom(), insertedInto() and willRemove().
+        This change aligns them to such recent changes.
+
+        No new tests. Covered by existing tests.
+
+        * html/HTMLStyleElement.cpp:
+        (WebCore::HTMLStyleElement::unregisterWithScopingNode)
+        (WebCore::HTMLStyleElement::insertedInto):
+        - Allowed registerWithScopingNode() only for in-document traversal.
+          That is how it originally did.
+        (WebCore::HTMLStyleElement::removedFrom):
+        - Gave ex-parent to unregisterWithScopingNode().
+        * html/HTMLStyleElement.h:
+        (WebCore::HTMLStyleElement::unregisterWithScopingNode):
+        (HTMLStyleElement):
+
 2012-05-21  Shawn Singh  <[email protected]>
 
         Improve W3C conformance of backface-visibility

Modified: trunk/Source/WebCore/html/HTMLStyleElement.cpp (118117 => 118118)


--- trunk/Source/WebCore/html/HTMLStyleElement.cpp	2012-05-23 04:24:42 UTC (rev 118117)
+++ trunk/Source/WebCore/html/HTMLStyleElement.cpp	2012-05-23 04:27:57 UTC (rev 118118)
@@ -126,7 +126,7 @@
     m_isRegisteredWithScopingNode = true;
 }
 
-void HTMLStyleElement::unregisterWithScopingNode()
+void HTMLStyleElement::unregisterWithScopingNode(ContainerNode* scope)
 {
     // Note: We cannot rely on the 'scoped' element still being present when this method is invoked.
     // Therefore we cannot rely on scoped()!
@@ -136,7 +136,6 @@
     if (!RuntimeEnabledFeatures::styleScopedEnabled())
         return;
 
-    ContainerNode* scope = parentNode();
     ASSERT(scope);
     if (scope) {
         ASSERT(scope->hasScopedHTMLStyleChild());
@@ -153,12 +152,14 @@
 Node::InsertionNotificationRequest HTMLStyleElement::insertedInto(Node* insertionPoint)
 {
     HTMLElement::insertedInto(insertionPoint);
-    if (insertionPoint->inDocument())
+    if (insertionPoint->inDocument()) {
         StyleElement::insertedIntoDocument(document(), this);
 #if ENABLE(STYLE_SCOPED)
-    if (scoped() && !m_isRegisteredWithScopingNode)
-        registerWithScopingNode();
+        if (scoped() && !m_isRegisteredWithScopingNode)
+            registerWithScopingNode();
 #endif
+    }
+
     return InsertionDone;
 }
 
@@ -171,8 +172,10 @@
     // That is, because willRemove() is also called if an ancestor is removed from the document.
     // Now, if we want to register <style scoped> even if it's not inDocument,
     // we'd need to find a way to discern whether that is the case, or whether <style scoped> itself is about to be removed.
-    if (m_isRegisteredWithScopingNode)
-        unregisterWithScopingNode();
+    if (m_isRegisteredWithScopingNode) {
+        Node* scope = parentNode() ? parentNode() : insertionPoint;
+        unregisterWithScopingNode(toContainerNode(scope));
+    }
 #endif
 
     if (insertionPoint->inDocument())

Modified: trunk/Source/WebCore/html/HTMLStyleElement.h (118117 => 118118)


--- trunk/Source/WebCore/html/HTMLStyleElement.h	2012-05-23 04:24:42 UTC (rev 118117)
+++ trunk/Source/WebCore/html/HTMLStyleElement.h	2012-05-23 04:27:57 UTC (rev 118118)
@@ -77,7 +77,8 @@
     virtual const AtomicString& type() const;
 
     void registerWithScopingNode();
-    void unregisterWithScopingNode();
+    void unregisterWithScopingNode() { unregisterWithScopingNode(parentNode()); }
+    void unregisterWithScopingNode(ContainerNode* scope);
 
     bool m_firedLoad;
     bool m_loadedSheet;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to