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

Changeset 272900 in webkit


Ignore:
Timestamp:
Feb 16, 2021, 3:57:17 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

Teardown shadow root renderers on hostChildElementDidChange
https://bugs.webkit.org/show_bug.cgi?id=221386

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2021-02-16
Reviewed by Antti Koivisto.

Source/WebCore:

When details element has a display contents style, the default summary renderer is not cleared when a new
summary element is added. This causes that both summary elements are rendered at the same time, instead of the
active one. The crash happens when the details element is removed from the document, because the default summary
element still has a valid renderer on destroy.

  • dom/SlotAssignment.h:

(WebCore::ShadowRoot::hostChildElementDidChange):

LayoutTests:

  • tables/table-col-indent-crash-expected.txt:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r272899 r272900  
     12021-02-16  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        Teardown shadow root renderers on hostChildElementDidChange
     4        https://bugs.webkit.org/show_bug.cgi?id=221386
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * tables/table-col-indent-crash-expected.txt:
     9
    1102021-02-16  Chris Lord  <clord@igalia.com>
    211
  • trunk/LayoutTests/tables/table-col-indent-crash-expected.txt

    r267644 r272900  
    11
    22This test passes if it doesn't crash.
    3 
  • trunk/Source/WebCore/ChangeLog

    r272898 r272900  
     12021-02-16  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        Teardown shadow root renderers on hostChildElementDidChange
     4        https://bugs.webkit.org/show_bug.cgi?id=221386
     5
     6        Reviewed by Antti Koivisto.
     7
     8        When details element has a display contents style, the default summary renderer is not cleared when a new
     9        summary element is added. This causes that both summary elements are rendered at the same time, instead of the
     10        active one. The crash happens when the details element is removed from the document, because the default summary
     11        element still has a valid renderer on destroy.
     12
     13        * dom/SlotAssignment.h:
     14        (WebCore::ShadowRoot::hostChildElementDidChange):
     15
    1162021-02-16  Antoine Quint  <graouts@webkit.org>
    217
  • trunk/Source/WebCore/dom/SlotAssignment.h

    r272130 r272900  
    132132inline void ShadowRoot::hostChildElementDidChange(const Element& childElement)
    133133{
    134     if (m_slotAssignment)
    135         m_slotAssignment->hostChildElementDidChange(childElement, *this);
     134    if (!m_slotAssignment)
     135        return;
     136    if (m_host)
     137        RenderTreeUpdater::tearDownRenderers(*m_host);
     138    m_slotAssignment->hostChildElementDidChange(childElement, *this);
    136139}
    137140
Note: See TracChangeset for help on using the changeset viewer.