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

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

Issue 205523003: Remove beforeload events. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove more tests Created 6 years, 9 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 | « Source/core/dom/ProcessingInstruction.cpp ('k') | Source/core/events/BeforeLoadEvent.h » ('j') | 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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed.
6 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> 6 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org>
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 } 243 }
244 244
245 return true; 245 return true;
246 } 246 }
247 247
248 bool ScriptLoader::fetchScript(const String& sourceUrl) 248 bool ScriptLoader::fetchScript(const String& sourceUrl)
249 { 249 {
250 ASSERT(m_element); 250 ASSERT(m_element);
251 251
252 RefPtr<Document> elementDocument(m_element->document()); 252 RefPtr<Document> elementDocument(m_element->document());
253 if (!m_element->dispatchBeforeLoadEvent(sourceUrl))
254 return false;
255 if (!m_element->inDocument() || m_element->document() != elementDocument) 253 if (!m_element->inDocument() || m_element->document() != elementDocument)
256 return false; 254 return false;
257 255
258 ASSERT(!m_resource); 256 ASSERT(!m_resource);
259 if (!stripLeadingAndTrailingHTMLSpaces(sourceUrl).isEmpty()) { 257 if (!stripLeadingAndTrailingHTMLSpaces(sourceUrl).isEmpty()) {
260 FetchRequest request(ResourceRequest(elementDocument->completeURL(source Url)), m_element->localName()); 258 FetchRequest request(ResourceRequest(elementDocument->completeURL(source Url)), m_element->localName());
261 259
262 AtomicString crossOriginMode = m_element->fastGetAttribute(HTMLNames::cr ossoriginAttr); 260 AtomicString crossOriginMode = m_element->fastGetAttribute(HTMLNames::cr ossoriginAttr);
263 if (!crossOriginMode.isNull()) 261 if (!crossOriginMode.isNull())
264 request.setCrossOriginAccessControl(elementDocument->securityOrigin( ), crossOriginMode); 262 request.setCrossOriginAccessControl(elementDocument->securityOrigin( ), crossOriginMode);
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 if (isHTMLScriptLoader(element)) 435 if (isHTMLScriptLoader(element))
438 return toHTMLScriptElement(element)->loader(); 436 return toHTMLScriptElement(element)->loader();
439 437
440 if (isSVGScriptLoader(element)) 438 if (isSVGScriptLoader(element))
441 return toSVGScriptElement(element)->loader(); 439 return toSVGScriptElement(element)->loader();
442 440
443 return 0; 441 return 0;
444 } 442 }
445 443
446 } 444 }
OLDNEW
« no previous file with comments | « Source/core/dom/ProcessingInstruction.cpp ('k') | Source/core/events/BeforeLoadEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698