Changeset 21367 in webkit


Ignore:
Timestamp:
May 10, 2007 5:31:42 AM (17 years ago)
Author:
mjs
Message:

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:
Location:
trunk
Files:
4 added
41 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r21359 r21367  
     12007-05-08  Maciej Stachowiak  <mjs@apple.com>
     2
     3        Reviewed by Oliver.
     4       
     5        - new test case for:
     6        <rdar://problem/5063277> blank screen after login to Citibank Online (accessing document before frame starts loading cancels load)
     7        <rdar://problem/5159541> REGRESSION (r20972): Wall Street Journal pages replaced by advertisements (13465)
     8
     9        (The test case covers both scenarios.)
     10
     11        * http/tests/misc/frame-access-during-load-expected.checksum: Added.
     12        * http/tests/misc/frame-access-during-load-expected.png: Added.
     13        * http/tests/misc/frame-access-during-load-expected.txt: Added.
     14        * http/tests/misc/frame-access-during-load.html: Added.
     15
     16        - test results beneficially or harmlessly changed as a result of the above fixes
     17
     18        * css2.1/t0801-c412-hz-box-00-b-a-expected.checksum:
     19        * css2.1/t0801-c412-hz-box-00-b-a-expected.png:
     20        * css2.1/t0801-c412-hz-box-00-b-a-expected.txt: This reflects an <object> containing
     21        an image now creating an image renderer.
     22
     23        * dom/xhtml/level2/html/HTMLIFrameElement11-expected.txt: This is updated to a slightly
     24        less bad failure for access to a frame that's not loaded yet.
     25
     26        The following test results now reflect the frame removal that the test was testing:
     27       
     28        * fast/dom/clientWidthAfterDocumentIsRemoved-expected.checksum:
     29        * fast/dom/clientWidthAfterDocumentIsRemoved-expected.png:
     30        * fast/dom/clientWidthAfterDocumentIsRemoved-expected.txt:
     31        * fast/dom/replaceChild-expected.checksum:
     32        * fast/dom/replaceChild-expected.png:
     33        * fast/dom/replaceChild-expected.txt:
     34
     35        The following tests results now reflect empty document content for iframes that never load anything:
     36       
     37        * fast/events/focusingUnloadedFrame-expected.txt:
     38        * tables/mozilla_expected_failures/bugs/bug137388-1-expected.txt:
     39        * tables/mozilla_expected_failures/bugs/bug137388-2-expected.txt:
     40
    1412007-05-10  Brady Eidson <beidson@apple.com>
    242
  • trunk/LayoutTests/css2.1/t0801-c412-hz-box-00-b-a-expected.checksum

    r14231 r21367  
    1 428a9c3ebe2494341b8a6722291ee4a8
     19c92c10fcd15faf0f6d97fa8263b336b
  • trunk/LayoutTests/css2.1/t0801-c412-hz-box-00-b-a-expected.txt

    r14684 r21367  
    11layer at (0,0) size 800x600
    22  RenderView at (0,0) size 800x600
    3 layer at (0,0) size 800x276
    4   RenderBlock {HTML} at (0,0) size 800x276
    5     RenderBody {BODY} at (8,16) size 784x244
     3layer at (0,0) size 800x166
     4  RenderBlock {HTML} at (0,0) size 800x166
     5    RenderBody {BODY} at (8,16) size 784x134
    66      RenderBlock {P} at (0,0) size 784x18
    77        RenderText {#text} at (0,0) size 283x18
    88          text run at (0,0) width 283: "The two diagrams below should be identical."
    9       RenderBlock {DIV} at (0,34) size 784x210
     9      RenderBlock {DIV} at (0,34) size 784x100
    1010        RenderBlock {P} at (40,0) size 520x40 [color=#0000FF] [bgcolor=#00FFFF] [border: none (40px solid #FF00FF) none (40px solid #FF00FF)]
    1111          RenderText {#text} at (80,0) size 360x40
    1212            text run at (80,0) width 360: "X X X X X"
    13         RenderBlock {P} at (0,56) size 784x154
    14           RenderPartObject {OBJECT} at (0,0) size 300x150
    15             layer at (0,0) size 600x135
    16               RenderView at (0,0) size 300x135
    17             layer at (0,0) size 600x44
    18               RenderBlock {HTML} at (0,0) size 300x44
    19                 RenderBody {BODY} at (0,0) size 300x44
    20                   RenderImage {IMG} at (0,0) size 600x40
     13        RenderBlock {P} at (0,56) size 784x44
     14          RenderImage {OBJECT} at (0,0) size 600x40
    2115          RenderText {#text} at (0,0) size 0x0
  • trunk/LayoutTests/dom/xhtml/level2/html/HTMLIFrameElement11-expected.txt

    r13408 r21367  
    11Test    http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLIFrameElement11
    2 Status  error
    3 Message TypeError: Undefined value
     2Status  failure
     3Message titleLink: assertEquals failed, actual , expected NIST DOM HTML Test - FRAME.
    44
  • trunk/LayoutTests/fast/dom/clientWidthAfterDocumentIsRemoved-expected.checksum

    r20277 r21367  
    1 b0d65e6d722ae42afd88e73711847b6e
     18209202c03a1a3c14187d06b28d16299
  • trunk/LayoutTests/fast/dom/clientWidthAfterDocumentIsRemoved-expected.txt

    r20277 r21367  
    33layer at (0,0) size 800x600
    44  RenderBlock {HTML} at (0,0) size 800x600
    5     RenderBody {BODY} at (8,8) size 784x584
     5    RenderBody {BODY} at (8,8) size 784x576
    66      RenderBlock {P} at (0,0) size 784x18
    77        RenderText {#text} at (0,0) size 212x18
    88          text run at (0,0) width 212: "This test passes if it doesn't crash!"
    9       RenderBlock (anonymous) at (0,34) size 784x154
    10         RenderPartObject {IFRAME} at (0,0) size 304x154 [border: (2px inset #000000)]
    11           layer at (0,0) size 300x150
    12             RenderView at (0,0) size 300x150
    13           layer at (0,0) size 300x8
    14             RenderBlock {HTML} at (0,0) size 300x8
    15               RenderBody {BODY} at (8,8) size 284x0
     9      RenderBlock (anonymous) at (0,34) size 784x0
    1610        RenderText {#text} at (0,0) size 0x0
    1711        RenderText {#text} at (0,0) size 0x0
  • trunk/LayoutTests/fast/dom/replaceChild-expected.checksum

    r20277 r21367  
    1 ad439a096df9257efc427a8cfa84277e
     11abdc7e7be0e3914553cf6443452cd2a
  • trunk/LayoutTests/fast/dom/replaceChild-expected.txt

    r14684 r21367  
    11layer at (0,0) size 800x600
    22  RenderView at (0,0) size 800x600
    3 layer at (0,0) size 800x152
    4   RenderBlock {HTML} at (0,0) size 800x152
    5     RenderBody {BODY} at (0,0) size 800x152 [bgcolor=#CCFFCC]
    6       RenderBlock {DIV} at (0,0) size 800x152
    7         RenderPartObject {IFRAME} at (0,0) size 152x152 [border: (1px solid #000000)]
    8           layer at (0,0) size 150x150
    9             RenderView at (0,0) size 150x150
    10           layer at (0,0) size 150x52
    11             RenderBlock {HTML} at (0,0) size 150x52
    12               RenderBody {BODY} at (8,8) size 134x36
    13                 RenderBlock {DIV} at (0,0) size 134x36
    14                   RenderBlock {DIV} at (0,0) size 134x18
    15                     RenderText {#text} at (0,0) size 33x18
    16                       text run at (0,0) width 33: "test 1"
    17                   RenderBlock {DIV} at (0,18) size 134x18
    18                     RenderText {#text} at (0,0) size 33x18
    19                       text run at (0,0) width 33: "test 2"
     3layer at (0,0) size 800x36
     4  RenderBlock {HTML} at (0,0) size 800x36
     5    RenderBody {BODY} at (0,0) size 800x36 [bgcolor=#CCFFCC]
     6      RenderBlock {DIV} at (0,0) size 800x36
     7        RenderBlock {DIV} at (0,0) size 800x36
     8          RenderBlock {DIV} at (0,0) size 800x18
     9            RenderText {#text} at (0,0) size 33x18
     10              text run at (0,0) width 33: "test 1"
     11          RenderBlock {DIV} at (0,18) size 800x18
     12            RenderText {#text} at (0,0) size 33x18
     13              text run at (0,0) width 33: "test 2"
  • trunk/LayoutTests/fast/events/focusingUnloadedFrame-expected.txt

    r20279 r21367  
    2222              RenderText {#text} at (0,0) size 0x0
    2323      RenderFrame {FRAME} at (0,0) size 0x0
     24        layer at (0,0) size 8x8
     25          RenderView at (0,0) size 0x0
     26        layer at (0,0) size 8x8
     27          RenderBlock {HTML} at (0,0) size 0x8
     28            RenderBody {BODY} at (8,8) size 0x0
  • trunk/LayoutTests/tables/mozilla_expected_failures/bugs/bug137388-1-expected.txt

    r20957 r21367  
    99            RenderTableCell {TD} at (2,2) size 306x6 [r=0 c=0 rs=1 cs=1]
    1010              RenderPartObject {IFRAME} at (1,1) size 308x4 [border: (2px inset #000000)]
     11                layer at (0,0) size 289x8
     12                  RenderView at (0,0) size 289x0
     13                layer at (0,0) size 289x8
     14                  RenderBlock {HTML} at (0,0) size 289x8
     15                    RenderBody {BODY} at (8,8) size 273x0
    1116              RenderText {#text} at (0,0) size 0x0
  • trunk/LayoutTests/tables/mozilla_expected_failures/bugs/bug137388-2-expected.txt

    r20957 r21367  
    99            RenderTableCell {TD} at (2,2) size 306x306 [r=0 c=0 rs=1 cs=1]
    1010              RenderPartObject {IFRAME} at (1,1) size 308x304 [border: (2px inset #000000)]
     11                layer at (0,0) size 304x300
     12                  RenderView at (0,0) size 304x300
     13                layer at (0,0) size 304x300
     14                  RenderBlock {HTML} at (0,0) size 304x300
     15                    RenderBody {BODY} at (8,8) size 288x284
    1116              RenderText {#text} at (0,0) size 0x0
    1217      RenderTable {TABLE} at (0,310) size 606x306
     
    2126            RenderTableCell {TD} at (2,2) size 306x6 [r=0 c=0 rs=1 cs=1]
    2227              RenderPartObject {IFRAME} at (1,1) size 308x4 [border: (2px inset #000000)]
     28                layer at (0,0) size 289x8
     29                  RenderView at (0,0) size 289x0
     30                layer at (0,0) size 289x8
     31                  RenderBlock {HTML} at (0,0) size 289x8
     32                    RenderBody {BODY} at (8,8) size 273x0
    2333              RenderText {#text} at (0,0) size 0x0
    2434      RenderTable {TABLE} at (0,626) size 606x6
  • trunk/WebCore/ChangeLog

    r21365 r21367  
     12007-05-10  Maciej Stachowiak  <mjs@apple.com>
     2
     3        Reviewed by Oliver.
     4
     5        - WebCore part of fix for:
     6        <rdar://problem/5063277> blank screen after login to Citibank Online (accessing document before frame starts loading cancels load)
     7        <rdar://problem/5159541> REGRESSION (r20972): Wall Street Journal pages replaced by advertisements (13465)
     8
     9        The basic approach is to have Frames start out containing an empty document instead of absolutely nothing,
     10        so there is no need to initialize them on demand. Various side effects of that cause both of these bugs.
     11       
     12        However, this caused many regressions so I had to fix the fallout.
     13       
     14        * WebCore.exp: fix symbol exports
     15        * bindings/js/kjs_window.cpp:
     16        (KJS::createNewWindow): useless "created" bool (we don't need it here)
     17        (KJS::WindowFunc::callAsFunction): detect if we created a new frame, because if so,
     18        we need to initialize the domain (can't count on it not having a document), also
     19        don't try to make a new document for it.
     20        Also, stop properly.
     21        * css/cssstyleselector.cpp:
     22        (WebCore::CSSStyleSelector::CSSStyleSelector): don't count on document having a view here
     23        * html/HTMLObjectElement.cpp:
     24        (WebCore::HTMLObjectElement::isImageType): Ask client, to match how other <object> renderer
     25        decisions are made.
     26        * loader/FrameLoader.cpp:
     27        (WebCore::FrameLoader::FrameLoader): Initialize new data members
     28        (WebCore::FrameLoader::init): Do the slightly tricky sequence of steps to properly make
     29        an empty document with everything hooked up.
     30        (WebCore::FrameLoader::createWindow): Added "created" bool.
     31        (WebCore::FrameLoader::stopLoading): (whitespace change)
     32        (WebCore::FrameLoader::begin): Don't try to create an empty document.
     33        (WebCore::FrameLoader::finishedParsing): If creating an initial empty document, don't
     34        do any of this work.
     35        (WebCore::FrameLoader::checkCompleted): Do checkLoadComplete() as well.
     36        (WebCore::FrameLoader::baseURL): don't check for null document
     37        (WebCore::FrameLoader::baseTarget): ditto
     38        (WebCore::FrameLoader::completeURL): ditto
     39        (WebCore::FrameLoader::didTellBridgeAboutLoad): ditto
     40        (WebCore::FrameLoader::scheduleLocationChange): determine duringLoad differently; doc won't
     41        be null.
     42        (WebCore::FrameLoader::gotoAnchor): don't check for null document
     43        (WebCore::FrameLoader::canTarget): don't check for null document
     44        (WebCore::FrameLoader::stopForUserCancel): new method for explicit stops like window.stop().
     45        (WebCore::FrameLoader::transitionToCommitted): check for pre-loaded state properly
     46        (WebCore::FrameLoader::createEmptyDocument): removed
     47        (WebCore::FrameLoader::checkLoadCompleteForThisFrame): don't send delegate callbacks when making initial
     48        doc.
     49        (WebCore::FrameLoader::tokenizerProcessedData): Assume document; just checkCompleted now that it
     50        does checkLoadComplete.
     51        (WebCore::FrameLoader::receivedMainResourceError): assume document
     52        (WebCore::FrameLoader::saveDocumentState): Assume there's a document except during initial load
     53        (WebCore::FrameLoader::mainReceivedCompleteError): do checkCompleted, not checkLoadComplete
     54        (WebCore::FrameLoader::continueLoadWithData): assume document
     55        * loader/FrameLoader.h:
     56        * loader/MainResourceLoader.cpp:
     57        (WebCore::MainResourceLoader::receivedError): Add more ref protection and do things in a slightly
     58        different order.
     59        * page/DOMWindow.cpp:
     60        (WebCore::DOMWindow::document): don't force document creation, just assert there is one.
     61        * page/Frame.cpp:
     62        (WebCore::Frame::init): Added init method.
     63        (WebCore::Frame::pageDestroyed): when a frame is removed, make sure to check if the parent is
     64        done loading.
     65        * page/Frame.h:
     66        * page/mac/WebCoreFrameBridge.mm:
     67        (-[WebCoreFrameBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]): No need to force
     68        document.
     69        (-[WebCoreFrameBridge aeDescByEvaluatingJavaScriptFromString:]): ditto
     70        * platform/graphics/svg/SVGImage.cpp:
     71        (WebCore::SVGImage::dataChanged): init the frame
     72        * rendering/RenderPart.cpp:
     73        (WebCore::RenderPart::updateWidgetPosition): If a subframe needs layout, then lay it out even
     74        if the bounds did not change; the content size might be wrong.
     75        * rendering/RenderTreeAsText.cpp:
     76        (WebCore::externalRepresentation): Don't crash if the frame lacks a view.
     77
    1782007-05-10  David Hyatt  <hyatt@apple.com>
    279
  • trunk/WebCore/WebCore.exp

    r21307 r21367  
    146146__ZN7WebCore11FrameLoader14stopAllLoadersEv
    147147__ZN7WebCore11FrameLoader16detachFromParentEv
     148__ZN7WebCore11FrameLoader17stopForUserCancelEv
    148149__ZN7WebCore11FrameLoader18currentHistoryItemEv
    149150__ZN7WebCore11FrameLoader18shouldHideReferrerERKNS_4KURLERKNS_6StringE
     
    360361__ZN7WebCore5Frame21setProhibitsScrollingEb
    361362__ZN7WebCore5Frame26dashboardRegionsDictionaryEv
     363__ZN7WebCore5Frame4initEv
    362364__ZN7WebCore5Frame9setBridgeEP18WebCoreFrameBridge
    363365__ZN7WebCore5FrameC1EPNS_4PageEPNS_21HTMLFrameOwnerElementEPNS_17FrameLoaderClientE
  • trunk/WebCore/bindings/js/kjs_window.cpp

    r21014 r21367  
    612612    // We'd have to resolve all those issues to pass the URL instead of "".
    613613
    614     Frame* newFrame = openerFrame->loader()->createWindow(frameRequest, windowFeatures);
     614    bool created;
     615    Frame* newFrame = openerFrame->loader()->createWindow(frameRequest, windowFeatures, created);
    615616    if (!newFrame)
    616617        return 0;
     
    16911692      // request window (new or existing if framename is set)
    16921693      frameRequest.resourceRequest().setHTTPReferrer(activeFrame->loader()->outgoingReferrer());
    1693       Frame* newFrame = frame->loader()->createWindow(frameRequest, windowFeatures);
     1694      bool created;
     1695      Frame* newFrame = frame->loader()->createWindow(frameRequest, windowFeatures, created);
    16941696      if (!newFrame)
    16951697          return jsUndefined();
    16961698      newFrame->loader()->setOpener(frame);
    16971699      newFrame->loader()->setOpenedByJavaScript();
    1698      
    1699       if (!newFrame->document()) {
    1700           Document* oldDoc = frame->document();
    1701           if (oldDoc && oldDoc->baseURL() != 0)
    1702               newFrame->loader()->begin(oldDoc->baseURL());
    1703           else
    1704               newFrame->loader()->begin();
    1705           newFrame->loader()->write("<HTML><BODY>");
    1706           newFrame->loader()->end();         
    1707           if (oldDoc) {
     1700
     1701      if (created) {
     1702          if (Document* oldDoc = frame->document()) {
    17081703              newFrame->document()->setDomain(oldDoc->domain(), true);
    17091704              newFrame->document()->setBaseURL(oldDoc->baseURL());
     
    18641859  }
    18651860  case Window::Stop:
    1866         frame->loader()->stopAllLoaders();
     1861        frame->loader()->stopForUserCancel();
    18671862        return jsUndefined();
    18681863  case Window::Find:
  • trunk/WebCore/css/cssstyleselector.cpp

    r21328 r21367  
    226226    view = doc->view();
    227227    strictParsing = _strictParsing;
    228     settings = view ? view->frame()->settings() : 0;
     228    settings = doc->frame() ? doc->frame()->settings() : 0;
    229229    if (!defaultStyle)
    230230        loadDefaultStyle();
  • trunk/WebCore/html/HTMLObjectElement.cpp

    r21359 r21367  
    2929#include "ExceptionCode.h"
    3030#include "Frame.h"
     31#include "FrameLoader.h"
     32#include "FrameLoaderClient.h"
    3133#include "FrameView.h"
    3234#include "HTMLFormElement.h"
     
    295297        }
    296298    }
    297    
     299    if (document()->frame())
     300        return document()->frame()->loader()->client()->objectContentType(KURL(m_url.deprecatedString()), m_serviceType) == ObjectContentImage;
     301
    298302    return Image::supportsType(m_serviceType);
    299303}
  • trunk/WebCore/loader/FrameLoader.cpp

    r21261 r21367  
    231231    , m_opener(0)
    232232    , m_openedByJavaScript(false)
     233    , m_creatingInitialEmptyDocument(false)
     234    , m_committedFirstRealDocumentLoad(false)
    233235#if USE(LOW_BANDWIDTH_DISPLAY)
    234236    , m_useLowBandwidthDisplay(true)
     
    248250       
    249251    m_client->frameLoaderDestroyed();
     252}
     253
     254void FrameLoader::init()
     255{
     256    // this somewhat odd set of steps is needed to give the frame an initial empty document
     257    m_creatingInitialEmptyDocument = true;
     258    setPolicyDocumentLoader(m_client->createDocumentLoader(ResourceRequest(String("")), SubstituteData()).get());
     259    setProvisionalDocumentLoader(m_policyDocumentLoader.get());
     260    setState(FrameStateProvisional);
     261    m_provisionalDocumentLoader->finishedLoading();
     262    begin();
     263    write("<body>");
     264    end();
     265    m_frame->document()->cancelParsing();
     266    m_creatingInitialEmptyDocument = false;
     267    m_wasLoadEventEmitted = true;
    250268}
    251269
     
    261279}
    262280
    263 Frame* FrameLoader::createWindow(const FrameLoadRequest& request, const WindowFeatures& features)
     281Frame* FrameLoader::createWindow(const FrameLoadRequest& request, const WindowFeatures& features, bool& created)
    264282{
    265283    ASSERT(!features.dialog || request.frameName().isEmpty());
     
    270288                frame->loader()->load(request, true, 0, 0, HashMap<String, String>());
    271289            frame->page()->chrome()->focus();
     290            created = false;
    272291            return frame;
    273292        }
     
    313332    page->chrome()->show();
    314333
     334    created = true;
    315335    return frame;
    316336}
     
    533553    if (m_frame->document() && m_frame->document()->tokenizer())
    534554        m_frame->document()->tokenizer()->stopParsing();
    535  
     555
    536556    if (sendUnload) {
    537557        if (m_frame->document()) {
     
    818838void FrameLoader::begin(const KURL& url)
    819839{
    820     if (m_workingURL.isEmpty())
    821         createEmptyDocument(); // Creates an empty document if we don't have one already
    822 
    823840    clear();
    824841    partClearedInBegin();
     
    842859    RefPtr<Document> document = DOMImplementation::instance()->createDocument(m_responseMIMEType, m_frame, m_frame->inViewSourceMode());
    843860    m_frame->setDocument(document);
     861
     862    if (!m_creatingInitialEmptyDocument)
     863        m_committedFirstRealDocumentLoad = true;
    844864
    845865    document->setURL(m_URL.url());
     
    10881108void FrameLoader::finishedParsing()
    10891109{
     1110    if (m_creatingInitialEmptyDocument)
     1111        return;
     1112
    10901113    // This can be called from the Frame's destructor, in which case we shouldn't protect ourselves
    10911114    // because doing so will cause us to re-enter the destructor when protector goes out of scope.
     
    11501173
    11511174    completed();
     1175    if (m_frame->page())
     1176        checkLoadComplete();
    11521177}
    11531178
     
    11901215KURL FrameLoader::baseURL() const
    11911216{
    1192     if (!m_frame->document())
    1193         return KURL();
     1217    ASSERT(m_frame->document());
    11941218    return m_frame->document()->baseURL();
    11951219}
     
    11971221String FrameLoader::baseTarget() const
    11981222{
    1199     if (!m_frame->document())
    1200         return String();
     1223    ASSERT(m_frame->document());
    12011224    return m_frame->document()->baseTarget();
    12021225}
     
    12041227KURL FrameLoader::completeURL(const String& url)
    12051228{
    1206     if (!m_frame->document())
    1207         return url.deprecatedString();
     1229    ASSERT(m_frame->document());
    12081230    return m_frame->document()->completeURL(url).deprecatedString();
    12091231}
     
    12321254    // Handle a location change of a page with no document as a special case.
    12331255    // This may happen when a frame changes the location of another frame.
    1234     bool duringLoad = !m_frame->document();
     1256    bool duringLoad = !m_committedFirstRealDocumentLoad;
    12351257
    12361258    // If a redirect was scheduled during a load, then stop the current load.
    12371259    // Otherwise when the current load transitions from a provisional to a
    12381260    // committed state, pending redirects may be cancelled.
    1239     if (duringLoad)
     1261    if (duringLoad) {
     1262        if (m_provisionalDocumentLoader)
     1263            m_provisionalDocumentLoader->stopLoading();
    12401264        stopLoading(true);   
     1265    }
    12411266
    12421267    ScheduledRedirection::Type type = duringLoad
     
    13621387bool FrameLoader::gotoAnchor(const String& name)
    13631388{
    1364     if (!m_frame->document())
    1365         return false;
     1389    ASSERT(m_frame->document());
    13661390
    13671391    Node* anchorNode = m_frame->document()->getElementById(AtomicString(name));
     
    17171741        ASSERT_NOT_REACHED();
    17181742    }
    1719 }
    1720 
    1721 void FrameLoader::updateBaseURLForEmptyDocument()
    1722 {
    1723     HTMLFrameOwnerElement* owner = m_frame->ownerElement();
    1724     // FIXME: Should embed be included?
    1725     if (owner && (owner->hasTagName(iframeTag) || owner->hasTagName(objectTag) || owner->hasTagName(embedTag)))
    1726         m_frame->document()->setBaseURL(m_frame->tree()->parent()->document()->baseURL());
    17271743}
    17281744
     
    21712187        return true;
    21722188
    2173     String domain;
    2174     if (Document* document = m_frame->document())
    2175         domain = document->domain();
     2189    ASSERT(m_frame->document());
     2190    String domain = m_frame->document()->domain();
    21762191    // Allow if the request is made from a local file.
    21772192    if (domain.isEmpty())
     
    22152230
    22162231    m_inStopAllLoaders = false;   
     2232}
     2233
     2234void FrameLoader::stopForUserCancel()
     2235{
     2236    stopAllLoaders();
     2237    if (m_frame->page())
     2238        checkLoadComplete();
    22172239}
    22182240
     
    23792401    // or the two will stomp each other.
    23802402    DocumentLoader* pdl = m_provisionalDocumentLoader.get();
    2381     closeURL();
     2403    if (m_documentLoader)
     2404        closeURL();
    23822405    if (pdl != m_provisionalDocumentLoader)
    23832406        return;
     
    24442467    // Tell the client we've committed this URL.
    24452468    ASSERT(m_client->hasFrameView());
     2469
     2470    if (m_creatingInitialEmptyDocument)
     2471        return;
     2472
    24462473    m_client->dispatchDidCommitLoad();
    24472474   
     
    27482775                    && m_frame->page() && m_frame->page()->backForwardList())
    27492776                restoreScrollPositionAndViewState();
     2777
     2778            if (m_creatingInitialEmptyDocument)
     2779                return;
    27502780
    27512781            const ResourceError& error = dl->mainDocumentError();
     
    29162946}
    29172947
    2918 void FrameLoader::createEmptyDocument()
    2919 {
    2920     // Although it's not completely clear from the name of this function,
    2921     // it does nothing if we already have a document, and just creates an
    2922     // empty one if we have no document at all.
    2923     if (!m_frame->document()) {
    2924         loadEmptyDocumentSynchronously();
    2925         updateBaseURLForEmptyDocument();
    2926     }
    2927 }
    2928 
    29292948void FrameLoader::tokenizerProcessedData()
    29302949{
    2931     if (m_frame->document())
    2932         checkCompleted();
    2933     checkLoadComplete();
     2950    ASSERT(m_frame->page());
     2951    ASSERT(m_frame->document());
     2952
     2953    checkCompleted();
    29342954}
    29352955
     
    31693189        // transitioned to the new page (before WebFrameState == commit).  The goal here is to restore any state
    31703190        // so that the existing view (that wenever got far enough to replace) can continue being used.
    3171         Document* document = m_frame->document();
    3172         if (document)
    3173             document->setInPageCache(false);
     3191        m_frame->document()->setInPageCache(false);
    31743192        invalidateCurrentItemCachedPage();
    31753193       
     
    37333751void FrameLoader::saveDocumentState()
    37343752{
     3753    if (m_creatingInitialEmptyDocument)
     3754        return;
     3755
    37353756    // Do not save doc state if the page has a password field and a form that would be submitted via https.
    37363757    Document* document = m_frame->document();
    3737     if (document && document->hasPasswordField() && document->hasSecureForm())
     3758    ASSERT(document);
     3759    if (document->hasPasswordField() && document->hasSecureForm())
    37383760        return;
    37393761       
     
    41754197    loader->setPrimaryLoadComplete(true);
    41764198    m_client->dispatchDidLoadMainResource(activeDocumentLoader());
    4177     checkLoadComplete();
     4199    checkCompleted();
    41784200}
    41794201
     
    43764398    setEncoding(encoding, userChosen);
    43774399
    4378     if (!m_frame->document())
    4379         return;
     4400    ASSERT(m_frame->document());
    43804401
    43814402    addData(buffer->data(), buffer->size());
  • trunk/WebCore/loader/FrameLoader.h

    r21244 r21367  
    132132        ~FrameLoader();
    133133
     134        void init();
     135
    134136        Frame* frame() const { return m_frame; }
    135137
     
    163165        static bool shouldHideReferrer(const KURL& url, const String& referrer);
    164166
    165         Frame* createWindow(const FrameLoadRequest&, const WindowFeatures&);
     167        Frame* createWindow(const FrameLoadRequest&, const WindowFeatures&, bool& created);
    166168
    167169        void loadResourceSynchronously(const ResourceRequest&, ResourceError&, ResourceResponse&, Vector<char>& data);
     
    171173        // Also not cool.
    172174        void stopAllLoaders();
     175        void stopForUserCancel();
    173176        void cancelPendingArchiveLoad(ResourceLoader*);
    174177
     
    331334        Widget* createJavaAppletWidget(const IntSize&, Element*, const HashMap<String, String>& args);
    332335
    333         void createEmptyDocument();
    334 
    335336        void partClearedInBegin();
    336337        void restoreDocumentState();
     
    621622        bool m_openedByJavaScript;
    622623
     624        bool m_creatingInitialEmptyDocument;
     625        bool m_committedFirstRealDocumentLoad;
     626
    623627        RefPtr<HistoryItem> m_currentHistoryItem;
    624628        RefPtr<HistoryItem> m_previousHistoryItem;
  • trunk/WebCore/loader/MainResourceLoader.cpp

    r21254 r21367  
    6363    // Calling receivedMainResourceError will likely result in the last reference to this object to go away.
    6464    RefPtr<MainResourceLoader> protect(this);
    65 
    66     frameLoader()->receivedMainResourceError(error, true);
     65    RefPtr<Frame> protectFrame(m_frame);
    6766
    6867    if (!cancelled()) {
    6968        ASSERT(!reachedTerminalState());
    7069        frameLoader()->didFailToLoad(this, error);
    71 
     70    }
     71   
     72    frameLoader()->receivedMainResourceError(error, true);
     73
     74    if (!cancelled()) {
    7275        releaseResources();
    7376    }
    74    
     77
    7578    ASSERT(reachedTerminalState());
    7679}
  • trunk/WebCore/page/DOMWindow.cpp

    r17652 r21367  
    5959    if (!m_frame)
    6060        return 0;
    61    
    62     if (!m_frame->document()) {
    63         m_frame->loader()->createEmptyDocument();
    64         m_frame->loader()->begin();
    65         m_frame->loader()->write("<HTML><BODY>");
    66         m_frame->loader()->end();
    67     }
     61
     62    ASSERT(m_frame->document());
    6863    return m_frame->document();
    6964}
  • trunk/WebCore/page/Frame.cpp

    r21222 r21367  
    253253}
    254254
     255void Frame::init()
     256{
     257    d->m_loader->init();
     258}
     259
    255260FrameLoader* Frame::loader() const
    256261{
     
    17131718void Frame::pageDestroyed()
    17141719{
     1720    if (Frame* parent = tree()->parent())
     1721        parent->loader()->checkLoadComplete();
     1722
    17151723    if (d->m_page && d->m_page->focusController()->focusedFrame() == this)
    17161724        d->m_page->focusController()->setFocusedFrame(0);
  • trunk/WebCore/page/Frame.h

    r21219 r21367  
    124124    virtual ~Frame();
    125125   
     126    void init();
     127
    126128#if PLATFORM(MAC)   
    127129    void setBridge(WebCoreFrameBridge*);
  • trunk/WebCore/page/mac/WebCoreFrameBridge.mm

    r21157 r21367  
    682682- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)string forceUserGesture:(BOOL)forceUserGesture
    683683{
    684     m_frame->loader()->createEmptyDocument();
     684    ASSERT(m_frame->document());
    685685    JSValue* result = m_frame->loader()->executeScript(0, string, forceUserGesture);
    686686    if (!result)
     
    692692- (NSAppleEventDescriptor *)aeDescByEvaluatingJavaScriptFromString:(NSString *)string
    693693{
    694     m_frame->loader()->createEmptyDocument();
     694    ASSERT(m_frame->document());
    695695    JSValue* result = m_frame->loader()->executeScript(0, string, true);
    696696    if (!result) // FIXME: pass errors
  • trunk/WebCore/platform/graphics/svg/SVGImage.cpp

    r20837 r21367  
    137137        m_page.set(new Page(dummyChromeClient, dummyContextMenuClient, dummyEditorClient, dummyDragClient));
    138138        m_frame = new Frame(m_page.get(), 0, dummyFrameLoaderClient);
     139        m_frame->init();
    139140        m_frameView = new FrameView(m_frame.get());
    140141        m_frameView->deref(); // FIXME: FrameView starts with a refcount of 1
  • trunk/WebCore/rendering/RenderPart.cpp

    r21079 r21367  
    9898    height = m_height - borderTop() - borderBottom() - paddingTop() - paddingBottom();
    9999    IntRect newBounds(x,y,width,height);
    100     if (newBounds != m_widget->frameGeometry()) {
     100    bool boundsChanged = newBounds != m_widget->frameGeometry();
     101    if (boundsChanged) {
    101102        // The widget changed positions.  Update the frame geometry.
    102103        RenderArena *arena = ref();
     
    105106        element()->deref();
    106107        deref(arena);
    107        
    108         if (m_widget && m_widget->isFrameView())
    109             static_cast<FrameView*>(m_widget)->layout();
     108    }
     109
     110    // if the frame bounds got changed, or if view needs layout (possibly indicating
     111    // content size is wrong) we have to do a layout to set the right widget size
     112    if (m_widget && m_widget->isFrameView()) {
     113        FrameView* frameView = static_cast<FrameView*>(m_widget);
     114        if (boundsChanged || frameView->needsLayout())
     115            frameView->layout();
    110116    }
    111117}
  • trunk/WebCore/rendering/RenderTreeAsText.cpp

    r21082 r21367  
    486486        writeRenderResources(ts, o->document());
    487487#endif
    488         o->view()->frameView()->layout();
     488        if (o->view()->frameView())
     489            o->view()->frameView()->layout();
    489490        RenderLayer* l = o->layer();
    490491        if (l) {
  • trunk/WebKit/ChangeLog

    r21349 r21367  
     12007-05-10  Maciej Stachowiak  <mjs@apple.com>
     2
     3        Reviewed by Oliver.
     4
     5        - WebKit part of fix for:
     6        <rdar://problem/5063277> blank screen after login to Citibank Online (accessing document before frame starts loading cancels load)
     7        <rdar://problem/5159541> REGRESSION (r20972): Wall Street Journal pages replaced by advertisements (13465)
     8
     9        The basic approach is to have Frames start out containing an empty document instead of absolutely nothing,
     10        so there is no need to initialize them on demand. Various side effects of that cause both of these bugs.
     11       
     12        However, this caused many regressions so I had to fix the fallout.
     13
     14        * WebCoreSupport/WebChromeClient.mm:
     15        (WebChromeClient::takeFocus): Avoid focus cycle problems (can happen in DumpRenderTree
     16        with initial empty document now).
     17        * WebCoreSupport/WebFrameBridge.mm:
     18        (-[WebFrameBridge finishInitializingWithPage:frameName:frameView:ownerElement:]): init the frame.
     19        (-[WebFrameBridge determineObjectFromMIMEType:URL:]): return image type when appropriate
     20        * WebView/WebFrame.mm:
     21        (-[WebFrame stopLoading]): use stopForUserCancel().
     22        * WebView/WebFrameView.mm:
     23        (-[WebFrameView _makeDocumentViewForDataSource:]): assume html when no mime type available.
     24        * WebView/WebView.mm:
     25        (-[WebView becomeFirstResponder]): Track whether we are becoming first responder from
     26        outside the view.
     27        (-[WebView _becomingFirstResponderFromOutside]): Return this value.
     28        * WebView/WebViewInternal.h:
     29
    1302007-05-09  Oliver Hunt  <oliver@apple.com>
    231
  • trunk/WebKit/WebCoreSupport/WebChromeClient.mm

    r21091 r21367  
    117117        // behave as if it had no subviews, which is the behavior we want.
    118118        NSView *lastView = [m_webView _findLastViewInKeyViewLoop];
     119        // avoid triggering assertions if the WebView is the only thing in the key loop
     120        if ([m_webView _becomingFirstResponderFromOutside] && m_webView == [lastView nextValidKeyView])
     121            return;
    119122        [[m_webView window] selectKeyViewFollowingView:lastView];
    120     } else
     123    } else {
     124        // avoid triggering assertions if the WebView is the only thing in the key loop
     125        if ([m_webView _becomingFirstResponderFromOutside] && m_webView == [m_webView previousValidKeyView])
     126            return;
    121127        [[m_webView window] selectKeyViewPrecedingView:m_webView];
     128    }
    122129}
    123130
  • trunk/WebKit/WebCoreSupport/WebFrameBridge.mm

    r21307 r21367  
    144144    m_frame->setBridge(self);
    145145    m_frame->tree()->setName(name);
     146    m_frame->init();
    146147   
    147148    [self setTextSizeMultiplier:[webView textSizeMultiplier]];
     
    650651
    651652    if (MimeTypeRegistry::isSupportedImageMIMEType(MIMEType))
    652         return ObjectElementFrame;
     653        return ObjectElementImage;
    653654
    654655    if ([[self webView] _isMIMETypeRegisteredAsPlugin:MIMEType])
  • trunk/WebKit/WebView/WebFrame.mm

    r21307 r21367  
    848848{
    849849    if (FrameLoader* frameLoader = [self _frameLoader])
    850         frameLoader->stopAllLoaders();
     850        frameLoader->stopForUserCancel();
    851851}
    852852
  • trunk/WebKit/WebView/WebFrameView.mm

    r20269 r21367  
    170170
    171171-(NSView <WebDocumentView> *)_makeDocumentViewForDataSource:(WebDataSource *)dataSource
    172 {   
    173     Class viewClass = [[self class] _viewClassForMIMEType:[[dataSource response] MIMEType]];
     172{
     173    NSString* MIMEType = [[dataSource response] MIMEType];
     174    if (!MIMEType)
     175        MIMEType = @"text/html";
     176    Class viewClass = [[self class] _viewClassForMIMEType:MIMEType];
    174177    NSView <WebDocumentView> *documentView;
    175178    if (viewClass) {
  • trunk/WebKit/WebView/WebView.mm

    r21306 r21367  
    249249@end
    250250
     251@interface NSWindow (AppKitSecretsIKnow)
     252- (id)_oldFirstResponderBeforeBecoming;
     253@end
     254
    251255@interface NSObject (ValidateWithoutDelegate)
    252256- (BOOL)validateUserInterfaceItemWithoutDelegate:(id <NSValidatedUserInterfaceItem>)item;
     
    300304    BOOL tabKeyCyclesThroughElementsChanged;
    301305    BOOL becomingFirstResponder;
     306    BOOL becomingFirstResponderFromOutside;
    302307    BOOL hoverFeedbackSuspended;
    303308
     
    22582263    NSWindow *window = [self window];
    22592264    WebFrameView *mainFrameView = [[self mainFrame] frameView];
     2265
     2266    NSResponder *previousFirstResponder = [[self window] _oldFirstResponderBeforeBecoming];
     2267    BOOL fromOutside = ![previousFirstResponder isKindOfClass:[NSView class]] || (![(NSView *)previousFirstResponder isDescendantOf:self] && previousFirstResponder != self);
    22602268   
    22612269    if ([window keyViewSelectionDirection] == NSSelectingPrevious) {
     
    22632271        if ((previousValidKeyView != self) && (previousValidKeyView != mainFrameView)) {
    22642272            _private->becomingFirstResponder = YES;
     2273            _private->becomingFirstResponderFromOutside = fromOutside;
    22652274            [window makeFirstResponder:previousValidKeyView];
     2275            _private->becomingFirstResponderFromOutside = NO;
    22662276            _private->becomingFirstResponder = NO;
    22672277            return YES;
     
    22732283    if ([mainFrameView acceptsFirstResponder]) {
    22742284        _private->becomingFirstResponder = YES;
     2285        _private->becomingFirstResponderFromOutside = fromOutside;
    22752286        [window makeFirstResponder:mainFrameView];
     2287        _private->becomingFirstResponderFromOutside = NO;
    22762288        _private->becomingFirstResponder = NO;
    22772289        return YES;
     
    35823594@implementation WebView (WebViewInternal)
    35833595
     3596- (BOOL)_becomingFirstResponderFromOutside
     3597{
     3598    return _private->becomingFirstResponderFromOutside;
     3599}
     3600
    35843601- (NSString *)_userVisibleBundleVersionFromFullVersion:(NSString *)fullVersion
    35853602{
  • trunk/WebKit/WebView/WebViewInternal.h

    r21159 r21367  
    110110- (id)_objectForIdentifier:(unsigned long)identifier;
    111111- (void)_removeObjectForIdentifier:(unsigned long)identifier;
     112- (BOOL)_becomingFirstResponderFromOutside;
    112113@end
  • trunk/WebKitTools/ChangeLog

    r21364 r21367  
     12007-05-08  Maciej Stachowiak  <mjs@apple.com>
     2
     3        Reviewed by Oliver.
     4       
     5        - don't clear events whenever an EventSendingController goes away, only do it at predictable times,
     6        since destroying a subframe can make one go away
     7       
     8        (Discovered while fixing:
     9       
     10        <rdar://problem/5063277> blank screen after login to Citibank Online (accessing document before frame starts loading cancels load)
     11        <rdar://problem/5159541> REGRESSION (r20972): Wall Street Journal pages replaced by advertisements (13465)
     12
     13        * DumpRenderTree/DumpRenderTree.m:
     14        (runTest): explicitly clear saved events after every page load
     15        * DumpRenderTree/EventSendingController.h:
     16        * DumpRenderTree/EventSendingController.m:
     17        (-[EventSendingController dealloc]): don't clear saved events here...
     18        (+[EventSendingController clearSavedEvents]): do it here
     19        * Scripts/check-for-global-initializers:
     20
    1212007-05-10  Mark Rowe  <mrowe@apple.com>
    222
  • trunk/WebKitTools/DumpRenderTree/DumpRenderTree.m

    r21354 r21367  
    15521552    }
    15531553    pool = [[NSAutoreleasePool alloc] init];
     1554    [EventSendingController clearSavedEvents];
    15541555    [[frame webView] setSelectedDOMRange:nil affinity:NSSelectionAffinityDownstream];
    15551556   
  • trunk/WebKitTools/DumpRenderTree/EventSendingController.h

    r19101 r21367  
    4242+ (void)saveEvent:(NSInvocation *)event;
    4343+ (void)replaySavedEvents;
     44+ (void)clearSavedEvents;
    4445
    4546- (void)enableDOMUIEventLogging:(WebScriptObject *)node;
  • trunk/WebKitTools/DumpRenderTree/EventSendingController.m

    r20407 r21367  
    147147- (void)dealloc
    148148{
    149     [savedMouseEvents release];
    150     savedMouseEvents = nil;
    151149    [super dealloc];
    152150}
     
    328326    }
    329327    replayingSavedEvents = NO;
     328}
     329
     330+ (void)clearSavedEvents
     331{
     332    [savedMouseEvents release];
     333    savedMouseEvents = nil;
    330334}
    331335
  • trunk/WebKitTools/Scripts/check-for-global-initializers

    r21228 r21367  
    8282        $shortName =~ s/.*\///;
    8383
     84        next if $shortName eq "array_object.o";
     85
    8486        # Special cases for files that have initializers in debug builds.
    8587        if ($configuration eq "Debug") {
Note: See TracChangeset for help on using the changeset viewer.