Changeset 72566 in webkit
- Timestamp:
- Nov 22, 2010 3:01:28 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r72565 r72566 1 2010-11-22 Charlie Reis <creis@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 Update correct content state during back/forward navigations 6 https://bugs.webkit.org/show_bug.cgi?id=48809 7 8 Test that we update content state when leaving a form in a subframe. 9 10 * fast/history/saves-state-after-frame-nav.html: 11 * fast/history/saves-state-after-frame-nav-expected.txt: 12 * fast/history/resources/subframe-with-form.html: 13 1 14 2010-11-22 Julie Parent <jparent@chromium.org> 2 15 -
trunk/WebCore/ChangeLog
r72557 r72566 1 2010-11-22 Charlie Reis <creis@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 Update correct content state during back/forward navigations 6 https://bugs.webkit.org/show_bug.cgi?id=48809 7 8 Ensures that history's previousItem is non-null when clients try to 9 update content state (e.g., Chromium's UpdateSessionHistory). We now 10 track load completions with a boolean field rather than by clearing 11 previousItem. 12 13 Test: fast/history/saves-state-after-frame-nav.html 14 15 * loader/HistoryController.cpp: 16 * loader/HistoryController.h: 17 1 18 2010-11-22 Luiz Agostini <luiz.agostini@openbossa.org> 2 19 -
trunk/WebCore/loader/HistoryController.cpp
r72334 r72566 67 67 HistoryController::HistoryController(Frame* frame) 68 68 : m_frame(frame) 69 , m_frameLoadComplete(true) 69 70 { 70 71 } … … 139 140 140 141 // Because of previousItem's "masking" of currentItem for this purpose, it's important 141 // that previousItem be cleared at the end of a page transition. We leverage the142 // checkLoadComplete recursion to achieve this goal.143 144 HistoryItem* item = m_ previousItem ? m_previousItem.get() : m_currentItem.get();142 // that we keep track of the end of a page transition with m_frameLoadComplete. We 143 // leverage the checkLoadComplete recursion to achieve this goal. 144 145 HistoryItem* item = m_frameLoadComplete ? m_currentItem.get() : m_previousItem.get(); 145 146 if (!item) 146 147 return; … … 246 247 247 248 // Must grab the current scroll position before disturbing it 248 saveScrollPositionAndViewStateToItem(m_previousItem.get()); 249 if (!m_frameLoadComplete) 250 saveScrollPositionAndViewStateToItem(m_previousItem.get()); 249 251 } 250 252 … … 393 395 // Note previousItem must be set before we close the URL, which will 394 396 // happen when the data source is made non-provisional below 397 m_frameLoadComplete = false; 395 398 m_previousItem = m_currentItem; 396 399 ASSERT(m_provisionalItem); … … 419 422 { 420 423 // Even if already complete, we might have set a previous item on a frame that 421 // didn't do any data loading on the past transaction. Make sure to clear these out. 422 m_previousItem = 0; 424 // didn't do any data loading on the past transaction. Make sure to track that 425 // the load is complete so that we use the current item instead. 426 m_frameLoadComplete = true; 423 427 } 424 428 425 429 void HistoryController::setCurrentItem(HistoryItem* item) 426 430 { 431 m_frameLoadComplete = false; 432 m_previousItem = m_currentItem; 427 433 m_currentItem = item; 428 434 } … … 499 505 500 506 // Set the item for which we will save document state 507 m_frameLoadComplete = false; 501 508 m_previousItem = m_currentItem; 502 509 m_currentItem = item; … … 508 515 { 509 516 RefPtr<HistoryItem> bfItem = createItem(m_frame->tree()->parent() ? true : false); 510 if ( m_previousItem)517 if (!m_frameLoadComplete) 511 518 saveScrollPositionAndViewStateToItem(m_previousItem.get()); 512 519 … … 564 571 { 565 572 // This content is good, so leave it alone and look for children that need reloading 566 // Save form state (works from currentItem, since prevItem is nil)567 ASSERT( !m_previousItem);573 // Save form state (works from currentItem, since m_frameLoadComplete is true) 574 ASSERT(m_frameLoadComplete); 568 575 saveDocumentState(); 569 576 saveScrollPositionAndViewStateToItem(m_currentItem.get()); … … 572 579 view->setWasScrolledByUser(false); 573 580 581 m_previousItem = m_currentItem; 574 582 m_currentItem = item; 575 583 -
trunk/WebCore/loader/HistoryController.h
r72334 r72566 97 97 RefPtr<HistoryItem> m_previousItem; 98 98 RefPtr<HistoryItem> m_provisionalItem; 99 100 bool m_frameLoadComplete; 99 101 }; 100 102
Note: See TracChangeset
for help on using the changeset viewer.