LayoutTests:
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 May 2007 12:31:42 +0000 (12:31 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 May 2007 12:31:42 +0000 (12:31 +0000)
commitb561a8e379c51921d6a1e9f78c2ecdcafcb8d31e
tree09e08db1ff379c402fd0b203f2f002859c135a25
parente0462969314256f2d15fd574d3fa568b7025dae4
LayoutTests:

        Reviewed by Oliver.

        - new test case for:
        <rdar://problem/5063277> blank screen after login to Citibank Online (accessing document before frame starts loading cancels load)
        <rdar://problem/5159541> REGRESSION (r20972): Wall Street Journal pages replaced by advertisements (13465)

        (The test case covers both scenarios.)

        * http/tests/misc/frame-access-during-load-expected.checksum: Added.
        * http/tests/misc/frame-access-during-load-expected.png: Added.
        * http/tests/misc/frame-access-during-load-expected.txt: Added.
        * http/tests/misc/frame-access-during-load.html: Added.

        - test results beneficially or harmlessly changed as a result of the above fixes

        * css2.1/t0801-c412-hz-box-00-b-a-expected.checksum:
        * css2.1/t0801-c412-hz-box-00-b-a-expected.png:
        * css2.1/t0801-c412-hz-box-00-b-a-expected.txt: This reflects an <object> containing
        an image now creating an image renderer.

        * dom/xhtml/level2/html/HTMLIFrameElement11-expected.txt: This is updated to a slightly
        less bad failure for access to a frame that's not loaded yet.

        The following test results now reflect the frame removal that the test was testing:

        * fast/dom/clientWidthAfterDocumentIsRemoved-expected.checksum:
        * fast/dom/clientWidthAfterDocumentIsRemoved-expected.png:
        * fast/dom/clientWidthAfterDocumentIsRemoved-expected.txt:
        * fast/dom/replaceChild-expected.checksum:
        * fast/dom/replaceChild-expected.png:
        * fast/dom/replaceChild-expected.txt:

        The following tests results now reflect empty document content for iframes that never load anything:

        * fast/events/focusingUnloadedFrame-expected.txt:
        * tables/mozilla_expected_failures/bugs/bug137388-1-expected.txt:
        * tables/mozilla_expected_failures/bugs/bug137388-2-expected.txt:

WebCore:

        Reviewed by Oliver.

        - WebCore part of fix for:
        <rdar://problem/5063277> blank screen after login to Citibank Online (accessing document before frame starts loading cancels load)
        <rdar://problem/5159541> REGRESSION (r20972): Wall Street Journal pages replaced by advertisements (13465)

        The basic approach is to have Frames start out containing an empty document instead of absolutely nothing,
        so there is no need to initialize them on demand. Various side effects of that cause both of these bugs.

        However, this caused many regressions so I had to fix the fallout.

        * WebCore.exp: fix symbol exports
        * bindings/js/kjs_window.cpp:
        (KJS::createNewWindow): useless "created" bool (we don't need it here)
        (KJS::WindowFunc::callAsFunction): detect if we created a new frame, because if so,
        we need to initialize the domain (can't count on it not having a document), also
        don't try to make a new document for it.
        Also, stop properly.
        * css/cssstyleselector.cpp:
        (WebCore::CSSStyleSelector::CSSStyleSelector): don't count on document having a view here
        * html/HTMLObjectElement.cpp:
        (WebCore::HTMLObjectElement::isImageType): Ask client, to match how other <object> renderer
        decisions are made.
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::FrameLoader): Initialize new data members
        (WebCore::FrameLoader::init): Do the slightly tricky sequence of steps to properly make
        an empty document with everything hooked up.
        (WebCore::FrameLoader::createWindow): Added "created" bool.
        (WebCore::FrameLoader::stopLoading): (whitespace change)
        (WebCore::FrameLoader::begin): Don't try to create an empty document.
        (WebCore::FrameLoader::finishedParsing): If creating an initial empty document, don't
        do any of this work.
        (WebCore::FrameLoader::checkCompleted): Do checkLoadComplete() as well.
        (WebCore::FrameLoader::baseURL): don't check for null document
        (WebCore::FrameLoader::baseTarget): ditto
        (WebCore::FrameLoader::completeURL): ditto
        (WebCore::FrameLoader::didTellBridgeAboutLoad): ditto
        (WebCore::FrameLoader::scheduleLocationChange): determine duringLoad differently; doc won't
        be null.
        (WebCore::FrameLoader::gotoAnchor): don't check for null document
        (WebCore::FrameLoader::canTarget): don't check for null document
        (WebCore::FrameLoader::stopForUserCancel): new method for explicit stops like window.stop().
        (WebCore::FrameLoader::transitionToCommitted): check for pre-loaded state properly
        (WebCore::FrameLoader::createEmptyDocument): removed
        (WebCore::FrameLoader::checkLoadCompleteForThisFrame): don't send delegate callbacks when making initial
        doc.
        (WebCore::FrameLoader::tokenizerProcessedData): Assume document; just checkCompleted now that it
        does checkLoadComplete.
        (WebCore::FrameLoader::receivedMainResourceError): assume document
        (WebCore::FrameLoader::saveDocumentState): Assume there's a document except during initial load
        (WebCore::FrameLoader::mainReceivedCompleteError): do checkCompleted, not checkLoadComplete
        (WebCore::FrameLoader::continueLoadWithData): assume document
        * loader/FrameLoader.h:
        * loader/MainResourceLoader.cpp:
        (WebCore::MainResourceLoader::receivedError): Add more ref protection and do things in a slightly
        different order.
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::document): don't force document creation, just assert there is one.
        * page/Frame.cpp:
        (WebCore::Frame::init): Added init method.
        (WebCore::Frame::pageDestroyed): when a frame is removed, make sure to check if the parent is
        done loading.
        * page/Frame.h:
        * page/mac/WebCoreFrameBridge.mm:
        (-[WebCoreFrameBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]): No need to force
        document.
        (-[WebCoreFrameBridge aeDescByEvaluatingJavaScriptFromString:]): ditto
        * platform/graphics/svg/SVGImage.cpp:
        (WebCore::SVGImage::dataChanged): init the frame
        * rendering/RenderPart.cpp:
        (WebCore::RenderPart::updateWidgetPosition): If a subframe needs layout, then lay it out even
        if the bounds did not change; the content size might be wrong.
        * rendering/RenderTreeAsText.cpp:
        (WebCore::externalRepresentation): Don't crash if the frame lacks a view.

WebKit:

        Reviewed by Oliver.

        - WebKit part of fix for:
        <rdar://problem/5063277> blank screen after login to Citibank Online (accessing document before frame starts loading cancels load)
        <rdar://problem/5159541> REGRESSION (r20972): Wall Street Journal pages replaced by advertisements (13465)

        The basic approach is to have Frames start out containing an empty document instead of absolutely nothing,
        so there is no need to initialize them on demand. Various side effects of that cause both of these bugs.

        However, this caused many regressions so I had to fix the fallout.

        * WebCoreSupport/WebChromeClient.mm:
        (WebChromeClient::takeFocus): Avoid focus cycle problems (can happen in DumpRenderTree
        with initial empty document now).
        * WebCoreSupport/WebFrameBridge.mm:
        (-[WebFrameBridge finishInitializingWithPage:frameName:frameView:ownerElement:]): init the frame.
        (-[WebFrameBridge determineObjectFromMIMEType:URL:]): return image type when appropriate
        * WebView/WebFrame.mm:
        (-[WebFrame stopLoading]): use stopForUserCancel().
        * WebView/WebFrameView.mm:
        (-[WebFrameView _makeDocumentViewForDataSource:]): assume html when no mime type available.
        * WebView/WebView.mm:
        (-[WebView becomeFirstResponder]): Track whether we are becoming first responder from
        outside the view.
        (-[WebView _becomingFirstResponderFromOutside]): Return this value.
        * WebView/WebViewInternal.h:

WebKitTools:

        Reviewed by Oliver.

        - don't clear events whenever an EventSendingController goes away, only do it at predictable times,
        since destroying a subframe can make one go away

        (Discovered while fixing:

        <rdar://problem/5063277> blank screen after login to Citibank Online (accessing document before frame starts loading cancels load)
        <rdar://problem/5159541> REGRESSION (r20972): Wall Street Journal pages replaced by advertisements (13465)

        * DumpRenderTree/DumpRenderTree.m:
        (runTest): explicitly clear saved events after every page load
        * DumpRenderTree/EventSendingController.h:
        * DumpRenderTree/EventSendingController.m:
        (-[EventSendingController dealloc]): don't clear saved events here...
        (+[EventSendingController clearSavedEvents]): do it here
        * Scripts/check-for-global-initializers:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@21367 268f45cc-cd09-0410-ab3c-d52691b4dbfc
45 files changed:
LayoutTests/ChangeLog
LayoutTests/css2.1/t0801-c412-hz-box-00-b-a-expected.checksum
LayoutTests/css2.1/t0801-c412-hz-box-00-b-a-expected.png
LayoutTests/css2.1/t0801-c412-hz-box-00-b-a-expected.txt
LayoutTests/dom/xhtml/level2/html/HTMLIFrameElement11-expected.txt
LayoutTests/fast/dom/clientWidthAfterDocumentIsRemoved-expected.checksum
LayoutTests/fast/dom/clientWidthAfterDocumentIsRemoved-expected.png
LayoutTests/fast/dom/clientWidthAfterDocumentIsRemoved-expected.txt
LayoutTests/fast/dom/replaceChild-expected.checksum
LayoutTests/fast/dom/replaceChild-expected.png
LayoutTests/fast/dom/replaceChild-expected.txt
LayoutTests/fast/events/focusingUnloadedFrame-expected.txt
LayoutTests/http/tests/misc/frame-access-during-load-expected.checksum [new file with mode: 0644]
LayoutTests/http/tests/misc/frame-access-during-load-expected.png [new file with mode: 0644]
LayoutTests/http/tests/misc/frame-access-during-load-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/misc/frame-access-during-load.html [new file with mode: 0644]
LayoutTests/tables/mozilla_expected_failures/bugs/bug137388-1-expected.txt
LayoutTests/tables/mozilla_expected_failures/bugs/bug137388-2-expected.txt
WebCore/ChangeLog
WebCore/WebCore.exp
WebCore/bindings/js/kjs_window.cpp
WebCore/css/cssstyleselector.cpp
WebCore/html/HTMLObjectElement.cpp
WebCore/loader/FrameLoader.cpp
WebCore/loader/FrameLoader.h
WebCore/loader/MainResourceLoader.cpp
WebCore/page/DOMWindow.cpp
WebCore/page/Frame.cpp
WebCore/page/Frame.h
WebCore/page/mac/WebCoreFrameBridge.mm
WebCore/platform/graphics/svg/SVGImage.cpp
WebCore/rendering/RenderPart.cpp
WebCore/rendering/RenderTreeAsText.cpp
WebKit/ChangeLog
WebKit/WebCoreSupport/WebChromeClient.mm
WebKit/WebCoreSupport/WebFrameBridge.mm
WebKit/WebView/WebFrame.mm
WebKit/WebView/WebFrameView.mm
WebKit/WebView/WebView.mm
WebKit/WebView/WebViewInternal.h
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/DumpRenderTree.m
WebKitTools/DumpRenderTree/EventSendingController.h
WebKitTools/DumpRenderTree/EventSendingController.m
WebKitTools/Scripts/check-for-global-initializers