| Index: Source/core/page/FrameTree.cpp
|
| diff --git a/Source/core/page/FrameTree.cpp b/Source/core/page/FrameTree.cpp
|
| index 3c73ba1ff8529189d166609c663e38058ae67847..27677ce7cfd7db35886482923a4b133276633619 100644
|
| --- a/Source/core/page/FrameTree.cpp
|
| +++ b/Source/core/page/FrameTree.cpp
|
| @@ -172,25 +172,12 @@ AtomicString FrameTree::uniqueChildName(const AtomicString& requestedName) const
|
|
|
| Frame* FrameTree::scopedChild(unsigned index) const
|
| {
|
| - // TODO(dcheng, alexmos): Currently, all children of a RemoteFrame are
|
| - // visible, even through a shadow DOM scope. Once RemoteFrames have a
|
| - // TreeScope, it should be used here.
|
| - TreeScope* scope = nullptr;
|
| - if (m_thisFrame->isLocalFrame()) {
|
| - scope = toLocalFrame(m_thisFrame)->document();
|
| - if (!scope)
|
| - return nullptr;
|
| - }
|
| -
|
| unsigned scopedIndex = 0;
|
| - for (Frame* result = firstChild(); result; result = result->tree().nextSibling()) {
|
| - // TODO(dcheng, alexmos): Currently, RemoteFrames are always visible,
|
| - // even through a shadow DOM scope. Once RemoteFrames have a TreeScope,
|
| - // the scoping check should apply to RemoteFrames too.
|
| - if (scope && result->isLocalFrame() && !toLocalFrame(result)->inScope(scope))
|
| + for (Frame* child = firstChild(); child; child = child->tree().nextSibling()) {
|
| + if (child->client()->inShadowTree())
|
| continue;
|
| if (scopedIndex == index)
|
| - return result;
|
| + return child;
|
| scopedIndex++;
|
| }
|
|
|
| @@ -199,35 +186,20 @@ Frame* FrameTree::scopedChild(unsigned index) const
|
|
|
| Frame* FrameTree::scopedChild(const AtomicString& name) const
|
| {
|
| - // TODO(dcheng, alexmos): Currently, all children of a RemoteFrame are
|
| - // visible, even through a shadow DOM scope. Once RemoteFrames have a
|
| - // TreeScope, it should be used here.
|
| - TreeScope* scope = nullptr;
|
| - if (m_thisFrame->isLocalFrame()) {
|
| - scope = toLocalFrame(m_thisFrame)->document();
|
| - if (!scope)
|
| - return nullptr;
|
| - }
|
| -
|
| - for (Frame* child = firstChild(); child; child = child->tree().nextSibling())
|
| - // TODO(dcheng, alexmos): Currently, RemoteFrames are always visible,
|
| - // even through a shadow DOM scope. Once RemoteFrames have a TreeScope,
|
| - // the scoping check should apply to RemoteFrames too.
|
| - if (child->tree().name() == name && (!scope || !child->isLocalFrame() || toLocalFrame(child)->inScope(scope)))
|
| + for (Frame* child = firstChild(); child; child = child->tree().nextSibling()) {
|
| + if (child->client()->inShadowTree())
|
| + continue;
|
| + if (child->tree().name() == name)
|
| return child;
|
| + }
|
| return nullptr;
|
| }
|
|
|
| inline unsigned FrameTree::scopedChildCount(TreeScope* scope) const
|
| {
|
| - // TODO(dcheng, alexmos): Once RemoteFrames have a TreeScope, this should
|
| - // return 0 if there is no scope.
|
| -
|
| unsigned scopedCount = 0;
|
| - for (Frame* result = firstChild(); result; result = result->tree().nextSibling()) {
|
| - // FIXME: Currently, RemoteFrames are always visible, even through a shadow DOM scope.
|
| - // Once RemoteFrames have a TreeScope, the scoping check should apply to RemoteFrames too.
|
| - if (scope && result->isLocalFrame() && !toLocalFrame(result)->inScope(scope))
|
| + for (Frame* child = firstChild(); child; child = child->tree().nextSibling()) {
|
| + if (child->client()->inShadowTree())
|
| continue;
|
| scopedCount++;
|
| }
|
|
|