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

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

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.h
diff --git a/Source/core/dom/Document.h b/Source/core/dom/Document.h
index c1641cc21ddfa0ffcb60910dc7ea47c582068a51..355ed97a91f1372eefa8b811b069280f4ebad88e 100644
--- a/Source/core/dom/Document.h
+++ b/Source/core/dom/Document.h
@@ -108,6 +108,7 @@ class HTMLImportsController;
class HTMLIFrameElement;
class HTMLMapElement;
class HTMLNameCollection;
+class HTMLScriptElement;
class HitTestRequest;
class HitTestResult;
class IntPoint;
@@ -850,6 +851,10 @@ public:
ScriptRunner* scriptRunner() { return m_scriptRunner.get(); }
+ HTMLScriptElement* currentScript() const { return !m_currentScriptStack.isEmpty() ? m_currentScriptStack.last().get() : 0; }
+ void pushCurrentScript(PassRefPtr<HTMLScriptElement>);
+ void popCurrentScript();
+
void applyXSLTransform(ProcessingInstruction* pi);
PassRefPtr<Document> transformSourceDocument() { return m_transformSourceDocument; }
void setTransformSourceDocument(Document* doc) { m_transformSourceDocument = doc; }
@@ -1314,6 +1319,8 @@ private:
OwnPtr<ScriptRunner> m_scriptRunner;
+ Vector<RefPtr<HTMLScriptElement> > m_currentScriptStack;
+
OwnPtr<TransformSource> m_transformSource;
RefPtr<Document> m_transformSourceDocument;

Powered by Google App Engine
This is Rietveld 408576698