Changeset 71892 in webkit
- Timestamp:
- Nov 11, 2010 10:51:46 PM (13 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r71887 r71892 1 2010-11-11 Shinichiro Hamaji <hamaji@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 REGRESSION: window.print in onload doesn't fire if there's an img 6 https://bugs.webkit.org/show_bug.cgi?id=48195 7 8 This issue was introduced in 9 https://bugs.webkit.org/show_bug.cgi?id=43658 10 This happens because FrameLoader::isLoading() is false while an 11 image is still loading. Now, window.print() happens after all 12 resources are loaded. 13 14 Also changed the name of a member variable as Darin suggested in Bug 43658. 15 16 Added a manual test as DRT doesn't support window.print() yet. 17 18 * loader/DocumentLoader.cpp: 19 (WebCore::DocumentLoader::DocumentLoader): 20 (WebCore::DocumentLoader::updateLoading): 21 * loader/DocumentLoader.h: 22 * page/DOMWindow.cpp: 23 (WebCore::DOMWindow::DOMWindow): 24 (WebCore::DOMWindow::print): 25 (WebCore::DOMWindow::finishedLoading): 26 * page/DOMWindow.h: 27 1 28 2010-11-11 James Simonsen <simonjam@chromium.org> 2 29 -
trunk/WebCore/loader/DocumentLoader.cpp
r71625 r71892 35 35 #include "CachedPage.h" 36 36 #include "CachedResourceLoader.h" 37 #include "DOMWindow.h" 37 38 #include "Document.h" 38 39 #include "DocumentParser.h" … … 357 358 } 358 359 ASSERT(this == frameLoader()->activeDocumentLoader()); 360 bool wasLoading = m_loading; 359 361 setLoading(frameLoader()->isLoading()); 362 363 if (wasLoading && !m_loading) { 364 if (DOMWindow* window = m_frame->existingDOMWindow()) 365 window->finishedLoading(); 366 } 360 367 } 361 368 -
trunk/WebCore/loader/FrameLoader.cpp
r71625 r71892 2177 2177 m_client->dispatchDidLoadMainResource(dl.get()); 2178 2178 checkLoadComplete(); 2179 2180 DOMWindow* window = m_frame->existingDOMWindow();2181 if (window && window->printDeferred())2182 window->print();2183 2179 } 2184 2180 -
trunk/WebCore/page/DOMWindow.cpp
r71219 r71892 393 393 394 394 DOMWindow::DOMWindow(Frame* frame) 395 : m_ printDeferred(false),396 395 : m_shouldPrintWhenFinishedLoading(false) 396 , m_frame(frame) 397 397 { 398 398 } … … 893 893 return; 894 894 895 if (m_frame->loader()-> isLoading()) {896 m_ printDeferred= true;897 return; 898 } 899 m_ printDeferred= false;895 if (m_frame->loader()->activeDocumentLoader()->isLoading()) { 896 m_shouldPrintWhenFinishedLoading = true; 897 return; 898 } 899 m_shouldPrintWhenFinishedLoading = false; 900 900 page->chrome()->print(m_frame); 901 901 } … … 1568 1568 } 1569 1569 1570 void DOMWindow::finishedLoading() 1571 { 1572 if (m_shouldPrintWhenFinishedLoading) { 1573 m_shouldPrintWhenFinishedLoading = false; 1574 print(); 1575 } 1576 } 1577 1570 1578 EventTargetData* DOMWindow::eventTargetData() 1571 1579 { -
trunk/WebCore/page/DOMWindow.h
r70102 r71892 92 92 virtual ScriptExecutionContext* scriptExecutionContext() const; 93 93 94 bool printDeferred() const { return m_printDeferred; }95 94 Frame* frame() const { return m_frame; } 96 95 void disconnectFrame(); … … 367 366 void releaseEvents(); 368 367 368 void finishedLoading(); 369 369 370 // These methods are used for GC marking. See JSDOMWindow::markChildren(MarkStack&) in 370 371 // JSDOMWindowCustom.cpp. … … 411 412 KURL m_url; 412 413 413 bool m_ printDeferred;414 bool m_shouldPrintWhenFinishedLoading; 414 415 Frame* m_frame; 415 416 mutable RefPtr<Screen> m_screen;
Note: See TracChangeset
for help on using the changeset viewer.