| 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 | 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 15 matching lines...) Expand all Loading... |
| 26 #include "bindings/core/v8/ExceptionState.h" | 26 #include "bindings/core/v8/ExceptionState.h" |
| 27 #include "bindings/core/v8/ScriptEventListener.h" | 27 #include "bindings/core/v8/ScriptEventListener.h" |
| 28 #include "core/HTMLNames.h" | 28 #include "core/HTMLNames.h" |
| 29 #include "core/dom/Attribute.h" | 29 #include "core/dom/Attribute.h" |
| 30 #include "core/dom/Document.h" | 30 #include "core/dom/Document.h" |
| 31 #include "core/dom/ScriptLoader.h" | 31 #include "core/dom/ScriptLoader.h" |
| 32 #include "core/dom/ScriptRunner.h" | 32 #include "core/dom/ScriptRunner.h" |
| 33 #include "core/dom/Text.h" | 33 #include "core/dom/Text.h" |
| 34 #include "core/events/Event.h" | 34 #include "core/events/Event.h" |
| 35 #include "core/frame/UseCounter.h" | 35 #include "core/frame/UseCounter.h" |
| 36 #include "core/frame/csp/ContentSecurityPolicy.h" |
| 36 | 37 |
| 37 namespace blink { | 38 namespace blink { |
| 38 | 39 |
| 39 using namespace HTMLNames; | 40 using namespace HTMLNames; |
| 40 | 41 |
| 41 inline HTMLScriptElement::HTMLScriptElement(Document& document, | 42 inline HTMLScriptElement::HTMLScriptElement(Document& document, |
| 42 bool wasInsertedByParser, | 43 bool wasInsertedByParser, |
| 43 bool alreadyStarted, | 44 bool alreadyStarted, |
| 44 bool createdDuringDocumentWrite) | 45 bool createdDuringDocumentWrite) |
| 45 : HTMLElement(scriptTag, document), | 46 : HTMLElement(scriptTag, document), |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 HTMLElement::didMoveToNewDocument(oldDocument); | 80 HTMLElement::didMoveToNewDocument(oldDocument); |
| 80 } | 81 } |
| 81 | 82 |
| 82 void HTMLScriptElement::parseAttribute( | 83 void HTMLScriptElement::parseAttribute( |
| 83 const AttributeModificationParams& params) { | 84 const AttributeModificationParams& params) { |
| 84 if (params.name == srcAttr) { | 85 if (params.name == srcAttr) { |
| 85 m_loader->handleSourceAttribute(params.newValue); | 86 m_loader->handleSourceAttribute(params.newValue); |
| 86 logUpdateAttributeIfIsolatedWorldAndInDocument("script", params); | 87 logUpdateAttributeIfIsolatedWorldAndInDocument("script", params); |
| 87 } else if (params.name == asyncAttr) { | 88 } else if (params.name == asyncAttr) { |
| 88 m_loader->handleAsyncAttribute(); | 89 m_loader->handleAsyncAttribute(); |
| 90 } else if (params.name == nonceAttr) { |
| 91 if (params.newValue == ContentSecurityPolicy::getNonceReplacementString()) |
| 92 return; |
| 93 m_nonce = params.newValue; |
| 94 if (RuntimeEnabledFeatures::hideNonceContentAttributeEnabled()) { |
| 95 setAttribute(nonceAttr, |
| 96 ContentSecurityPolicy::getNonceReplacementString()); |
| 97 } |
| 89 } else { | 98 } else { |
| 90 HTMLElement::parseAttribute(params); | 99 HTMLElement::parseAttribute(params); |
| 91 } | 100 } |
| 92 } | 101 } |
| 93 | 102 |
| 94 Node::InsertionNotificationRequest HTMLScriptElement::insertedInto( | 103 Node::InsertionNotificationRequest HTMLScriptElement::insertedInto( |
| 95 ContainerNode* insertionPoint) { | 104 ContainerNode* insertionPoint) { |
| 96 if (insertionPoint->isConnected() && hasSourceAttribute() && | 105 if (insertionPoint->isConnected() && hasSourceAttribute() && |
| 97 !loader()->isScriptTypeSupported( | 106 !loader()->isScriptTypeSupported( |
| 98 ScriptLoader::DisallowLegacyTypeInTypeAttribute)) | 107 ScriptLoader::DisallowLegacyTypeInTypeAttribute)) |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 return new HTMLScriptElement(document(), false, m_loader->alreadyStarted(), | 178 return new HTMLScriptElement(document(), false, m_loader->alreadyStarted(), |
| 170 false); | 179 false); |
| 171 } | 180 } |
| 172 | 181 |
| 173 DEFINE_TRACE(HTMLScriptElement) { | 182 DEFINE_TRACE(HTMLScriptElement) { |
| 174 visitor->trace(m_loader); | 183 visitor->trace(m_loader); |
| 175 HTMLElement::trace(visitor); | 184 HTMLElement::trace(visitor); |
| 176 } | 185 } |
| 177 | 186 |
| 178 } // namespace blink | 187 } // namespace blink |
| OLD | NEW |