OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |