Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Side by Side Diff: Source/core/loader/NavigationScheduler.cpp

Issue 1173513002: Fix Blink commit type for subframes after initial about:blank load. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Try removing Nasko's original fix Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
303 // Navigation of a subframe during loading of an ancestor frame does not cre ate a new back/forward item. 295 // Navigation of a subframe during loading of an ancestor frame does not cre ate a new back/forward item.
304 // The definition of "during load" is any time before all handlers for the l oad event have been run. 296 // The definition of "during load" is any time before all handlers for the l oad event have been run.
305 // See https://bugs.webkit.org/show_bug.cgi?id=14957 for the original motiva tion for this. 297 // See https://bugs.webkit.org/show_bug.cgi?id=14957 for the original motiva tion for this.
306 Frame* parentFrame = targetFrame->tree().parent(); 298 Frame* parentFrame = targetFrame->tree().parent();
307 return parentFrame && parentFrame->isLocalFrame() && !toLocalFrame(parentFra me)->loader().allAncestorsAreComplete(); 299 return parentFrame && parentFrame->isLocalFrame() && !toLocalFrame(parentFra me)->loader().allAncestorsAreComplete();
308 } 300 }
309 301
310 void NavigationScheduler::scheduleLocationChange(Document* originDocument, const String& url, bool lockBackForwardList) 302 void NavigationScheduler::scheduleLocationChange(Document* originDocument, const String& url, bool lockBackForwardList)
311 { 303 {
312 if (!shouldScheduleNavigation(url)) 304 if (!shouldScheduleNavigation(url))
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 m_redirect.clear(); 408 m_redirect.clear();
417 } 409 }
418 410
419 DEFINE_TRACE(NavigationScheduler) 411 DEFINE_TRACE(NavigationScheduler)
420 { 412 {
421 visitor->trace(m_frame); 413 visitor->trace(m_frame);
422 visitor->trace(m_redirect); 414 visitor->trace(m_redirect);
423 } 415 }
424 416
425 } // namespace blink 417 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698