From 798ee804808a9f9fd3566b66752b9e0baf447ab6 Mon Sep 17 00:00:00 2001 From: Elliott Sprehn Date: Wed, 17 Dec 2014 16:05:15 -0800 Subject: [PATCH] Implement Node.ownerScope The ownerScope property is equivalent to walking up the parentNode pointers until you hit the top and returning that node if it's a Document or ShadowRoot. This means that the ownerScope of ShadowRoot and Document is always itself, and the ownerScope of an Element that is not the descendant of a ShadowRoot, and is not in the document is null. R=eseidel@chromium.org Review URL: https://codereview.chromium.org/810793005 --- .../flutter/tests/dom/ownerScope-expected.txt | 9 ++++ engine/src/flutter/tests/dom/ownerScope.sky | 47 +++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 engine/src/flutter/tests/dom/ownerScope-expected.txt create mode 100644 engine/src/flutter/tests/dom/ownerScope.sky diff --git a/engine/src/flutter/tests/dom/ownerScope-expected.txt b/engine/src/flutter/tests/dom/ownerScope-expected.txt new file mode 100644 index 0000000000..674fbda8b8 --- /dev/null +++ b/engine/src/flutter/tests/dom/ownerScope-expected.txt @@ -0,0 +1,9 @@ +Running 5 tests +ok 1 ownerScope should return null for elements not a child of a scope +ok 2 ownerScope should return the document for elements in the document scope +ok 3 ownerScope should return the shadow root for elements in the shadow root scope +ok 4 ownerScope should return self for a shadow root or document +ok 5 ownerScope should dynamically update +5 tests +5 pass +0 fail diff --git a/engine/src/flutter/tests/dom/ownerScope.sky b/engine/src/flutter/tests/dom/ownerScope.sky new file mode 100644 index 0000000000..5eb7a8ec96 --- /dev/null +++ b/engine/src/flutter/tests/dom/ownerScope.sky @@ -0,0 +1,47 @@ + + + + + \ No newline at end of file