Chromium Code Reviews| Index: Source/core/dom/TreeScope.cpp |
| diff --git a/Source/core/dom/TreeScope.cpp b/Source/core/dom/TreeScope.cpp |
| index db2a3ff0423d21eaf875b7b04f16548be9430d22..851371f61216066a8aed70f5fc1f914e9c05d7b7 100644 |
| --- a/Source/core/dom/TreeScope.cpp |
| +++ b/Source/core/dom/TreeScope.cpp |
| @@ -441,4 +441,14 @@ int TreeScope::refCount() const |
| return 0; |
| } |
| +bool TreeScope::isInclusiveAncestorOf(const TreeScope* scope) const |
| +{ |
| + ASSERT(scope); |
| + for (; scope; scope = scope->parentTreeScope()) { |
| + if (scope == this) |
| + return true; |
| + } |
| + return false; |
| +} |
| + |
| } // namespace WebCore |