⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 273793 in webkit


Ignore:
Timestamp:
Mar 2, 2021, 7:08:42 PM (6 years ago)
Author:
Alan Coon
Message:

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

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

Location:
branches/safari-612.1.5-branch/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-612.1.5-branch/Source/WebCore/ChangeLog

    r273792 r273793  
     12021-03-02  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r273415. rdar://problem/74953177
     4
     5    Move PostResolutionCallbackDisabler to resolveComputedStyle
     6    https://bugs.webkit.org/show_bug.cgi?id=222350
     7   
     8    Reviewed by Ryosuke Niwa.
     9   
     10    It can be constructed and deleted repeatedly in styleForElementIgnoringPendingStylesheets when
     11    resolveComputedStyle calls it in a loop.
     12   
     13    * dom/Document.cpp:
     14    (WebCore::Document::styleForElementIgnoringPendingStylesheets):
     15    * dom/Element.cpp:
     16    (WebCore::Element::resolveComputedStyle):
     17    (WebCore::Element::resolvePseudoElementStyle):
     18   
     19   
     20    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273415 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     21
     22    2021-02-24  Antti Koivisto  <antti@apple.com>
     23
     24            Move PostResolutionCallbackDisabler to resolveComputedStyle
     25            https://bugs.webkit.org/show_bug.cgi?id=222350
     26
     27            Reviewed by Ryosuke Niwa.
     28
     29            It can be constructed and deleted repeatedly in styleForElementIgnoringPendingStylesheets when
     30            resolveComputedStyle calls it in a loop.
     31
     32            * dom/Document.cpp:
     33            (WebCore::Document::styleForElementIgnoringPendingStylesheets):
     34            * dom/Element.cpp:
     35            (WebCore::Element::resolveComputedStyle):
     36            (WebCore::Element::resolvePseudoElementStyle):
     37
    1382021-03-02  Alan Coon  <alancoon@apple.com>
    239
  • branches/safari-612.1.5-branch/Source/WebCore/dom/Document.cpp

    r273220 r273793  
    22082208    ASSERT(!element.isPseudoElement() || pseudoElementSpecifier == PseudoId::None);
    22092209    ASSERT(pseudoElementSpecifier == PseudoId::None || parentStyle);
    2210 
    2211     // On iOS request delegates called during styleForElement may result in re-entering WebKit and killing the style resolver.
    2212     Style::PostResolutionCallbackDisabler disabler(*this, Style::PostResolutionCallbackDisabler::DrainCallbacks::No);
     2210    ASSERT(Style::postResolutionCallbacksAreSuspended());
    22132211
    22142212    SetForScope<bool> change(m_ignorePendingStylesheets, true);
  • branches/safari-612.1.5-branch/Source/WebCore/dom/Element.cpp

    r272618 r273793  
    33563356    }
    33573357
     3358    // On iOS request delegates called during styleForElement may result in re-entering WebKit and killing the style resolver.
     3359    Style::PostResolutionCallbackDisabler disabler(document(), Style::PostResolutionCallbackDisabler::DrainCallbacks::No);
     3360
    33583361    // Resolve and cache styles starting from the most distant ancestor.
    33593362    for (auto& element : elementsRequiringComputedStyle) {
    … …  
    34253428    ASSERT(parentStyle);
    34263429    ASSERT(!parentStyle->getCachedPseudoStyle(pseudoElementSpecifier));
     3430
     3431    Style::PostResolutionCallbackDisabler disabler(document(), Style::PostResolutionCallbackDisabler::DrainCallbacks::No);
    34273432
    34283433    auto style = document().styleForElementIgnoringPendingStylesheets(*this, parentStyle, pseudoElementSpecifier);
Note: See TracChangeset for help on using the changeset viewer.