Changeset 60608 in webkit
- Timestamp:
- Jun 2, 2010 10:38:18 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 9 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r60600 r60608 1 2010-06-02 Darin Fisher <darin@chromium.org> 2 3 Reviewed by Brady Eidson. 4 5 location.href and outgoing referrer not updated properly by 6 pushState/replaceState 7 https://bugs.webkit.org/show_bug.cgi?id=40027 8 9 * fast/loader/stateobjects/document-destroyed-navigate-back-with-fragment-scroll.html: 10 Updated this test to account for location being modified by replaceState. 11 12 * fast/loader/stateobjects/pushstate-updates-location-expected.txt: Added. 13 * fast/loader/stateobjects/pushstate-updates-location.html: Added. 14 * fast/loader/stateobjects/replacestate-updates-location-expected.txt: Added. 15 * fast/loader/stateobjects/replacestate-updates-location.html: Added. 16 * http/tests/navigation/pushstate-updates-referrer-expected.txt: Added. 17 * http/tests/navigation/pushstate-updates-referrer.html: Added. 18 * http/tests/navigation/replacestate-updates-referrer-expected.txt: Added. 19 * http/tests/navigation/replacestate-updates-referrer.html: Added. 20 * http/tests/navigation/resources/check-referrer.html: Added. 21 1 22 2010-06-02 Kent Tamura <tkent@chromium.org> 2 23 -
trunk/LayoutTests/fast/loader/stateobjects/document-destroyed-navigate-back-with-fragment-scroll.html
r53672 r60608 47 47 { 48 48 alert("State popped - " + event.state + " (type " + typeof event.state + ")"); 49 if (event.state == "FirstEntry") { 50 history.replaceState("FirstEntryWillLaterBeReactivated", null, "#FirstEntryWillLaterBeReactivated"); 51 setTimeout("history.forward();", 0); 52 } else if (event.state == "SecondEntry") { 53 history.replaceState("SecondEntryWillLaterBeReactivated", null, "#SecondEntryWillLaterBeReactivated"); 54 window.location = "resources/navigate-back.html"; 55 } else if (event.state == "SecondEntryWillLaterBeReactivated") 56 history.back(); 49 50 // FIXME: Once the popstate and hashchange events fire asynchronously, we 51 // can eliminate this setTimeout hack. The hashchange event currently runs 52 // synchronously following the popstate event, but the calls to 53 // replaceState cause the location to change immediately. That confuses 54 // our hashchange handler, which expects to see the "old" value of the 55 // location. 56 57 var state = event.state; 58 setTimeout(function() { 59 if (state == "FirstEntry") { 60 history.replaceState("FirstEntryWillLaterBeReactivated", null, "#FirstEntryWillLaterBeReactivated"); 61 history.forward(); 62 } else if (state == "SecondEntry") { 63 history.replaceState("SecondEntryWillLaterBeReactivated", null, "#SecondEntryWillLaterBeReactivated"); 64 window.location = "resources/navigate-back.html"; 65 } else if (state == "SecondEntryWillLaterBeReactivated") 66 history.back(); 67 }, 0); 57 68 } 58 69 … … 60 71 { 61 72 alert("hashChanged - Last path component of location is " + lastPathComponent()); 62 if (window.location.hash == "#FirstEntryWillLaterBeReactivated") {73 if (window.location.hash == "#FirstEntryWillLaterBeReactivated") { 63 74 alert("Test complete"); 64 75 sessionStorage.clear(); -
trunk/WebCore/ChangeLog
r60606 r60608 1 2010-06-02 Darin Fisher <darin@chromium.org> 2 3 Reviewed by Brady Eidson. 4 5 location.href and outgoing referrer not updated properly by 6 pushState/replaceState 7 https://bugs.webkit.org/show_bug.cgi?id=40027 8 9 Tests: fast/loader/stateobjects/pushstate-updates-location.html 10 fast/loader/stateobjects/replacestate-updates-location.html 11 http/tests/navigation/pushstate-updates-referrer.html 12 http/tests/navigation/replacestate-updates-referrer.html 13 14 * dom/Document.cpp: 15 (WebCore::Document::updateURLForPushOrReplaceState): 16 Update the FrameLoader's notion of the current URL as well! 17 18 * loader/FrameLoader.cpp: 19 (WebCore::FrameLoader::loadInSameDocument): 20 Use the 'url' parameter instead of m_URL since m_URL might have 21 changed during the handling of the PopState event. Eventually, 22 this will become irrelevant since the PopState event should be 23 dispatched asynchronously, but just in case we patch HashChange 24 to be asynchronous before PopState, this change would be needed. 25 1 26 2010-06-02 Eric Seidel <eric@webkit.org> 2 27 -
trunk/WebCore/dom/Document.cpp
r60418 r60608 4657 4657 return; 4658 4658 4659 // FIXME: Eliminate this redundancy. 4659 4660 setURL(url); 4661 f->loader()->setURL(url); 4660 4662 f->loader()->documentLoader()->replaceRequestURLForSameDocumentNavigation(url); 4661 4663 } -
trunk/WebCore/loader/FrameLoader.cpp
r60441 r60608 1694 1694 1695 1695 if (hashChange) { 1696 m_frame->document()->enqueueHashchangeEvent(oldURL, m_URL);1696 m_frame->document()->enqueueHashchangeEvent(oldURL, url); 1697 1697 m_client->dispatchDidChangeLocationWithinPage(); 1698 1698 }
Note: See TracChangeset
for help on using the changeset viewer.