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

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

Issue 14852011: Implement document.currentScript (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 years, 6 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
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 8f398d2b65263971dc690572d63b144481cea209..bc827e935ed966e8c3ff5d55d85d4bbf183eedde 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -128,6 +128,7 @@
#include "core/html/HTMLLinkElement.h"
#include "core/html/HTMLMapElement.h"
#include "core/html/HTMLNameCollection.h"
+#include "core/html/HTMLScriptElement.h"
#include "core/html/HTMLStyleElement.h"
#include "core/html/HTMLTitleElement.h"
#include "core/html/PluginDocument.h"
@@ -3932,6 +3933,18 @@ KURL Document::openSearchDescriptionURL()
return KURL();
}
+void Document::pushCurrentScript(PassRefPtr<HTMLScriptElement> newCurrentScript)
+{
+ ASSERT(newCurrentScript);
+ m_currentScriptStack.append(newCurrentScript);
+}
+
+void Document::popCurrentScript()
+{
+ ASSERT(!m_currentScriptStack.isEmpty());
+ m_currentScriptStack.removeLast();
+}
+
void Document::applyXSLTransform(ProcessingInstruction* pi)
{
UseCounter::count(this, UseCounter::XSLProcessingInstruction);

Powered by Google App Engine
This is Rietveld 408576698