Changeset 25783 in webkit
- Timestamp:
- Sep 27, 2007, 4:56:17 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 10 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r25773 r25783 1 2007-09-27 Antti Koivisto <antti@apple.com> 2 3 Reviewed by Geoff. 4 5 Tests for <rdar://problem/5499125> 6 REGRESSION (r21359-21368): After launching Kidzui beta, a webview frame fails to appear in its main window 7 8 * fast/dom/Window/window-early-properties-expected.txt: Added. 9 * fast/dom/Window/window-early-properties.html: Added. 10 * http/tests/security/resources/has-custom-property.html: Added. 11 * http/tests/security/resources/no-custom-property.html: Added. 12 * http/tests/security/window-properties-clear-domain-expected.txt: Added. 13 * http/tests/security/window-properties-clear-domain.html: Added. 14 * http/tests/security/window-properties-clear-port-expected.txt: Added. 15 * http/tests/security/window-properties-clear-port.html: Added. 16 * http/tests/security/window-properties-pass-expected.txt: Added. 17 * http/tests/security/window-properties-pass.html: Added. 18 1 19 2007-09-26 Adam Roben <aroben@apple.com> 2 20 -
trunk/WebCore/ChangeLog
r25781 r25783 1 2007-09-27 Antti Koivisto <antti@apple.com> 2 3 Reviewed by Geoff. 4 5 Fix for <rdar://problem/5499125> 6 REGRESSION (r21367): After launching Kidzui beta, a webview frame fails to appear in its main window 7 8 If window object properties were modified when it had initial empty document (synchronously after 9 window.open() for example) those modifications were lost when the real document was switched in. 10 11 Match Firefox behavior where window properties are not cleared if the inital document and the loaded one 12 have matching security domains. 13 14 Tests: fast/dom/Window/window-early-properties.html 15 http/tests/security/window-properties-clear-domain.html 16 http/tests/security/window-properties-clear-port.html 17 http/tests/security/window-properties-pass.html 18 19 * WebCore.exp: 20 * loader/FrameLoader.cpp: 21 (WebCore::FrameLoader::FrameLoader): 22 (WebCore::FrameLoader::init): 23 (WebCore::FrameLoader::clear): 24 (WebCore::FrameLoader::isSecureTransition): 25 (WebCore::FrameLoader::begin): 26 * loader/FrameLoader.h: 27 If we are transitioning from initial empty document to the final one, do a domain security check 28 between old security policy URL and new URL. If that passes don't clear script proxy and script objects. 29 30 * bindings/js/kjs_proxy.cpp: 31 (WebCore::KJSProxy::updateDocumentWrapper): 32 * bindings/js/kjs_proxy.h: 33 * page/Frame.cpp: 34 (WebCore::Frame::setDocument): 35 Since we don't always clear window properties anymore, we need to update the document property to point to 36 the newly created one. 37 1 38 2007-09-27 Kevin Decker <kdecker@apple.com> 2 39 -
trunk/WebCore/WebCore.exp
r25547 r25783 169 169 __ZN7WebCore11FrameLoader4loadERKNS_4KURLEPNS_5EventE 170 170 __ZN7WebCore11FrameLoader4loadERKNS_4KURLERKNS_6StringENS_13FrameLoadTypeES6_PNS_5EventEN3WTF10PassRefPtrINS_9FormStateEEE 171 __ZN7WebCore11FrameLoader5clearEb 171 __ZN7WebCore11FrameLoader5clearEbb 172 172 __ZN7WebCore11FrameLoader6reloadEv 173 173 __ZN7WebCore11FrameLoader7canLoadERKNS_4KURLEPKNS_8DocumentE -
trunk/WebCore/bindings/js/kjs_proxy.cpp
r25754 r25783 27 27 #include "FrameLoader.h" 28 28 #include "GCController.h" 29 #include "JSDocument.h" 29 30 #include "JSDOMWindow.h" 30 31 #include "Page.h" … … 165 166 m_frame->loader()->dispatchWindowObjectAvailable(); 166 167 } 168 169 void KJSProxy::updateDocumentWrapper() 170 { 171 if (!m_script || !m_frame->document()) 172 return; 173 JSLock lock; 174 // this will update 'document' property to point to the current document 175 toJS(m_script->globalExec(), m_frame->document()); 176 } 167 177 168 178 } -
trunk/WebCore/bindings/js/kjs_proxy.h
r25754 r25783 55 55 56 56 bool haveInterpreter() const { return m_script; } 57 58 void updateDocumentWrapper(); 57 59 58 60 private: -
trunk/WebCore/loader/FrameLoader.cpp
r25779 r25783 237 237 , m_openedByDOM(false) 238 238 , m_creatingInitialEmptyDocument(false) 239 , m_isDisplayingInitialEmptyDocument(false) 239 240 , m_committedFirstRealDocumentLoad(false) 240 241 , m_didPerformFirstNavigation(false) … … 261 262 { 262 263 // this somewhat odd set of steps is needed to give the frame an initial empty document 264 m_isDisplayingInitialEmptyDocument = false; 263 265 m_creatingInitialEmptyDocument = true; 264 266 setPolicyDocumentLoader(m_client->createDocumentLoader(ResourceRequest(String("")), SubstituteData()).get()); … … 764 766 } 765 767 766 void FrameLoader::clear(bool clearWindowProperties )768 void FrameLoader::clear(bool clearWindowProperties, bool clearScriptObjects) 767 769 { 768 770 // FIXME: Commenting out the below line causes <http://bugs.webkit.org/show_bug.cgi?id=11212>, but putting it … … 801 803 802 804 m_containsPlugIns = false; 803 m_frame->clearScriptObjects(); 805 806 if (clearScriptObjects) 807 m_frame->clearScriptObjects(); 804 808 805 809 m_redirectionTimer.stop(); … … 810 814 811 815 m_receivedData = false; 816 m_isDisplayingInitialEmptyDocument = false; 812 817 813 818 if (!m_encodingWasChosenByUser) … … 854 859 m_responseMIMEType = type; 855 860 } 861 862 bool FrameLoader::isSecureTransition(const KURL& fromURL, const KURL& toURL) 863 { 864 // new window created by the application 865 if (fromURL.isEmpty()) 866 return true; 867 868 if (fromURL.isLocalFile()) 869 return true; 870 871 if (equalIgnoringCase(fromURL.host(), toURL.host()) && equalIgnoringCase(fromURL.protocol(), toURL.protocol()) && fromURL.port() == toURL.port()) 872 return true; 873 874 return false; 875 } 856 876 857 877 void FrameLoader::begin() … … 862 882 void FrameLoader::begin(const KURL& url, bool dispatch) 863 883 { 864 clear(); 884 bool resetScripting = !(m_isDisplayingInitialEmptyDocument && m_frame->document() 885 && isSecureTransition(m_frame->document()->securityPolicyURL(), url)); 886 clear(resetScripting, resetScripting); 865 887 if (dispatch) 866 888 dispatchWindowObjectAvailable(); … … 870 892 m_didCallImplicitClose = false; 871 893 m_isLoadingMainResource = true; 894 m_isDisplayingInitialEmptyDocument = m_creatingInitialEmptyDocument; 872 895 873 896 KURL ref(url); -
trunk/WebCore/loader/FrameLoader.h
r25576 r25783 532 532 void updateHistoryAfterClientRedirect(); 533 533 534 void clear(bool clearWindowProperties = true );534 void clear(bool clearWindowProperties = true, bool clearScriptObjects = true); 535 535 536 536 bool shouldReloadToHandleUnreachableURL(DocumentLoader*); … … 546 546 547 547 void startIconLoader(); 548 549 bool isSecureTransition(const KURL& fromURL, const KURL& toURL); 548 550 549 551 #if USE(LOW_BANDWIDTH_DISPLAY) … … 637 639 638 640 bool m_creatingInitialEmptyDocument; 641 bool m_isDisplayingInitialEmptyDocument; 639 642 bool m_committedFirstRealDocumentLoad; 640 643 -
trunk/WebCore/page/Frame.cpp
r25754 r25783 280 280 if (d->m_doc && !d->m_doc->attached()) 281 281 d->m_doc->attach(); 282 283 if (d->m_jscript && d->m_doc) 284 d->m_jscript->updateDocumentWrapper(); 282 285 } 283 286
Note:
See TracChangeset
for help on using the changeset viewer.