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

Changeset 280586 in webkit


Ignore:
Timestamp:
Aug 3, 2021, 12:38:08 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Check that shadow root is connected in invalidateStyleAfterStyleSheetChange
https://bugs.webkit.org/show_bug.cgi?id=227383

Patch by Rob Buis <rbuis@igalia.com> on 2021-08-03
Reviewed by Antti Koivisto.

Source/WebCore:

Check that shadow root is connected in invalidateStyleAfterStyleSheetChange.

Test: fast/shadow-dom/shadow-tree-removal-crash.html

  • style/StyleScope.cpp:

(WebCore::Style::Scope::updateActiveStyleSheets):

LayoutTests:

Add test for this.

  • fast/shadow-dom/shadow-tree-removal-crash-expected.txt: Added.
  • fast/shadow-dom/shadow-tree-removal-crash.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r280584 r280586  
     12021-08-03  Rob Buis  <rbuis@igalia.com>
     2
     3        Check that shadow root is connected in invalidateStyleAfterStyleSheetChange
     4        https://bugs.webkit.org/show_bug.cgi?id=227383
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Add test for this.
     9
     10        * fast/shadow-dom/shadow-tree-removal-crash-expected.txt: Added.
     11        * fast/shadow-dom/shadow-tree-removal-crash.html: Added.
     12
    1132021-08-02  Jean-Yves Avenard  <jya@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r280585 r280586  
     12021-08-03  Rob Buis  <rbuis@igalia.com>
     2
     3        Check that shadow root is connected in invalidateStyleAfterStyleSheetChange
     4        https://bugs.webkit.org/show_bug.cgi?id=227383
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Check that shadow root is connected in invalidateStyleAfterStyleSheetChange.
     9
     10        Test: fast/shadow-dom/shadow-tree-removal-crash.html
     11
     12        * style/StyleScope.cpp:
     13        (WebCore::Style::Scope::updateActiveStyleSheets):
     14
    1152021-08-02  Frédéric Wang  <fwang@igalia.com>
    216
  • trunk/Source/WebCore/style/StyleScope.cpp

    r280112 r280586  
    525525void Scope::invalidateStyleAfterStyleSheetChange(const StyleSheetChange& styleSheetChange)
    526526{
     527    if (m_shadowRoot && !m_shadowRoot->isConnected())
     528        return;
     529
    527530    // If we are already parsing the body and so may have significant amount of elements, put some effort into trying to avoid style recalcs.
    528531    bool invalidateAll = !m_document.bodyOrFrameset() || m_document.hasNodesWithNonFinalStyle() || m_document.hasNodesWithMissingStyle();
Note: See TracChangeset for help on using the changeset viewer.