Changeset 201393 in webkit


Ignore:
Timestamp:
May 25, 2016 12:04:47 PM (8 years ago)
Author:
Antti Koivisto
Message:

Source/WebCore:
Shadow DOM: RenderTreePosition miscomputed when display:contents value changes
https://bugs.webkit.org/show_bug.cgi?id=158072
rdar://problem/25766333

Reviewed by Darin Adler.

Test: fast/shadow-dom/slot-crash.html

  • style/RenderTreePosition.h:

(WebCore::RenderTreePosition::invalidateNextSibling):

Add unconditional invalidation function.

  • style/RenderTreeUpdater.cpp:

(WebCore::RenderTreeUpdater::updateElementRenderer):

With display:contents rendering siblings may be found from the subtree and the existing cached
position may become invalid.
If the display:contents value changes invalidate the current render tree position.

LayoutTests:
Shadow DOM: RenderTreePosition should determine if element has display:contents from new style
https://bugs.webkit.org/show_bug.cgi?id=158072

Reviewed by Darin Adler.

  • fast/shadow-dom/slot-crash.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r201375 r201393  
     12016-05-25  Antti Koivisto  <antti@apple.com>
     2
     3        Shadow DOM: RenderTreePosition should determine if element has display:contents from new style
     4        https://bugs.webkit.org/show_bug.cgi?id=158072
     5
     6        Reviewed by Darin Adler.
     7
     8        * fast/shadow-dom/slot-crash.html: Added.
     9
    1102016-05-25  Chris Dumez  <cdumez@apple.com>
    211
  • trunk/Source/WebCore/ChangeLog

    r201390 r201393  
     12016-05-25  Antti Koivisto  <antti@apple.com>
     2
     3        Shadow DOM: RenderTreePosition miscomputed when display:contents value changes
     4        https://bugs.webkit.org/show_bug.cgi?id=158072
     5        rdar://problem/25766333
     6
     7        Reviewed by Darin Adler.
     8
     9        Test: fast/shadow-dom/slot-crash.html
     10
     11        * style/RenderTreePosition.h:
     12        (WebCore::RenderTreePosition::invalidateNextSibling):
     13
     14            Add unconditional invalidation function.
     15
     16        * style/RenderTreeUpdater.cpp:
     17        (WebCore::RenderTreeUpdater::updateElementRenderer):
     18
     19            With display:contents rendering siblings may be found from the subtree and the existing cached
     20            position may become invalid.
     21            If the display:contents value changes invalidate the current render tree position.
     22
    1232016-05-25  Brady Eidson  <beidson@apple.com>
    224
  • trunk/Source/WebCore/style/RenderTreePosition.h

    r190983 r201393  
    6060
    6161    void computeNextSibling(const Node&);
     62    void invalidateNextSibling() { m_hasValidNextSibling = false; }
    6263    void invalidateNextSibling(const RenderObject&);
    6364
  • trunk/Source/WebCore/style/RenderTreeUpdater.cpp

    r200381 r201393  
    246246
    247247    bool hasDisplayContest = update.style && update.style->display() == CONTENTS;
    248     element.setHasDisplayContents(hasDisplayContest);
     248    if (hasDisplayContest != element.hasDisplayContents()) {
     249        element.setHasDisplayContents(hasDisplayContest);
     250        // Render tree position needs to be recomputed as rendering siblings may be found from the display:contents subtree.
     251        renderTreePosition().invalidateNextSibling();
     252    }
    249253
    250254    bool shouldCreateNewRenderer = !element.renderer() && update.style && !hasDisplayContest;
Note: See TracChangeset for help on using the changeset viewer.