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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 | 249 |
250 // We have to return fetchedResource instead of let callers ask ScriptLoader
::resource() | 250 // We have to return fetchedResource instead of let callers ask ScriptLoader
::resource() |
251 // because resource() can be null when it is accessed: Following setResource
() can trigger clearResource(). | 251 // because resource() can be null when it is accessed: Following setResource
() can trigger clearResource(). |
252 return ScriptPrep(true, resource); | 252 return ScriptPrep(true, resource); |
253 } | 253 } |
254 | 254 |
255 ResourcePtr<ScriptResource> ScriptLoader::fetchScript(const String& sourceUrl) | 255 ResourcePtr<ScriptResource> ScriptLoader::fetchScript(const String& sourceUrl) |
256 { | 256 { |
257 ASSERT(m_element); | 257 ASSERT(m_element); |
258 | 258 |
259 RefPtr<Document> elementDocument(m_element->document()); | 259 RefPtrWillBeRawPtr<Document> elementDocument(m_element->document()); |
260 if (!m_element->inDocument() || m_element->document() != elementDocument) | 260 if (!m_element->inDocument() || m_element->document() != elementDocument) |
261 return ResourcePtr<ScriptResource>(); | 261 return ResourcePtr<ScriptResource>(); |
262 | 262 |
263 ASSERT(!resource()); | 263 ASSERT(!resource()); |
264 ResourcePtr<ScriptResource> resource; | 264 ResourcePtr<ScriptResource> resource; |
265 if (!stripLeadingAndTrailingHTMLSpaces(sourceUrl).isEmpty()) { | 265 if (!stripLeadingAndTrailingHTMLSpaces(sourceUrl).isEmpty()) { |
266 FetchRequest request(ResourceRequest(elementDocument->completeURL(source
Url)), m_element->localName()); | 266 FetchRequest request(ResourceRequest(elementDocument->completeURL(source
Url)), m_element->localName()); |
267 | 267 |
268 AtomicString crossOriginMode = m_element->fastGetAttribute(HTMLNames::cr
ossoriginAttr); | 268 AtomicString crossOriginMode = m_element->fastGetAttribute(HTMLNames::cr
ossoriginAttr); |
269 if (!crossOriginMode.isNull()) | 269 if (!crossOriginMode.isNull()) |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 if (isHTMLScriptLoader(element)) | 449 if (isHTMLScriptLoader(element)) |
450 return toHTMLScriptElement(element)->loader(); | 450 return toHTMLScriptElement(element)->loader(); |
451 | 451 |
452 if (isSVGScriptLoader(element)) | 452 if (isSVGScriptLoader(element)) |
453 return toSVGScriptElement(element)->loader(); | 453 return toSVGScriptElement(element)->loader(); |
454 | 454 |
455 return 0; | 455 return 0; |
456 } | 456 } |
457 | 457 |
458 } | 458 } |
OLD | NEW |