Changeset 25410 in webkit
- Timestamp:
- Sep 6, 2007 8:48:39 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r25408 r25410 1 2007-09-06 Tristan O'Tierney <tristan@apple.com> 2 3 Reviewed by Maciej Stachowiak. 4 5 * http/tests/navigation/onload-navigation-iframe-expected.txt: Added. 6 * http/tests/navigation/onload-navigation-iframe-timeout-expected.txt: Added. 7 * http/tests/navigation/onload-navigation-iframe-timeout.html: Added. 8 * http/tests/navigation/onload-navigation-iframe.html: Added. 9 1 10 2007-09-06 Sam Weinig <sam@webkit.org> 2 11 -
trunk/WebCore/ChangeLog
r25405 r25410 1 2007-09-06 Tristan O'Tierney <tristan@apple.com> 2 3 Reviewed by Maciej Stachowiak. 4 5 <rdar://problem/5333496> Back button stopped working on sfgate.com (14957) 6 7 This fix is specifically targted to address sfgate.com and reuters.com with minimal 8 impact to other areas of the frameloader. It does not cause any regression tests to fail. 9 I've added two layout tests: One to detect this particular bug, and one to address 10 a secondary issue: if an iframe navigation occurs during onload by a timeout an 11 additional history item is added, similarly to firefox. We tried to match firefox 12 more than IE with this fix but did gain a little bit of IE compatability. 13 14 Tests: http/tests/navigation/onload-navigation-iframe-timeout.html 15 http/tests/navigation/onload-navigation-iframe.html 16 17 * dom/Document.h: 18 (WebCore::Document::processingLoadEvent): 19 Return the m_processingLoadEvent boolean so FrameLoader knows 20 that the document is in the middle of calling <body onload> 21 22 * html/HTMLFrameOwnerElement.cpp: 23 (WebCore::HTMLFrameOwnerElement::HTMLFrameOwnerElement): 24 * html/HTMLFrameOwnerElement.h: 25 (WebCore::HTMLFrameOwnerElement::createdByParser): 26 (WebCore::HTMLFrameOwnerElement::setCreatedByParser): 27 Added support for a new member variable of frame elements: m_createdByParser. 28 This lets us specifically target the fix to only iframes created via JS 29 and not in-document. 30 31 * loader/FrameLoader.cpp: 32 (WebCore::FrameLoader::FrameLoader): 33 Initialize m_navigationDuringLoad to false 34 35 (WebCore::FrameLoader::provisionalLoadStarted): 36 Determine if the load we're about to start is occuring during 37 an onload. 38 39 (WebCore::FrameLoader::updateHistoryForStandardLoad): 40 If the current frameloader is for a child frame, and the navigation is occuring 41 during an onload update the current history item rather than adding a new one. 42 43 * loader/FrameLoader.h: 44 Added a new member variable, m_navigationDuringLoad to track 45 the navigation status during the on load, rather than trying to determine 46 the status after (which is nearly impossible due to a new runloop spin). 47 1 48 2007-09-06 David Kilzer <ddkilzer@apple.com> 2 49 -
trunk/WebCore/dom/Document.h
r25308 r25410 838 838 void initSecurityPolicyURL(); 839 839 const KURL& securityPolicyURL() const { return m_securityPolicyURL; } 840 841 bool processingLoadEvent() const { return m_processingLoadEvent; } 840 842 841 843 protected: -
trunk/WebCore/html/HTMLFrameOwnerElement.cpp
r24362 r25410 30 30 : HTMLElement(tagName, document) 31 31 , m_contentFrame(0) 32 , m_createdByParser(false) 32 33 { 33 34 } -
trunk/WebCore/html/HTMLFrameOwnerElement.h
r24362 r25410 43 43 virtual bool isFrameOwnerElement() const { return true; } 44 44 virtual bool isKeyboardFocusable(KeyboardEvent*) const { return m_contentFrame; } 45 46 bool createdByParser() const { return m_createdByParser; } 47 void setCreatedByParser(bool createdByParser) { m_createdByParser = createdByParser; } 45 48 46 49 private: 47 50 friend class Frame; 48 51 Frame* m_contentFrame; 52 bool m_createdByParser; 49 53 }; 50 54 -
trunk/WebCore/loader/FrameLoader.cpp
r25397 r25410 218 218 , m_sentRedirectNotification(false) 219 219 , m_inStopAllLoaders(false) 220 , m_navigationDuringLoad(false) 220 221 , m_cachePolicy(CachePolicyVerify) 221 222 , m_isExecutingJavaScriptFormAction(false) … … 1603 1604 void FrameLoader::provisionalLoadStarted() 1604 1605 { 1606 Page* page = m_frame->page(); 1607 1608 // this is used to update the current history item 1609 // in the event of a navigation aytime during loading 1610 m_navigationDuringLoad = false; 1611 if (page) { 1612 Document *document = page->mainFrame()->document(); 1613 m_navigationDuringLoad = !page->mainFrame()->loader()->isComplete() || (document && document->processingLoadEvent()); 1614 } 1615 1605 1616 m_firstLayoutDone = false; 1606 1617 cancelRedirection(true); … … 4115 4126 { 4116 4127 LOG(History, "WebCoreHistory: Updating History for Standard Load in frame %s", documentLoader()->URL().url().ascii()); 4117 4118 if (!documentLoader()->isClientRedirect()) { 4119 if (!documentLoader()->urlForHistory().isEmpty()) 4128 4129 bool frameNavigationOnLoad = false; 4130 4131 // if the navigation occured during on load and this is a subframe 4132 // update the current history item rather than adding a new one 4133 // <rdar://problem/5333496> 4134 if (m_navigationDuringLoad) { 4135 HTMLFrameOwnerElement* owner = m_frame->ownerElement(); 4136 frameNavigationOnLoad = owner && !owner->createdByParser(); 4137 } 4138 4139 if (!frameNavigationOnLoad && !documentLoader()->isClientRedirect()) { 4140 if (!documentLoader()->urlForHistory().isEmpty()) 4120 4141 addHistoryForCurrentLocation(); 4121 4142 } else if (documentLoader()->unreachableURL().isEmpty() && m_currentHistoryItem) { … … 4123 4144 m_currentHistoryItem->setFormInfoFromRequest(documentLoader()->request()); 4124 4145 } 4146 4147 // reset navigation during on load since we no longer 4148 // need it past thsi point 4149 m_navigationDuringLoad = false; 4125 4150 } 4126 4151 -
trunk/WebCore/loader/FrameLoader.h
r25270 r25410 585 585 bool m_sentRedirectNotification; 586 586 bool m_inStopAllLoaders; 587 bool m_navigationDuringLoad; 587 588 588 589 String m_outgoingReferrer;
Note: See TracChangeset
for help on using the changeset viewer.