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

Unified Diff: sky/engine/core/dom/Node.cpp

Issue 810793005: Implement Node.ownerScope (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Update to spec. Created 6 years 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 | « sky/engine/core/dom/Node.h ('k') | sky/engine/core/dom/Node.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/Node.cpp
diff --git a/sky/engine/core/dom/Node.cpp b/sky/engine/core/dom/Node.cpp
index 982ffbc356e8bc137f1a252e8e922257ab396c17..60c5f1927bea8fbcc9d779ccf31396bd66807367 100644
--- a/sky/engine/core/dom/Node.cpp
+++ b/sky/engine/core/dom/Node.cpp
@@ -897,6 +897,15 @@ Document* Node::ownerDocument() const
return doc == this ? 0 : doc;
}
+ContainerNode* Node::ownerScope() const
+{
+ if (inDocument())
+ return &treeScope().rootNode();
+ if (ShadowRoot* root = containingShadowRoot())
+ return root;
+ return 0;
+}
+
static void appendTextContent(const Node* node, bool convertBRsToNewlines, StringBuilder& content)
{
if (node->nodeType() == Node::TEXT_NODE) {
« no previous file with comments | « sky/engine/core/dom/Node.h ('k') | sky/engine/core/dom/Node.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698