Changeset 53672 in webkit
- Timestamp:
- Jan 21, 2010 8:22:02 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r53657 r53672 1 2010-01-21 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Maciej Stachowiak. 4 5 history.back() for same-document history traversals isn't synchronous as the specification states. 6 <rdar://problem/7535011> and https://bugs.webkit.org/show_bug.cgi?id=33538 7 8 * wtf/Platform.h: Add a "HISTORY_ALWAYS_ASYNC" enable and turn it on for Chromium. 9 1 10 2010-01-21 Geoffrey Garen <ggaren@apple.com> 2 11 -
trunk/JavaScriptCore/wtf/Platform.h
r53579 r53672 459 459 /* PLATFORM(SKIA) for Win/Linux, CG/CI for Mac */ 460 460 #if PLATFORM(CHROMIUM) 461 #define ENABLE_HISTORY_ALWAYS_ASYNC 1 461 462 #if OS(DARWIN) 462 463 #define WTF_PLATFORM_CG 1 -
trunk/LayoutTests/ChangeLog
r53669 r53672 1 2010-01-21 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Maciej Stachowiak. 4 5 history.back() for same-document history traversals isn't synchronous as the specification states. 6 <rdar://problem/7535011> and https://bugs.webkit.org/show_bug.cgi?id=33538 7 8 The change in loading behavior is well covered via modifications to these previous tests: 9 10 * fast/loader/stateobjects/document-destroyed-navigate-back-with-fragment-scroll.html: 11 * fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange-expected.txt: 12 * fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange.html: 13 * fast/loader/stateobjects/state-api-on-detached-frame-crash-expected.txt: 14 * fast/loader/stateobjects/state-api-on-detached-frame-crash.html: 15 1 16 2010-01-21 Kent Tamura <tkent@chromium.org> 2 17 -
trunk/LayoutTests/fast/loader/stateobjects/document-destroyed-navigate-back-with-fragment-scroll.html
r53361 r53672 25 25 { 26 26 alert("Last path component of location is " + lastPathComponent()); 27 history.back();27 setTimeout("history.back();", 0); 28 28 } 29 29 … … 49 49 if (event.state == "FirstEntry") { 50 50 history.replaceState("FirstEntryWillLaterBeReactivated", null, "#FirstEntryWillLaterBeReactivated"); 51 history.forward();51 setTimeout("history.forward();", 0); 52 52 } else if (event.state == "SecondEntry") { 53 53 history.replaceState("SecondEntryWillLaterBeReactivated", null, "#SecondEntryWillLaterBeReactivated"); -
trunk/LayoutTests/fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange-expected.txt
r51653 r53672 3 3 State popped with event null (type object) and last path component some-other.html?withsomeotherquery 4 4 State popped with event null (type object) and last path component some-other.html?withsomeotherquery# 5 Hash change fired 5 Hash change fired and last path component is some-other.html?withsomeotherquery# 6 6 State popped with event null (type object) and last path component some-other.html?withsomeotherquery 7 Hash change fired 7 Hash change fired and last path component is some-other.html?withsomeotherquery 8 8 State popped with event null (type object) and last path component some-other.html?withsomeotherquery#somehash 9 Hash change fired 9 Hash change fired and last path component is some-other.html?withsomeotherquery#somehash 10 10 State popped with event null (type object) and last path component some-other.html?withsomeotherquery#someotherhash 11 Hash change fired 11 Hash change fired and last path component is some-other.html?withsomeotherquery#someotherhash 12 12 State popped with event null (type object) and last path component some-other.html?withquery#someotherhash 13 13 State popped with event null (type object) and last path component some-other.html?withquery# 14 Hash change fired 14 Hash change fired and last path component is some-other.html?withquery# 15 15 State popped with event null (type object) and last path component some-other.html?withquery#somehash 16 Hash change fired 16 Hash change fired and last path component is some-other.html?withquery#somehash 17 17 State popped with event null (type object) and last path component some-other.html?withquery 18 Hash change fired 18 Hash change fired and last path component is some-other.html?withquery 19 19 State popped with event null (type object) and last path component some-other.html?withquery# 20 Hash change fired 20 Hash change fired and last path component is some-other.html?withquery# 21 21 State popped with event null (type object) and last path component some-other.html?withquery 22 Hash change fired 22 Hash change fired and last path component is some-other.html?withquery 23 23 State popped with event null (type object) and last path component some-other.html 24 24 State popped with event null (type object) and last path component pushstate-with-fragment-urls-and-hashchange.html# 25 25 State popped with event null (type object) and last path component pushstate-with-fragment-urls-and-hashchange.html# 26 26 State popped with event null (type object) and last path component pushstate-with-fragment-urls-and-hashchange.html#otherhash 27 Hash change fired 27 Hash change fired and last path component is pushstate-with-fragment-urls-and-hashchange.html#otherhash 28 28 State popped with event null (type object) and last path component pushstate-with-fragment-urls-and-hashchange.html#hash 29 Hash change fired 29 Hash change fired and last path component is pushstate-with-fragment-urls-and-hashchange.html#hash 30 30 State popped with event null (type object) and last path component pushstate-with-fragment-urls-and-hashchange.html# 31 Hash change fired 31 Hash change fired and last path component is pushstate-with-fragment-urls-and-hashchange.html# 32 32 State popped with event null (type object) and last path component pushstate-with-fragment-urls-and-hashchange.html# 33 33 State popped with event OriginalEntry (type string) and last path component pushstate-with-fragment-urls-and-hashchange.html -
trunk/LayoutTests/fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange.html
r51653 r53672 49 49 log("State popped with event " + event.state + " (type " + typeof event.state + ") and last path component " + lastPathComponent()); 50 50 if (event.state != "OriginalEntry") 51 history.back();51 setTimeout("history.back();", 0); 52 52 else if (window.layoutTestController) 53 53 layoutTestController.notifyDone(); … … 56 56 function hashChanged() 57 57 { 58 log("Hash change fired ");58 log("Hash change fired and last path component is " + lastPathComponent()); 59 59 } 60 60 -
trunk/LayoutTests/fast/loader/stateobjects/state-api-on-detached-frame-crash-expected.txt
r53472 r53672 1 If this test doesn't crash, it passed. 1 -
trunk/LayoutTests/fast/loader/stateobjects/state-api-on-detached-frame-crash.html
r53472 r53672 9 9 var ifr = frames[0]; 10 10 document.body.removeChild(document.getElementsByTagName("iframe")[0]) 11 try { 12 ifr.history.replaceState("foo", "bar"); 13 } catch(e) { 14 alert(e); 15 } 16 try { 17 ifr.history.pushState("fu", "barred"); 18 } catch(e) { 19 alert(e); 20 } 11 ifr.history.replaceState("foo", "bar"); 12 ifr.history.pushState("fu", "barred"); 21 13 } 22 14 23 15 </script> 24 16 <body onload="runTest();"> 25 If this test doesn't crash, it passed.26 17 <iframe src="about:blank"> 27 18 </iframe> -
trunk/WebCore/ChangeLog
r53670 r53672 1 2010-01-21 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Maciej Stachowiak. 4 5 history.back() for same-document history traversals isn't synchronous as the specification states. 6 <rdar://problem/7535011> and https://bugs.webkit.org/show_bug.cgi?id=33538 7 8 In resolving https://bugs.webkit.org/show_bug.cgi?id=25570, all history.back()/forward()/go() navigations 9 were made asynchronous. That doesn't agree with the HTML5 spec and might have been overreaching for fixing 10 that particular bug. In working with the new history state APIs I noticed some things that should've been 11 possible were not possible because of this change. 12 13 The change in loading behavior is well covered via modifications to previous tests. 14 15 * loader/RedirectScheduler.cpp: 16 (WebCore::RedirectScheduler::scheduleHistoryNavigation): Determine beforehand if the traversal is 17 a same-document navigation. If it is, perform the load directly instead of scheduling it. 18 1 19 2010-01-21 Jakub Wieczorek <faw217@gmail.com> 2 20 -
trunk/WebCore/loader/RedirectScheduler.cpp
r52033 r53672 33 33 #include "RedirectScheduler.h" 34 34 35 #include "BackForwardList.h" 35 36 #include "DocumentLoader.h" 36 37 #include "Event.h" … … 39 40 #include "FrameLoadRequest.h" 40 41 #include "FrameLoader.h" 42 #include "HistoryItem.h" 41 43 #include "HTMLFormElement.h" 42 44 #include "HTMLFrameOwnerElement.h" … … 266 268 // Invalid history navigations (such as history.forward() during a new load) have the side effect of cancelling any scheduled 267 269 // redirects. We also avoid the possibility of cancelling the current load by avoiding the scheduled redirection altogether. 268 if (!m_frame->page()->canGoBackOrForward(steps)) { 269 cancel(); 270 return; 271 } 272 270 HistoryItem* specifiedEntry = m_frame->page()->backForwardList()->itemAtIndex(steps); 271 if (!specifiedEntry) { 272 cancel(); 273 return; 274 } 275 276 #if !ENABLE(HISTORY_ALWAYS_ASYNC) 277 // If the specified entry and the current entry have the same document, this is either a state object traversal or a fragment 278 // traversal (or both) and should be performed synchronously. 279 HistoryItem* currentEntry = m_frame->loader()->history()->currentItem(); 280 if (currentEntry != specifiedEntry && specifiedEntry->document() && currentEntry->document() == specifiedEntry->document()) { 281 m_frame->loader()->history()->goToItem(specifiedEntry, FrameLoadTypeIndexedBackForward); 282 return; 283 } 284 #endif 285 286 // In all other cases, schedule the history traversal to occur asynchronously. 273 287 schedule(new ScheduledRedirection(steps)); 274 288 }
Note: See TracChangeset
for help on using the changeset viewer.