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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2723793002: De-Element ScriptLoader (Closed)
Patch Set: ScriptLoaderClient->ScriptElementBase, pure virtual interface, add fixme Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/dom/Element.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index e184fe385333a69833f7ddf0a12bd685793567e7..f3e93163d68edc0f2ac124e6c5caac9e93df1a25 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -5130,24 +5130,17 @@ KURL Document::openSearchDescriptionURL() {
void Document::currentScriptForBinding(
HTMLScriptElementOrSVGScriptElement& scriptElement) const {
- if (Element* script = currentScript()) {
- if (script->isInV1ShadowTree())
- return;
- if (isHTMLScriptElement(script))
- scriptElement.setHTMLScriptElement(toHTMLScriptElement(script));
- else if (isSVGScriptElement(script))
- scriptElement.setSVGScriptElement(toSVGScriptElement(script));
- }
+ if (!m_currentScriptStack.isEmpty())
+ m_currentScriptStack.back()->setScriptElementForBinding(scriptElement);
}
-void Document::pushCurrentScript(Element* newCurrentScript) {
- DCHECK(isHTMLScriptElement(newCurrentScript) ||
- isSVGScriptElement(newCurrentScript));
+void Document::pushCurrentScript(ScriptElementBase* newCurrentScript) {
m_currentScriptStack.push_back(newCurrentScript);
}
-void Document::popCurrentScript() {
+void Document::popCurrentScript(ScriptElementBase* script) {
DCHECK(!m_currentScriptStack.isEmpty());
+ DCHECK_EQ(m_currentScriptStack.back(), script);
m_currentScriptStack.pop_back();
}
@@ -5679,20 +5672,6 @@ bool Document::allowInlineEventHandler(Node* node,
return true;
}
-bool Document::allowExecutingScripts(Node* node) {
- // FIXME: Eventually we'd like to evaluate scripts which are inserted into a
- // viewless document but this'll do for now.
- // See http://bugs.webkit.org/show_bug.cgi?id=5727
- LocalFrame* frame = executingFrame();
- if (!frame)
- return false;
- if (!node->document().executingFrame())
- return false;
- if (!canExecuteScripts(AboutToExecuteScript))
- return false;
- return true;
-}
-
void Document::enforceSandboxFlags(SandboxFlags mask) {
RefPtr<SecurityOrigin> standInOrigin = getSecurityOrigin();
applySandboxFlags(mask);
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698