Changeset 208370 in webkit


Ignore:
Timestamp:
Nov 3, 2016, 10:08:29 PM (8 years ago)
Author:
Antti Koivisto
Message:

Source/WebCore:
REGRESSION (r207669): Crash under media controls shadow root construction
https://bugs.webkit.org/show_bug.cgi?id=164381
<rdar://problem/28935401>

Reviewed by Simon Fraser.

The problem is that we are running a script for media control UA shadow tree in HTMLMediaElement::insertedInto.
It is not safe to run scripts in insertedInto as the tree is in inconsistent state. Instead finishedInsertingSubtree
callback should be used.

Test: media/media-controls-shadow-construction-crash.html

Seen on https://www.theguardian.com/artanddesign/video/2013/oct/14/banksy-central-park-new-york-video

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::insertedInto):
(WebCore::HTMLMediaElement::finishedInsertingSubtree):

Move configureMediaControls() to finishedInsertingSubtree().

  • html/HTMLMediaElement.h:
  • style/StyleTreeResolver.cpp:

(WebCore::Style::TreeResolver::resolveComposedTree):

Add an assert to make the bad state easier to hit in tests.

LayoutTests:
REGRESSION (r207669): Crash under SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending
https://bugs.webkit.org/show_bug.cgi?id=164381
<rdar://problem/28935401>

Reviewed by Simon Fraser.

  • media/media-controls-shadow-construction-crash-expected.txt: Added.
  • media/media-controls-shadow-construction-crash.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r208363 r208370  
     12016-11-03  Antti Koivisto  <antti@apple.com>
     2
     3        REGRESSION (r207669): Crash under SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending
     4        https://bugs.webkit.org/show_bug.cgi?id=164381
     5        <rdar://problem/28935401>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * media/media-controls-shadow-construction-crash-expected.txt: Added.
     10        * media/media-controls-shadow-construction-crash.html: Added.
     11
    1122016-11-03  Myles C. Maxfield  <mmaxfield@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r208366 r208370  
     12016-11-03  Antti Koivisto  <antti@apple.com>
     2
     3        REGRESSION (r207669): Crash under media controls shadow root construction
     4        https://bugs.webkit.org/show_bug.cgi?id=164381
     5        <rdar://problem/28935401>
     6
     7        Reviewed by Simon Fraser.
     8
     9        The problem is that we are running a script for media control UA shadow tree in HTMLMediaElement::insertedInto.
     10        It is not safe to run scripts in insertedInto as the tree is in inconsistent state. Instead finishedInsertingSubtree
     11        callback should be used.
     12
     13        Test: media/media-controls-shadow-construction-crash.html
     14
     15        Seen on https://www.theguardian.com/artanddesign/video/2013/oct/14/banksy-central-park-new-york-video
     16
     17        * html/HTMLMediaElement.cpp:
     18        (WebCore::HTMLMediaElement::insertedInto):
     19        (WebCore::HTMLMediaElement::finishedInsertingSubtree):
     20
     21            Move configureMediaControls() to finishedInsertingSubtree().
     22
     23        * html/HTMLMediaElement.h:
     24        * style/StyleTreeResolver.cpp:
     25        (WebCore::Style::TreeResolver::resolveComposedTree):
     26
     27            Add an assert to make the bad state easier to hit in tests.
     28
    1292016-11-03  Ryosuke Niwa  <rniwa@webkit.org>
    230
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r208329 r208370  
    808808    }
    809809
     810    return InsertionShouldCallFinishedInsertingSubtree;
     811}
     812
     813void HTMLMediaElement::finishedInsertingSubtree()
     814{
    810815    configureMediaControls();
    811     return InsertionDone;
    812816}
    813817
  • trunk/Source/WebCore/html/HTMLMediaElement.h

    r208329 r208370  
    522522    bool childShouldCreateRenderer(const Node&) const override;
    523523    InsertionNotificationRequest insertedInto(ContainerNode&) override;
     524    void finishedInsertingSubtree() override;
    524525    void removedFrom(ContainerNode&) override;
    525526    void didRecalcStyle(Style::Change) override;
  • trunk/Source/WebCore/style/StyleTreeResolver.cpp

    r207458 r208370  
    358358        auto& parent = this->parent();
    359359
     360        ASSERT(node.inDocument());
    360361        ASSERT(node.containingShadowRoot() == scope().shadowRoot);
    361362        ASSERT(node.parentElement() == parent.element || is<ShadowRoot>(node.parentNode()) || node.parentElement()->shadowRoot());
Note: See TracChangeset for help on using the changeset viewer.