Changeset 66311 in webkit


Ignore:
Timestamp:
Aug 28, 2010 11:48:49 AM (14 years ago)
Author:
eric.carlson@apple.com
Message:

2010-08-28 Eric Carlson <eric.carlson@apple.com>

Reviewed by Simon Fraser.

Crash reloading fast/events/tabindex-focus-blur-all.html test
https://bugs.webkit.org/show_bug.cgi?id=44743

  • html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::asyncEventTimerFired): If m_isWaitingToDecrementLoadEventDelayCount is true, call setShouldDelayLoadEvent(false) and set the timer to fire the pending events on the next idle. (WebCore::HTMLMediaElement::setShouldDelayLoadEvent): Don't clear the delay from within a media engine callback because document 'load' event handlers that cause the page to become inactive will delete the media engine.
  • html/HTMLMediaElement.h: Add m_isWaitingToDecrementLoadEventDelayCount.

2010-08-28 Eric Carlson <eric.carlson@apple.com>

Reviewed by Simon Fraser.

Crash reloading fast/events/tabindex-focus-blur-all.html test
https://bugs.webkit.org/show_bug.cgi?id=44743

  • platform/mac/Skipped: Remove tabindex-focus-blur-all.html from the skip list.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r66306 r66311  
     12010-08-28  Eric Carlson  <eric.carlson@apple.com>
     2
     3        Reviewed by Simon Fraser.
     4
     5        Crash reloading fast/events/tabindex-focus-blur-all.html test
     6        https://bugs.webkit.org/show_bug.cgi?id=44743
     7
     8        * platform/mac/Skipped: Remove tabindex-focus-blur-all.html from the skip list.
     9
    1102010-08-28  Adam Barth  <abarth@webkit.org>
    211
  • trunk/LayoutTests/platform/mac/Skipped

    r66294 r66311  
    299299# https://bugs.webkit.org/show_bug.cgi?id=44566
    300300fast/canvas/webgl/gl-teximage.html
    301 
    302 # https://bugs.webkit.org/show_bug.cgi?id=44743
    303 # Test always crashes on snowleopard, crashes on reload on leopard
    304 fast/events/tabindex-focus-blur-all.html
    305 
  • trunk/WebCore/ChangeLog

    r66310 r66311  
     12010-08-28  Eric Carlson  <eric.carlson@apple.com>
     2
     3        Reviewed by Simon Fraser.
     4
     5        Crash reloading fast/events/tabindex-focus-blur-all.html test
     6        https://bugs.webkit.org/show_bug.cgi?id=44743
     7
     8        * html/HTMLMediaElement.cpp:
     9        (WebCore::HTMLMediaElement::asyncEventTimerFired): If m_isWaitingToDecrementLoadEventDelayCount
     10        is true, call setShouldDelayLoadEvent(false) and set the timer to fire the pending events
     11        on the next idle.
     12        (WebCore::HTMLMediaElement::setShouldDelayLoadEvent): Don't clear the delay from within a
     13        media engine callback because document 'load' event handlers that cause the page to become
     14        inactive will delete the media engine.
     15        * html/HTMLMediaElement.h: Add m_isWaitingToDecrementLoadEventDelayCount.
     16
    1172010-08-28  Simon Fraser  <simon.fraser@apple.com>
    218
  • trunk/WebCore/html/HTMLMediaElement.cpp

    r66110 r66311  
    113113    , m_isWaitingUntilMediaCanStart(false)
    114114    , m_shouldDelayLoadEvent(false)
     115    , m_isWaitingToDecrementLoadEventDelayCount(false)
    115116    , m_haveFiredLoadedData(false)
    116117    , m_inActiveDocument(true)
     
    372373void HTMLMediaElement::asyncEventTimerFired(Timer<HTMLMediaElement>*)
    373374{
     375    // If we are waiting to release our delay on the load event, do that first and post
     376    // the pending events on the next go around.
     377    if (m_isWaitingToDecrementLoadEventDelayCount) {
     378        setShouldDelayLoadEvent(false);
     379        if (!m_asyncEventTimer.isActive())
     380            m_asyncEventTimer.startOneShot(0);
     381        return;
     382    }
     383
    374384    Vector<RefPtr<Event> > pendingEvents;
    375385    ExceptionCode ec = 0;
     
    20842094}
    20852095
    2086 void HTMLMediaElement::setShouldDelayLoadEvent(bool delay)
    2087 {
    2088     if (m_shouldDelayLoadEvent == delay)
    2089         return;
    2090 
    2091     m_shouldDelayLoadEvent = delay;
    2092     if (delay)
     2096void HTMLMediaElement::setShouldDelayLoadEvent(bool shouldDelay)
     2097{
     2098    if (m_shouldDelayLoadEvent == shouldDelay)
     2099        return;
     2100
     2101    // Don't decrement the load event delay if we are in the middle of a callback from
     2102    // the media engine. The load event is sent synchronously and may trigger a script that
     2103    // causes the document to be come inactive and that will clear the media engine, causing
     2104    // the return to be a rough one.
     2105    if (!shouldDelay && processingMediaPlayerCallback()) {
     2106        m_isWaitingToDecrementLoadEventDelayCount = true;
     2107
     2108        // Instead of creating yet-another-timer, reuse the async event timer which is always
     2109        // used as a one-shot.
     2110        if (!m_asyncEventTimer.isActive())
     2111            m_asyncEventTimer.startOneShot(0);
     2112        return;
     2113    }
     2114
     2115    m_shouldDelayLoadEvent = shouldDelay;
     2116    m_isWaitingToDecrementLoadEventDelayCount = false;
     2117    if (shouldDelay)
    20932118        document()->incrementLoadEventDelayCount();
    20942119    else
  • trunk/WebCore/html/HTMLMediaElement.h

    r66110 r66311  
    343343    bool m_isWaitingUntilMediaCanStart : 1;
    344344    bool m_shouldDelayLoadEvent : 1;
     345    bool m_isWaitingToDecrementLoadEventDelayCount : 1;
    345346    bool m_haveFiredLoadedData : 1;
    346347    bool m_inActiveDocument : 1;
Note: See TracChangeset for help on using the changeset viewer.