Changeset 228476 in webkit


Ignore:
Timestamp:
Feb 14, 2018 11:34:35 AM (6 years ago)
Author:
dino@apple.com
Message:

CrashTracer: com.apple.WebKit.WebContent at com.apple.WebCore: WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot + 618
https://bugs.webkit.org/show_bug.cgi?id=182798
<rdar://problem/23337253>

Reviewed by Eric Carlson.

Speculative fix for a crash in HTMLPlugInImageElement::didAddUserAgentShadowRoot.
The guess is that the m_swapRendererTimer is set, and the display state changes to
something that does not require a shadow root, but before the timer fires.
Fix this by ensuring that the timer is reset on every display state change.

  • html/HTMLPlugInElement.cpp:

(WebCore::HTMLPlugInElement::setDisplayState): Guard for sets that wouldn't
actually change value, and make sure we always reset the timer.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r228471 r228476  
     12018-02-14  Dean Jackson  <dino@apple.com>
     2
     3        CrashTracer: com.apple.WebKit.WebContent at com.apple.WebCore: WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot + 618
     4        https://bugs.webkit.org/show_bug.cgi?id=182798
     5        <rdar://problem/23337253>
     6
     7        Reviewed by Eric Carlson.
     8
     9        Speculative fix for a crash in HTMLPlugInImageElement::didAddUserAgentShadowRoot.
     10        The guess is that the m_swapRendererTimer is set, and the display state changes to
     11        something that does not require a shadow root, but before the timer fires.
     12        Fix this by ensuring that the timer is reset on every display state change.
     13
     14        * html/HTMLPlugInElement.cpp:
     15        (WebCore::HTMLPlugInElement::setDisplayState): Guard for sets that wouldn't
     16        actually change value, and make sure we always reset the timer.
     17
    1182018-02-14  Antoine Quint  <graouts@apple.com>
    219
  • trunk/Source/WebCore/html/HTMLPlugInElement.cpp

    r228260 r228476  
    287287void HTMLPlugInElement::setDisplayState(DisplayState state)
    288288{
     289    if (state == m_displayState)
     290        return;
     291
    289292    m_displayState = state;
    290293   
    291     if ((state == DisplayingSnapshot || displayState() == PreparingPluginReplacement) && !m_swapRendererTimer.isActive())
     294    m_swapRendererTimer.stop();
     295    if (state == DisplayingSnapshot || displayState() == PreparingPluginReplacement)
    292296        m_swapRendererTimer.startOneShot(0_s);
    293297}
Note: See TracChangeset for help on using the changeset viewer.