OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
5 * Copyright (C) 2009 Adam Barth. All rights reserved. | 5 * Copyright (C) 2009 Adam Barth. All rights reserved. |
6 * | 6 * |
7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
9 * are met: | 9 * are met: |
10 * | 10 * |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 schedule(ScheduledRedirect::create(delay, m_frame->document(), url, dela
y <= 1)); | 285 schedule(ScheduledRedirect::create(delay, m_frame->document(), url, dela
y <= 1)); |
286 } | 286 } |
287 | 287 |
288 bool NavigationScheduler::mustLockBackForwardList(LocalFrame* targetFrame) | 288 bool NavigationScheduler::mustLockBackForwardList(LocalFrame* targetFrame) |
289 { | 289 { |
290 // Non-user navigation before the page has finished firing onload should not
create a new back/forward item. | 290 // Non-user navigation before the page has finished firing onload should not
create a new back/forward item. |
291 // See https://webkit.org/b/42861 for the original motivation for this. | 291 // See https://webkit.org/b/42861 for the original motivation for this. |
292 if (!UserGestureIndicator::processingUserGesture() && !targetFrame->document
()->loadEventFinished()) | 292 if (!UserGestureIndicator::processingUserGesture() && !targetFrame->document
()->loadEventFinished()) |
293 return true; | 293 return true; |
294 | 294 |
| 295 // From the HTML5 spec for location.assign(): |
| 296 // "If the browsing context's session history contains only one Document, |
| 297 // and that was the about:blank Document created when the browsing context |
| 298 // was created, then the navigation must be done with replacement enabled.
" |
| 299 if (!targetFrame->loader().stateMachine()->committedMultipleRealLoads() |
| 300 && equalIgnoringCase(targetFrame->document()->url(), blankURL())) |
| 301 return true; |
| 302 |
295 // Navigation of a subframe during loading of an ancestor frame does not cre
ate a new back/forward item. | 303 // Navigation of a subframe during loading of an ancestor frame does not cre
ate a new back/forward item. |
296 // The definition of "during load" is any time before all handlers for the l
oad event have been run. | 304 // The definition of "during load" is any time before all handlers for the l
oad event have been run. |
297 // See https://bugs.webkit.org/show_bug.cgi?id=14957 for the original motiva
tion for this. | 305 // See https://bugs.webkit.org/show_bug.cgi?id=14957 for the original motiva
tion for this. |
298 Frame* parentFrame = targetFrame->tree().parent(); | 306 Frame* parentFrame = targetFrame->tree().parent(); |
299 return parentFrame && parentFrame->isLocalFrame() && !toLocalFrame(parentFra
me)->loader().allAncestorsAreComplete(); | 307 return parentFrame && parentFrame->isLocalFrame() && !toLocalFrame(parentFra
me)->loader().allAncestorsAreComplete(); |
300 } | 308 } |
301 | 309 |
302 void NavigationScheduler::scheduleLocationChange(Document* originDocument, const
String& url, bool lockBackForwardList) | 310 void NavigationScheduler::scheduleLocationChange(Document* originDocument, const
String& url, bool lockBackForwardList) |
303 { | 311 { |
304 if (!shouldScheduleNavigation(url)) | 312 if (!shouldScheduleNavigation(url)) |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 m_redirect.clear(); | 416 m_redirect.clear(); |
409 } | 417 } |
410 | 418 |
411 DEFINE_TRACE(NavigationScheduler) | 419 DEFINE_TRACE(NavigationScheduler) |
412 { | 420 { |
413 visitor->trace(m_frame); | 421 visitor->trace(m_frame); |
414 visitor->trace(m_redirect); | 422 visitor->trace(m_redirect); |
415 } | 423 } |
416 | 424 |
417 } // namespace blink | 425 } // namespace blink |
OLD | NEW |