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

Side by Side Diff: Source/core/dom/Document.cpp

Issue 17682003: Do not fire load events from frames with scripting disabled (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Do not send events for detached documents Created 7 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fast/images/image-load-event-crash-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 2257 matching lines...) Expand 10 before | Expand all | Expand 10 after
2268 m_wellFormed = parser && parser->wellFormed(); 2268 m_wellFormed = parser && parser->wellFormed();
2269 2269
2270 // We have to clear the parser, in case someone document.write()s from the 2270 // We have to clear the parser, in case someone document.write()s from the
2271 // onLoad event handler, as in Radar 3206524. 2271 // onLoad event handler, as in Radar 3206524.
2272 detachParser(); 2272 detachParser();
2273 2273
2274 Frame* f = frame(); 2274 Frame* f = frame();
2275 if (f) 2275 if (f)
2276 f->animation()->resumeAnimationsForDocument(this); 2276 f->animation()->resumeAnimationsForDocument(this);
2277 2277
2278 ImageLoader::dispatchPendingBeforeLoadEvents(); 2278 if (f && f->script()->canExecuteScripts(NotAboutToExecuteScript)) {
2279 ImageLoader::dispatchPendingLoadEvents(); 2279 ImageLoader::dispatchPendingBeforeLoadEvents();
2280 ImageLoader::dispatchPendingErrorEvents(); 2280 ImageLoader::dispatchPendingLoadEvents();
2281 ImageLoader::dispatchPendingErrorEvents();
2281 2282
2282 HTMLLinkElement::dispatchPendingLoadEvents(); 2283 HTMLLinkElement::dispatchPendingLoadEvents();
2283 HTMLStyleElement::dispatchPendingLoadEvents(); 2284 HTMLStyleElement::dispatchPendingLoadEvents();
2285 }
2284 2286
2285 // To align the HTML load event and the SVGLoad event for the outermost <svg > element, fire it from 2287 // To align the HTML load event and the SVGLoad event for the outermost <svg > element, fire it from
2286 // here, instead of doing it from SVGElement::finishedParsingChildren (if ex ternalResourcesRequired="false", 2288 // here, instead of doing it from SVGElement::finishedParsingChildren (if ex ternalResourcesRequired="false",
2287 // which is the default, for ='true' its fired at a later time, once all ext ernal resources finished loading). 2289 // which is the default, for ='true' its fired at a later time, once all ext ernal resources finished loading).
2288 if (svgExtensions()) 2290 if (svgExtensions())
2289 accessSVGExtensions()->dispatchSVGLoadEventToOutermostSVGElements(); 2291 accessSVGExtensions()->dispatchSVGLoadEventToOutermostSVGElements();
2290 2292
2291 dispatchWindowLoadEvent(); 2293 dispatchWindowLoadEvent();
2292 enqueuePageshowEvent(PageshowEventNotPersisted); 2294 enqueuePageshowEvent(PageshowEventNotPersisted);
2293 enqueuePopstateEvent(m_pendingStateObject ? m_pendingStateObject.release() : SerializedScriptValue::nullValue()); 2295 enqueuePopstateEvent(m_pendingStateObject ? m_pendingStateObject.release() : SerializedScriptValue::nullValue());
(...skipping 2913 matching lines...) Expand 10 before | Expand all | Expand 10 after
5207 { 5209 {
5208 return DocumentLifecycleNotifier::create(this); 5210 return DocumentLifecycleNotifier::create(this);
5209 } 5211 }
5210 5212
5211 DocumentLifecycleNotifier* Document::lifecycleNotifier() 5213 DocumentLifecycleNotifier* Document::lifecycleNotifier()
5212 { 5214 {
5213 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier()); 5215 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier());
5214 } 5216 }
5215 5217
5216 } // namespace WebCore 5218 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/images/image-load-event-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698