Title: [273531] branches/safari-611-branch/Source/WebCore
Revision
273531
Author
[email protected]
Date
2021-02-25 18:51:43 -0800 (Thu, 25 Feb 2021)

Log Message

Cherry-pick r273415. rdar://problem/74763807

    Move PostResolutionCallbackDisabler to resolveComputedStyle
    https://bugs.webkit.org/show_bug.cgi?id=222350

    Reviewed by Ryosuke Niwa.

    It can be constructed and deleted repeatedly in styleForElementIgnoringPendingStylesheets when
    resolveComputedStyle calls it in a loop.

    * dom/Document.cpp:
    (WebCore::Document::styleForElementIgnoringPendingStylesheets):
    * dom/Element.cpp:
    (WebCore::Element::resolveComputedStyle):
    (WebCore::Element::resolvePseudoElementStyle):

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

Modified Paths

Diff

Modified: branches/safari-611-branch/Source/WebCore/ChangeLog (273530 => 273531)


--- branches/safari-611-branch/Source/WebCore/ChangeLog	2021-02-26 02:51:40 UTC (rev 273530)
+++ branches/safari-611-branch/Source/WebCore/ChangeLog	2021-02-26 02:51:43 UTC (rev 273531)
@@ -1,5 +1,42 @@
 2021-02-25  Russell Epstein  <[email protected]>
 
+        Cherry-pick r273415. rdar://problem/74763807
+
+    Move PostResolutionCallbackDisabler to resolveComputedStyle
+    https://bugs.webkit.org/show_bug.cgi?id=222350
+    
+    Reviewed by Ryosuke Niwa.
+    
+    It can be constructed and deleted repeatedly in styleForElementIgnoringPendingStylesheets when
+    resolveComputedStyle calls it in a loop.
+    
+    * dom/Document.cpp:
+    (WebCore::Document::styleForElementIgnoringPendingStylesheets):
+    * dom/Element.cpp:
+    (WebCore::Element::resolveComputedStyle):
+    (WebCore::Element::resolvePseudoElementStyle):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273415 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-02-24  Antti Koivisto  <[email protected]>
+
+            Move PostResolutionCallbackDisabler to resolveComputedStyle
+            https://bugs.webkit.org/show_bug.cgi?id=222350
+
+            Reviewed by Ryosuke Niwa.
+
+            It can be constructed and deleted repeatedly in styleForElementIgnoringPendingStylesheets when
+            resolveComputedStyle calls it in a loop.
+
+            * dom/Document.cpp:
+            (WebCore::Document::styleForElementIgnoringPendingStylesheets):
+            * dom/Element.cpp:
+            (WebCore::Element::resolveComputedStyle):
+            (WebCore::Element::resolvePseudoElementStyle):
+
+2021-02-25  Russell Epstein  <[email protected]>
+
         Cherry-pick r273385. rdar://problem/74753323
 
     Runtime-disabled CSS features still appear enabled via CSS.supports()

Modified: branches/safari-611-branch/Source/WebCore/dom/Document.cpp (273530 => 273531)


--- branches/safari-611-branch/Source/WebCore/dom/Document.cpp	2021-02-26 02:51:40 UTC (rev 273530)
+++ branches/safari-611-branch/Source/WebCore/dom/Document.cpp	2021-02-26 02:51:43 UTC (rev 273531)
@@ -2238,10 +2238,8 @@
     ASSERT(&element.document() == this);
     ASSERT(!element.isPseudoElement() || pseudoElementSpecifier == PseudoId::None);
     ASSERT(pseudoElementSpecifier == PseudoId::None || parentStyle);
+    ASSERT(Style::postResolutionCallbacksAreSuspended());
 
-    // On iOS request delegates called during styleForElement may result in re-entering WebKit and killing the style resolver.
-    Style::PostResolutionCallbackDisabler disabler(*this, Style::PostResolutionCallbackDisabler::DrainCallbacks::No);
-
     SetForScope<bool> change(m_ignorePendingStylesheets, true);
     auto& resolver = element.styleResolver();
 

Modified: branches/safari-611-branch/Source/WebCore/dom/Element.cpp (273530 => 273531)


--- branches/safari-611-branch/Source/WebCore/dom/Element.cpp	2021-02-26 02:51:40 UTC (rev 273530)
+++ branches/safari-611-branch/Source/WebCore/dom/Element.cpp	2021-02-26 02:51:43 UTC (rev 273531)
@@ -3355,6 +3355,9 @@
         elementsRequiringComputedStyle.prepend(&ancestor);
     }
 
+    // On iOS request delegates called during styleForElement may result in re-entering WebKit and killing the style resolver.
+    Style::PostResolutionCallbackDisabler disabler(document(), Style::PostResolutionCallbackDisabler::DrainCallbacks::No);
+
     // Resolve and cache styles starting from the most distant ancestor.
     for (auto& element : elementsRequiringComputedStyle) {
         auto style = document().styleForElementIgnoringPendingStylesheets(*element, computedStyle);
@@ -3423,6 +3426,8 @@
     ASSERT(parentStyle);
     ASSERT(!parentStyle->getCachedPseudoStyle(pseudoElementSpecifier));
 
+    Style::PostResolutionCallbackDisabler disabler(document(), Style::PostResolutionCallbackDisabler::DrainCallbacks::No);
+
     auto style = document().styleForElementIgnoringPendingStylesheets(*this, parentStyle, pseudoElementSpecifier);
     if (!style) {
         style = RenderStyle::createPtr();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to