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

Changeset 273415 in webkit


Ignore:
Timestamp:
Feb 24, 2021, 11:43:35 AM (6 years ago)
Author:
Antti Koivisto
Message:

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):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r273407 r273415  
     12021-02-24  Antti Koivisto  <antti@apple.com>
     2
     3        Move PostResolutionCallbackDisabler to resolveComputedStyle
     4        https://bugs.webkit.org/show_bug.cgi?id=222350
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        It can be constructed and deleted repeatedly in styleForElementIgnoringPendingStylesheets when
     9        resolveComputedStyle calls it in a loop.
     10
     11        * dom/Document.cpp:
     12        (WebCore::Document::styleForElementIgnoringPendingStylesheets):
     13        * dom/Element.cpp:
     14        (WebCore::Element::resolveComputedStyle):
     15        (WebCore::Element::resolvePseudoElementStyle):
     16
    1172021-02-24  Said Abou-Hallawa  <said@apple.com>
    218
  • trunk/Source/WebCore/dom/Document.cpp

    r273374 r273415  
    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);
  • trunk/Source/WebCore/dom/Element.cpp

    r272618 r273415  
    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.