Changeset 64928 in webkit


Ignore:
Timestamp:
Aug 7, 2010 6:59:00 PM (14 years ago)
Author:
weinig@apple.com
Message:

WebKitTestRunner needs to print onunload handler information
<rdar://problem/8213831>
https://bugs.webkit.org/show_bug.cgi?id=42703

Reviewed by Anders Carlsson.

WebKit2:

Add SPI to get the number of pending unload events.

  • WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:

(WKBundleFrameGetPendingUnloadCount):

  • WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
  • WebProcess/WebPage/WebFrame.cpp:

(WebKit::WebFrame::pendingUnloadCount):

  • WebProcess/WebPage/WebFrame.h:

WebKitTools:

  • WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:

(WTR::operator<<):
(WTR::InjectedBundlePage::didFinishDocumentLoadForFrame):

LayoutTests:

  • platform/mac-wk2/Skipped:
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r64921 r64928  
     12010-08-07  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        WebKitTestRunner needs to print onunload handler information
     6        <rdar://problem/8213831>
     7        https://bugs.webkit.org/show_bug.cgi?id=42703
     8
     9        * platform/mac-wk2/Skipped:
     10
    1112010-08-07  Sam Weinig  <sam@webkit.org>
    212
  • trunk/LayoutTests/platform/mac-wk2/Skipped

    r64921 r64928  
    17941794http/tests/plugins/third-party-cookie-accept-policy.html
    17951795
    1796 # WebKitTestRunner needs to print onunload handler information
    1797 # <https://bugs.webkit.org/show_bug.cgi?id=42703>
    1798 fast/events/onunload-clears-onbeforeunload.html
    1799 fast/events/onunload-not-on-body.html
    1800 fast/events/onunload.html
    1801 fast/events/pageshow-pagehide-on-back-uncached.html
    1802 fast/events/pageshow-pagehide.html
    1803 fast/events/stop-load-in-unload-handler-using-document-write.html
    1804 fast/events/stop-load-in-unload-handler-using-window-stop.html
    1805 fast/forms/button-state-restore.html
    1806 fast/frames/frame-unload-crash.html
    1807 fast/loader/onunload-form-submit-crash-2.html
    1808 fast/loader/onunload-form-submit-crash.html
    1809 fast/loader/start-load-in-unload.html
    1810 fast/loader/stateobjects/pushstate-in-iframe.html
    1811 fast/loader/stateobjects/replacestate-in-iframe.html
    1812 fast/loader/unload-form-about-blank.html
    1813 fast/loader/unload-form-post-about-blank.html
    1814 fast/loader/unload-form-post.html
    1815 fast/loader/unload-form.html
    1816 fast/loader/unload-hyperlink-targeted.html
    1817 fast/loader/unload-hyperlink.html
    1818 fast/loader/unload-javascript-url.html
    1819 fast/loader/unload-reload.html
    1820 fast/loader/unload-window-location.html
    1821 http/tests/navigation/history-back-across-form-submission-to-fragment.html
    1822 http/tests/security/window-events-pass.html
    1823 http/tests/xmlhttprequest/frame-load-cancelled-abort.html
    1824 http/tests/xmlhttprequest/frame-unload-abort-crash.html
    1825 http/tests/xmlhttprequest/send-undefined-and-null.html
    1826 http/tests/xmlhttprequest/xhr-onunload.html
    1827 
    18281796# WebKitTestRunner needs to print history delegate information
    18291797# <https://bugs.webkit.org/show_bug.cgi?id=42704>
     
    19851953# match Firefox or Chrome. We should either fix the test, or get rid of it.
    19861954plugins/get-url-with-blank-target.html
     1955
     1956# Unexplained failures that were formerly in the WebKitTestRunner needs to print onunload handler list.
     1957fast/events/onunload-clears-onbeforeunload.html
    19871958
    19881959# Unexplained failures that were formerly in the dumpChildFramesAsText list.
  • trunk/WebKit2/ChangeLog

    r64927 r64928  
     12010-08-07  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        WebKitTestRunner needs to print onunload handler information
     6        <rdar://problem/8213831>
     7        https://bugs.webkit.org/show_bug.cgi?id=42703
     8
     9        Add SPI to get the number of pending unload events.
     10
     11        * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
     12        (WKBundleFrameGetPendingUnloadCount):
     13        * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
     14        * WebProcess/WebPage/WebFrame.cpp:
     15        (WebKit::WebFrame::pendingUnloadCount):
     16        * WebProcess/WebPage/WebFrame.h:
     17
    1182010-08-07  Sam Weinig  <sam@webkit.org>
    219
  • trunk/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp

    r64803 r64928  
    104104    return toCopiedRef(toWK(frameRef)->innerText());
    105105}
     106
     107unsigned WKBundleFrameGetPendingUnloadCount(WKBundleFrameRef frameRef)
     108{
     109    return toWK(frameRef)->pendingUnloadCount();
     110}
  • trunk/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h

    r64426 r64928  
    4545WK_EXPORT unsigned WKBundleFrameGetNumberOfActiveAnimations(WKBundleFrameRef frame);
    4646WK_EXPORT bool WKBundleFramePauseAnimationOnElementWithId(WKBundleFrameRef frame, WKStringRef name, WKStringRef elementID, double time);
     47WK_EXPORT unsigned WKBundleFrameGetPendingUnloadCount(WKBundleFrameRef frame);
    4748
    4849#ifdef __cplusplus
  • trunk/WebKit2/WebProcess/WebPage/WebFrame.cpp

    r64803 r64928  
    250250}
    251251
     252unsigned WebFrame::pendingUnloadCount()
     253{
     254    if (!m_coreFrame)
     255        return 0;
     256
     257    return m_coreFrame->domWindow()->pendingUnloadEventListeners();
     258}
     259
    252260JSGlobalContextRef WebFrame::jsContext()
    253261{
  • trunk/WebKit2/WebProcess/WebPage/WebFrame.h

    r64861 r64928  
    8787    bool pauseAnimationOnElementWithId(const WebCore::String& animationName, const WebCore::String& elementID, double time);
    8888
     89    unsigned pendingUnloadCount();
     90
    8991    // Simple listener class used by plug-ins to know when frames finish or fail loading.
    9092    class LoadListener {
  • trunk/WebKitTools/ChangeLog

    r64927 r64928  
     12010-08-07  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        WebKitTestRunner needs to print onunload handler information
     6        <rdar://problem/8213831>
     7        https://bugs.webkit.org/show_bug.cgi?id=42703
     8
     9        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
     10        (WTR::operator<<):
     11        (WTR::InjectedBundlePage::didFinishDocumentLoadForFrame):
     12
    1132010-08-07  Sam Weinig  <sam@webkit.org>
    214
  • trunk/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp

    r64927 r64928  
    4141namespace WTR {
    4242
     43static ostream& operator<<(ostream& out, WKBundleFrameRef frame)
     44{
     45    WKRetainPtr<WKStringRef> name(AdoptWK, WKBundleFrameCopyName(frame));
     46    if (WKBundleFrameIsMainFrame(frame)) {
     47        if (!WKStringIsEmpty(name.get()))
     48            out << "main frame \"" << name << "\"";
     49        else
     50            out << "main frame";
     51    } else {
     52        if (!WKStringIsEmpty(name.get()))
     53            out << "frame \"" << name << "\"";
     54        else
     55            out << "frame (anonymous)";
     56    }
     57
     58    return out;
     59}
     60
    4361static string dumpPath(WKBundleNodeRef node)
    4462{
     
    389407void InjectedBundlePage::didFinishDocumentLoadForFrame(WKBundleFrameRef frame)
    390408{
     409   
     410    unsigned pendingFrameUnloadEvents = WKBundleFrameGetPendingUnloadCount(frame);
     411    if (pendingFrameUnloadEvents)
     412        InjectedBundle::shared().os() << frame << " - has " << pendingFrameUnloadEvents << " onunload handler(s)\n";
    391413}
    392414
Note: See TracChangeset for help on using the changeset viewer.