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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLScriptElement.cpp

Issue 2821803002: Introduce ScriptLoader::script_type_ (Closed)
Patch Set: Add missing include 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
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 * 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 setAttribute(nonceAttr, 97 setAttribute(nonceAttr,
98 ContentSecurityPolicy::GetNonceReplacementString()); 98 ContentSecurityPolicy::GetNonceReplacementString());
99 } 99 }
100 } else { 100 } else {
101 HTMLElement::ParseAttribute(params); 101 HTMLElement::ParseAttribute(params);
102 } 102 }
103 } 103 }
104 104
105 Node::InsertionNotificationRequest HTMLScriptElement::InsertedInto( 105 Node::InsertionNotificationRequest HTMLScriptElement::InsertedInto(
106 ContainerNode* insertion_point) { 106 ContainerNode* insertion_point) {
107 ScriptType script_type = ScriptType::kClassic;
107 if (insertion_point->isConnected() && HasSourceAttribute() && 108 if (insertion_point->isConnected() && HasSourceAttribute() &&
108 !Loader()->IsScriptTypeSupported( 109 !Loader()->IsScriptTypeSupported(
109 ScriptLoader::kDisallowLegacyTypeInTypeAttribute)) 110 ScriptLoader::kDisallowLegacyTypeInTypeAttribute, script_type))
110 UseCounter::Count(GetDocument(), 111 UseCounter::Count(GetDocument(),
111 UseCounter::kScriptElementWithInvalidTypeHasSrc); 112 UseCounter::kScriptElementWithInvalidTypeHasSrc);
112 HTMLElement::InsertedInto(insertion_point); 113 HTMLElement::InsertedInto(insertion_point);
113 LogAddElementIfIsolatedWorldAndInDocument("script", srcAttr); 114 LogAddElementIfIsolatedWorldAndInDocument("script", srcAttr);
114 return kInsertionShouldCallDidNotifySubtreeInsertions; 115 return kInsertionShouldCallDidNotifySubtreeInsertions;
115 } 116 }
116 117
117 void HTMLScriptElement::DidNotifySubtreeInsertionsToDocument() { 118 void HTMLScriptElement::DidNotifySubtreeInsertionsToDocument() {
118 loader_->DidNotifySubtreeInsertionsToDocument(); 119 loader_->DidNotifySubtreeInsertionsToDocument();
119 } 120 }
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 return new HTMLScriptElement(GetDocument(), false, loader_->AlreadyStarted(), 235 return new HTMLScriptElement(GetDocument(), false, loader_->AlreadyStarted(),
235 false); 236 false);
236 } 237 }
237 238
238 DEFINE_TRACE(HTMLScriptElement) { 239 DEFINE_TRACE(HTMLScriptElement) {
239 HTMLElement::Trace(visitor); 240 HTMLElement::Trace(visitor);
240 ScriptElementBase::Trace(visitor); 241 ScriptElementBase::Trace(visitor);
241 } 242 }
242 243
243 } // namespace blink 244 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ScriptLoader.cpp ('k') | third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698