ComposedShadowTreeWalker shouldn't be exposed to non-ShadowDOM classes
authormorrita@google.com <morrita@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Jan 2013 17:44:05 +0000 (17:44 +0000)
committermorrita@google.com <morrita@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Jan 2013 17:44:05 +0000 (17:44 +0000)
commitb543acf5af8ff0ec3ec65cfe3185a6b2584ec09a
treed6ccd801e524f14dfdc3d8a7d3c96db37d018fde
parentc4a1438cb11075510321379e79781fd174ec4186
ComposedShadowTreeWalker shouldn't be exposed to non-ShadowDOM classes
https://bugs.webkit.org/show_bug.cgi?id=106505

Reviewed by Dimitri Glazkov.

This change hides ComposedShadowTreeWalker from non-ShadowDOM classes by

- introducing thin wrapper functions on NodeRenderingTraversal and relacing
  CSTW callsites with it,
- replacing ComposedShadowTreeWalker usage with AncestorChainWalker if possible and
- moving AncestorChainWalker to its own file and including it on files
  which needs only AncestorChainWalker. This eliminates ComposedShadowTreeWalker.h inclusions.

No new tests. No behavior change.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.xcodeproj/project.pbxproj:
* dom/AncestorChainWalker.cpp: Added. Extracted from ComposedShadowTreeWalker.cpp
(WebCore):
(WebCore::AncestorChainWalker::AncestorChainWalker):
(WebCore::AncestorChainWalker::parent):
* dom/AncestorChainWalker.h: Added. Extracted from ComposedShadowTreeWalker.h
(WebCore):
(AncestorChainWalker):
(WebCore::AncestorChainWalker::get):
(WebCore::AncestorChainWalker::crossingInsertionPoint):
* dom/ComposedShadowTreeWalker.cpp:
* dom/ComposedShadowTreeWalker.h:
* dom/DOMAllInOne.cpp:
* dom/ElementShadow.h:
(WebCore::shadowOfParent):
(WebCore):
* dom/EventDispatcher.cpp:
* dom/Node.cpp:
* dom/NodeRenderingTraversal.cpp:
(WebCore::NodeRenderingTraversal::nextInScope):
(NodeRenderingTraversal):
(WebCore::NodeRenderingTraversal::previousInScope): Added.
(WebCore::NodeRenderingTraversal::parentInScope): Added.
(WebCore::NodeRenderingTraversal::lastChildInScope): Added.
* dom/NodeRenderingTraversal.h:
(NodeRenderingTraversal):
* dom/TreeScope.cpp:
* html/HTMLLIElement.cpp:
(WebCore::HTMLLIElement::attach):
* page/EventHandler.cpp:
* page/FocusController.cpp: Replacing CSTW with NRT
(WebCore):
(WebCore::FocusNavigationScope::focusNavigationScopeOf):
(WebCore::FocusController::findNodeWithExactTabIndex):
(WebCore::nextNodeWithGreaterTabIndex):
(WebCore::previousNodeWithLowerTabIndex):
(WebCore::FocusController::nextFocusableNode):
(WebCore::FocusController::previousFocusableNode):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@139325 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/AncestorChainWalker.cpp [new file with mode: 0644]
Source/WebCore/dom/AncestorChainWalker.h [new file with mode: 0644]
Source/WebCore/dom/ComposedShadowTreeWalker.cpp
Source/WebCore/dom/ComposedShadowTreeWalker.h
Source/WebCore/dom/DOMAllInOne.cpp
Source/WebCore/dom/ElementShadow.h
Source/WebCore/dom/EventDispatcher.cpp
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/NodeRenderingTraversal.cpp
Source/WebCore/dom/NodeRenderingTraversal.h
Source/WebCore/dom/TreeScope.cpp
Source/WebCore/html/HTMLLIElement.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/FocusController.cpp