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

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

Issue 2818893002: Strip leading/trailing whitespaces from script URLs in ScriptLoader (Closed)
Patch Set: Rebase Created 3 years, 8 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
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/local/absolute-url-strip-whitespace-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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights
6 * reserved. 6 * reserved.
7 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> 7 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org>
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 // TODO(hiroshige): Make this asynchronous. Currently we fire the error 337 // TODO(hiroshige): Make this asynchronous. Currently we fire the error
338 // event synchronously to keep the existing behavior. 338 // event synchronously to keep the existing behavior.
339 DispatchErrorEvent(); 339 DispatchErrorEvent();
340 return false; 340 return false;
341 } 341 }
342 342
343 // 21.3. "Set the element's from an external file flag." 343 // 21.3. "Set the element's from an external file flag."
344 is_external_script_ = true; 344 is_external_script_ = true;
345 345
346 // 21.4. "Parse src relative to the element's node document." 346 // 21.4. "Parse src relative to the element's node document."
347 // TODO(hiroshige): Use CompleteURL(src) instead. 347 KURL url = element_document.CompleteURL(src);
348 KURL url = element_document.CompleteURL(element_->SourceAttributeValue());
349 348
350 // 21.5. "If the previous step failed, queue a task to 349 // 21.5. "If the previous step failed, queue a task to
351 // fire an event named error at the element, and abort these steps." 350 // fire an event named error at the element, and abort these steps."
352 if (!url.IsValid()) { 351 if (!url.IsValid()) {
353 // TODO(hiroshige): Make this asynchronous. Currently we fire the error 352 // TODO(hiroshige): Make this asynchronous. Currently we fire the error
354 // event synchronously to keep the existing behavior. 353 // event synchronously to keep the existing behavior.
355 DispatchErrorEvent(); 354 DispatchErrorEvent();
356 return false; 355 return false;
357 } 356 }
358 357
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 // then abort these steps at this point. The script is not executed. 851 // then abort these steps at this point. The script is not executed.
853 return DeprecatedEqualIgnoringCase(event_attribute, "onload") || 852 return DeprecatedEqualIgnoringCase(event_attribute, "onload") ||
854 DeprecatedEqualIgnoringCase(event_attribute, "onload()"); 853 DeprecatedEqualIgnoringCase(event_attribute, "onload()");
855 } 854 }
856 855
857 String ScriptLoader::ScriptContent() const { 856 String ScriptLoader::ScriptContent() const {
858 return element_->TextFromChildren(); 857 return element_->TextFromChildren();
859 } 858 }
860 859
861 } // namespace blink 860 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/local/absolute-url-strip-whitespace-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698