Changeset 25576 in webkit
- Timestamp:
- Sep 14, 2007, 4:53:29 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r25563 r25576 1 2007-09-14 Timothy Hatcher <timothy@apple.com> 2 3 Reviewed by Sam. 4 5 <rdar://problem/5472970> REGRESSION (r24276): TinyMCE popups show an empty window with no content 6 7 * fast/dom/Document/early-document-access.html: Added. 8 * fast/dom/Document/resources: Added. 9 * fast/dom/Document/resources/early-document-access-popup.html: Added. 10 1 11 2007-09-13 Geoffrey Garen <ggaren@apple.com> 2 12 -
trunk/WebCore/ChangeLog
r25575 r25576 1 2007-09-14 Timothy Hatcher <timothy@apple.com> 2 3 Reviewed by Sam. 4 5 <rdar://problem/5472970> REGRESSION (r24276): TinyMCE popups show an empty window with no content 6 7 Accessing the document of a window before the load finished would cause the window 8 object to hold onto the initial empty document, and never switch over to the real document 9 once the load finished. This regression was caused by r24276 which added a check to prevent 10 clearing the window object when the load finished. The absence of this clear allowed the 11 dialogArguments set with showModalDialog to persist on the window after the load. However, 12 not clearing the window would keep other properties (and the empty document object) around. 13 14 So the fix is to store away the dialog arguments that were passed to showModalDialog and 15 put them back on the window object in the dialogArguments property each time 16 the window is cleared. 17 18 * bindings/js/kjs_window.cpp: 19 (KJS::createWindow): No longer put dialogArguments on the window here. 20 (KJS::showModalDialog): Put dialogArguments on the window and call 21 setDialogArgumentsAndReturnValueSlot to remember the arguments. 22 (KJS::Window::clear): Put m_dialogArguments back on the window as dialogArguments. 23 (KJS::WindowFunc::callAsFunction): Call the new setDialogArgumentsAndReturnValue. 24 (KJS::Window::setDialogArgumentsAndReturnValue): Store the arguments in m_dialogArguments. 25 * bindings/js/kjs_window.h: Rename setReturnValueSlot to setDialogArgumentsAndReturnValueSlot. 26 * manual-tests/modal-dialog-arguments.html: Confirmed that this test still passes. 27 28 Reverted r24276 which was all the changes in FrameLoader.cpp and FrameLoader.h. 29 30 * loader/FrameLoader.cpp: 31 (WebCore::FrameLoader::FrameLoader): Remove m_shouldClearWindowProperties. 32 (WebCore::FrameLoader::createWindow): Remove the call to setShouldClearWindowProperties. 33 (WebCore::FrameLoader::clear): No longer check m_shouldClearWindowProperties, clear the 34 window whenever clearWindowProperties is set. 35 (WebCore::FrameLoader::begin): Remove m_shouldClearWindowProperties. 36 (WebCore::FrameLoader::open): Ditto. 37 * loader/FrameLoader.h: Remove m_shouldClearWindowProperties. 38 1 39 2007-09-14 Brady Eidson <beidson@apple.com> 2 40 -
trunk/WebCore/bindings/js/kjs_window.cpp
r25545 r25576 95 95 mutable Location* loc; 96 96 WebCore::Event *m_evt; 97 JSValue **m_returnValueSlot; 97 JSValue* m_dialogArguments; 98 JSValue** m_returnValueSlot; 98 99 typedef HashMap<int, DOMWindowTimer*> TimeoutsMap; 99 100 TimeoutsMap m_timeouts; … … 359 360 360 361 static Frame* createWindow(ExecState* exec, Frame* openerFrame, const String& url, 361 const String& frameName, const WindowFeatures& windowFeatures , JSValue* dialogArgs)362 const String& frameName, const WindowFeatures& windowFeatures) 362 363 { 363 364 Frame* activeFrame = Window::retrieveActive(exec)->impl()->frame(); … … 371 372 // know what URL we are going to open. Unfortunately, this code passes the empty string 372 373 // for the URL, but there's a reason for that. Before loading we have to set up the opener, 373 // openedBy JS, and dialogArguments values. Also, to decide whether to use the URL we currently374 // openedByDOM, and dialogArguments values. Also, to decide whether to use the URL we currently 374 375 // do an isSafeScript call using the window we create, which can't be done before creating it. 375 376 // We'd have to resolve all those issues to pass the URL instead of "". … … 385 386 Window* newWindow = Window::retrieveWindow(newFrame); 386 387 387 if (dialogArgs)388 newWindow->putDirect("dialogArguments", dialogArgs);389 390 388 if (!url.startsWith("javascript:", false) || newWindow->isSafeScript(exec)) { 391 389 String completedURL = url.isEmpty() ? url : activeFrame->document()->completeURL(url); … … 477 475 wargs.fullscreen = false; 478 476 479 Frame* dialogFrame = createWindow(exec, frame, valueToStringWithUndefinedOrNullCheck(exec, args[0]), "", wargs , args[1]);477 Frame* dialogFrame = createWindow(exec, frame, valueToStringWithUndefinedOrNullCheck(exec, args[0]), "", wargs); 480 478 if (!dialogFrame) 481 479 return jsUndefined(); 482 480 483 481 Window* dialogWindow = Window::retrieveWindow(dialogFrame); 482 483 dialogWindow->putDirect("dialogArguments", args[1]); 484 484 485 485 // Get the return value either just before clearing the dialog window's 486 486 // properties (in Window::clear), or when on return from runModal. 487 487 JSValue* returnValue = 0; 488 dialogWindow->set ReturnValueSlot(&returnValue);488 dialogWindow->setDialogArgumentsAndReturnValueSlot(args[1], &returnValue); 489 489 dialogFrame->page()->chrome()->runModal(); 490 dialogWindow->set ReturnValueSlot(0);490 dialogWindow->setDialogArgumentsAndReturnValueSlot(0, 0); 491 491 492 492 // If we don't have a return value, get it now. … … 1049 1049 frame->scriptProxy()->interpreter()->initGlobalObject(); 1050 1050 1051 if (d->m_dialogArguments) 1052 putDirect("dialogArguments", d->m_dialogArguments); 1053 1051 1054 // there's likely to be lots of garbage now 1052 1055 gcController().garbageCollectSoon(); … … 1301 1304 windowFeatures.width = windowRect.width(); 1302 1305 1303 frame = createWindow(exec, frame, urlString, frameName, windowFeatures , 0);1306 frame = createWindow(exec, frame, urlString, frameName, windowFeatures); 1304 1307 1305 1308 if (!frame) … … 1444 1447 } 1445 1448 1446 void Window::setReturnValueSlot(JSValue **slot) 1447 { 1448 d->m_returnValueSlot = slot; 1449 void Window::setDialogArgumentsAndReturnValueSlot(JSValue* dialogArgs, JSValue** returnValueSlot) 1450 { 1451 d->m_dialogArguments = dialogArgs; 1452 d->m_returnValueSlot = returnValueSlot; 1449 1453 } 1450 1454 -
trunk/WebCore/bindings/js/kjs_window.h
r24531 r25576 129 129 130 130 // Set a place to put a dialog return value when the window is cleared. 131 void set ReturnValueSlot(JSValue **slot);131 void setDialogArgumentsAndReturnValueSlot(JSValue* arguments, JSValue** returnValueSlot); 132 132 133 133 typedef HashMap<JSObject*, WebCore::JSEventListener*> ListenersMap; -
trunk/WebCore/loader/FrameLoader.cpp
r25563 r25576 228 228 , m_cancellingWithLoadInProgress(false) 229 229 , m_needsClear(false) 230 , m_shouldClearWindowProperties(true)231 230 , m_receivedData(false) 232 231 , m_encodingWasChosenByUser(false) … … 318 317 frame->tree()->setName(request.frameName()); 319 318 320 frame->loader()->setShouldClearWindowProperties(false);321 322 319 page->chrome()->setToolbarsVisible(features.toolBarVisible || features.locationBarVisible); 323 320 page->chrome()->setStatusbarVisible(features.statusBarVisible); … … 789 786 790 787 // Do this after detaching the document so that the unload event works. 791 if (clearWindowProperties && m_shouldClearWindowProperties) {788 if (clearWindowProperties) { 792 789 m_frame->clearScriptProxy(); 793 790 m_frame->clearDOMWindow(); … … 871 868 872 869 m_needsClear = true; 873 m_shouldClearWindowProperties = true;874 870 m_isComplete = false; 875 871 m_didCallImplicitClose = false; … … 2686 2682 2687 2683 m_needsClear = true; 2688 m_shouldClearWindowProperties = true;2689 2684 m_isComplete = false; 2690 2685 m_didCallImplicitClose = false; -
trunk/WebCore/loader/FrameLoader.h
r25439 r25576 563 563 bool dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int length); 564 564 565 void setShouldClearWindowProperties(bool shouldClearWindowProperties) { m_shouldClearWindowProperties = shouldClearWindowProperties; }566 567 565 Frame* m_frame; 568 566 FrameLoaderClient* m_client; … … 617 615 618 616 bool m_needsClear; 619 bool m_shouldClearWindowProperties;620 617 bool m_receivedData; 621 618
Note:
See TracChangeset
for help on using the changeset viewer.