Title: [240377] branches/safari-607-branch/Source/WebCore
Revision
240377
Author
[email protected]
Date
2019-01-23 17:21:22 -0800 (Wed, 23 Jan 2019)

Log Message

Cherry-pick r240037. rdar://problem/47458128

    Add more assertions to find root cause for release assert hit in StyleResolver
    https://bugs.webkit.org/show_bug.cgi?id=193488
    <rdar://problem/30983040>

    Reviewed by Zalan Bujtas.

    * css/StyleResolver.cpp:
    (WebCore::StyleResolver::~StyleResolver):

    Release assert we are not resolving tree style.

    * dom/Document.cpp:
    (WebCore::Document::setIsResolvingTreeStyle):
    * dom/Document.h:
    (WebCore::Document::isResolvingTreeStyle const):
    * style/StyleTreeResolver.cpp:
    (WebCore::Style::TreeResolver::Scope::Scope):
    (WebCore::Style::TreeResolver::Scope::~Scope):

    Set isResolvingTreeStyle bit when we have a tree resolver scope.

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

Modified Paths

Diff

Modified: branches/safari-607-branch/Source/WebCore/ChangeLog (240376 => 240377)


--- branches/safari-607-branch/Source/WebCore/ChangeLog	2019-01-24 01:21:18 UTC (rev 240376)
+++ branches/safari-607-branch/Source/WebCore/ChangeLog	2019-01-24 01:21:22 UTC (rev 240377)
@@ -1,5 +1,56 @@
 2019-01-23  Alan Coon  <[email protected]>
 
+        Cherry-pick r240037. rdar://problem/47458128
+
+    Add more assertions to find root cause for release assert hit in StyleResolver
+    https://bugs.webkit.org/show_bug.cgi?id=193488
+    <rdar://problem/30983040>
+    
+    Reviewed by Zalan Bujtas.
+    
+    * css/StyleResolver.cpp:
+    (WebCore::StyleResolver::~StyleResolver):
+    
+    Release assert we are not resolving tree style.
+    
+    * dom/Document.cpp:
+    (WebCore::Document::setIsResolvingTreeStyle):
+    * dom/Document.h:
+    (WebCore::Document::isResolvingTreeStyle const):
+    * style/StyleTreeResolver.cpp:
+    (WebCore::Style::TreeResolver::Scope::Scope):
+    (WebCore::Style::TreeResolver::Scope::~Scope):
+    
+    Set isResolvingTreeStyle bit when we have a tree resolver scope.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240037 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-01-16  Antti Koivisto  <[email protected]>
+
+            Add more assertions to find root cause for release assert hit in StyleResolver
+            https://bugs.webkit.org/show_bug.cgi?id=193488
+            <rdar://problem/30983040>
+
+            Reviewed by Zalan Bujtas.
+
+            * css/StyleResolver.cpp:
+            (WebCore::StyleResolver::~StyleResolver):
+
+            Release assert we are not resolving tree style.
+
+            * dom/Document.cpp:
+            (WebCore::Document::setIsResolvingTreeStyle):
+            * dom/Document.h:
+            (WebCore::Document::isResolvingTreeStyle const):
+            * style/StyleTreeResolver.cpp:
+            (WebCore::Style::TreeResolver::Scope::Scope):
+            (WebCore::Style::TreeResolver::Scope::~Scope):
+
+            Set isResolvingTreeStyle bit when we have a tree resolver scope.
+
+2019-01-23  Alan Coon  <[email protected]>
+
         Cherry-pick r240000. rdar://problem/47457985
 
     Correctly handle rotation for local video playback

Modified: branches/safari-607-branch/Source/WebCore/css/StyleResolver.cpp (240376 => 240377)


--- branches/safari-607-branch/Source/WebCore/css/StyleResolver.cpp	2019-01-24 01:21:18 UTC (rev 240376)
+++ branches/safari-607-branch/Source/WebCore/css/StyleResolver.cpp	2019-01-24 01:21:22 UTC (rev 240377)
@@ -267,6 +267,7 @@
 
 StyleResolver::~StyleResolver()
 {
+    RELEASE_ASSERT(!m_document.isResolvingTreeStyle());
     RELEASE_ASSERT(!m_isDeleted);
     m_isDeleted = true;
 

Modified: branches/safari-607-branch/Source/WebCore/dom/Document.cpp (240376 => 240377)


--- branches/safari-607-branch/Source/WebCore/dom/Document.cpp	2019-01-24 01:21:18 UTC (rev 240376)
+++ branches/safari-607-branch/Source/WebCore/dom/Document.cpp	2019-01-24 01:21:22 UTC (rev 240377)
@@ -2324,6 +2324,12 @@
     m_userAgentShadowTreeStyleResolver = nullptr;
 }
 
+void Document::setIsResolvingTreeStyle(bool value)
+{
+    RELEASE_ASSERT(value != m_isResolvingTreeStyle);
+    m_isResolvingTreeStyle = value;
+}
+
 void Document::createRenderTree()
 {
     ASSERT(!renderView());

Modified: branches/safari-607-branch/Source/WebCore/dom/Document.h (240376 => 240377)


--- branches/safari-607-branch/Source/WebCore/dom/Document.h	2019-01-24 01:21:18 UTC (rev 240376)
+++ branches/safari-607-branch/Source/WebCore/dom/Document.h	2019-01-24 01:21:22 UTC (rev 240377)
@@ -1330,6 +1330,8 @@
 
     bool inStyleRecalc() const { return m_inStyleRecalc; }
     bool inRenderTreeUpdate() const { return m_inRenderTreeUpdate; }
+    bool isResolvingTreeStyle() const { return m_isResolvingTreeStyle; }
+    void setIsResolvingTreeStyle(bool);
 
     void updateTextRenderer(Text&, unsigned offsetOfReplacedText, unsigned lengthOfReplacedText);
 
@@ -2002,6 +2004,7 @@
     bool m_inStyleRecalc { false };
     bool m_closeAfterStyleRecalc { false };
     bool m_inRenderTreeUpdate { false };
+    bool m_isResolvingTreeStyle { false };
 
     bool m_gotoAnchorNeededAfterStylesheetsLoad { false };
     bool m_isDNSPrefetchEnabled { false };

Modified: branches/safari-607-branch/Source/WebCore/style/StyleTreeResolver.cpp (240376 => 240377)


--- branches/safari-607-branch/Source/WebCore/style/StyleTreeResolver.cpp	2019-01-24 01:21:18 UTC (rev 240376)
+++ branches/safari-607-branch/Source/WebCore/style/StyleTreeResolver.cpp	2019-01-24 01:21:22 UTC (rev 240377)
@@ -67,6 +67,7 @@
     : styleResolver(document.styleScope().resolver())
     , sharingResolver(document, styleResolver.ruleSets(), selectorFilter)
 {
+    document.setIsResolvingTreeStyle(true);
 }
 
 TreeResolver::Scope::Scope(ShadowRoot& shadowRoot, Scope& enclosingScope)
@@ -80,6 +81,9 @@
 
 TreeResolver::Scope::~Scope()
 {
+    if (!shadowRoot)
+        styleResolver.document().setIsResolvingTreeStyle(false);
+
     styleResolver.setOverrideDocumentElementStyle(nullptr);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to