Rename AncestorChainWalker.
authorhayato@chromium.org <hayato@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Feb 2013 02:27:30 +0000 (02:27 +0000)
committerhayato@chromium.org <hayato@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Feb 2013 02:27:30 +0000 (02:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=110146

Reviewed by Dimitri Glazkov.

Rename AncestorChainWalker to EventPathWalker.
The term of EventPath is used in DOM Core spec.  EventPath was
already introduced into a EventContext.h in r112055. We should
spread this term into the Walker class since they share the same
purpose.

No new tests, no behavior change.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMAllInOne.cpp:
* dom/EventDispatcher.cpp:
* dom/EventPathWalker.cpp: Renamed from Source/WebCore/dom/AncestorChainWalker.cpp.
(WebCore):
(WebCore::EventPathWalker::EventPathWalker):
(WebCore::EventPathWalker::parent): parent() is now a static function to cover simple use cases.
(WebCore::EventPathWalker::moveToParent): Renamed from parent().
* dom/EventPathWalker.h: Renamed from Source/WebCore/dom/AncestorChainWalker.h.
(WebCore):
(EventPathWalker):
(WebCore::EventPathWalker::node):
(WebCore::EventPathWalker::isVisitingInsertionPointInReprojection): Renamed from isCrossingInsertionPoint().
* dom/EventRetargeter.cpp:
(WebCore::EventRetargeter::calculateEventPath):
(WebCore::EventRetargeter::buildRelatedNodeMap):
* dom/TreeScope.cpp:
(WebCore::TreeScope::focusedNode):
* html/HTMLLIElement.cpp:
(WebCore::HTMLLIElement::attach):
* page/EventHandler.cpp:
(WebCore::EventHandler::updateMouseEventTargetNode):
(WebCore::EventHandler::handleWheelEvent):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@143422 268f45cc-cd09-0410-ab3c-d52691b4dbfc

14 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/DOMAllInOne.cpp
Source/WebCore/dom/EventDispatcher.cpp
Source/WebCore/dom/EventPathWalker.cpp [moved from Source/WebCore/dom/AncestorChainWalker.cpp with 81% similarity]
Source/WebCore/dom/EventPathWalker.h [moved from Source/WebCore/dom/AncestorChainWalker.h with 78% similarity]
Source/WebCore/dom/EventRetargeter.cpp
Source/WebCore/dom/TreeScope.cpp
Source/WebCore/html/HTMLLIElement.cpp
Source/WebCore/page/EventHandler.cpp

index da6d6e5..6bc0be2 100644 (file)
@@ -1117,7 +1117,6 @@ set(WebCore_SOURCES
     css/WebKitCSSViewportRule.cpp
 
     dom/ActiveDOMObject.cpp
-    dom/AncestorChainWalker.cpp
     dom/Attr.cpp
     dom/BeforeTextInsertedEvent.cpp
     dom/BeforeUnloadEvent.cpp
@@ -1176,6 +1175,7 @@ set(WebCore_SOURCES
     dom/EventException.cpp
     dom/EventListenerMap.cpp
     dom/EventNames.cpp
+    dom/EventPathWalker.cpp
     dom/EventRetargeter.cpp
     dom/EventTarget.cpp
     dom/ExceptionBase.cpp
index 1f18e4a..32a5ea0 100644 (file)
@@ -1,3 +1,46 @@
+2013-02-19  Hayato Ito  <hayato@chromium.org>
+
+        Rename AncestorChainWalker.
+        https://bugs.webkit.org/show_bug.cgi?id=110146
+
+        Reviewed by Dimitri Glazkov.
+
+        Rename AncestorChainWalker to EventPathWalker.
+        The term of EventPath is used in DOM Core spec.  EventPath was
+        already introduced into a EventContext.h in r112055. We should
+        spread this term into the Walker class since they share the same
+        purpose.
+
+        No new tests, no behavior change.
+
+        * CMakeLists.txt:
+        * GNUmakefile.list.am:
+        * Target.pri:
+        * WebCore.gypi:
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/DOMAllInOne.cpp:
+        * dom/EventDispatcher.cpp:
+        * dom/EventPathWalker.cpp: Renamed from Source/WebCore/dom/AncestorChainWalker.cpp.
+        (WebCore):
+        (WebCore::EventPathWalker::EventPathWalker):
+        (WebCore::EventPathWalker::parent): parent() is now a static function to cover simple use cases.
+        (WebCore::EventPathWalker::moveToParent): Renamed from parent().
+        * dom/EventPathWalker.h: Renamed from Source/WebCore/dom/AncestorChainWalker.h.
+        (WebCore):
+        (EventPathWalker):
+        (WebCore::EventPathWalker::node):
+        (WebCore::EventPathWalker::isVisitingInsertionPointInReprojection): Renamed from isCrossingInsertionPoint().
+        * dom/EventRetargeter.cpp:
+        (WebCore::EventRetargeter::calculateEventPath):
+        (WebCore::EventRetargeter::buildRelatedNodeMap):
+        * dom/TreeScope.cpp:
+        (WebCore::TreeScope::focusedNode):
+        * html/HTMLLIElement.cpp:
+        (WebCore::HTMLLIElement::attach):
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::updateMouseEventTargetNode):
+        (WebCore::EventHandler::handleWheelEvent):
+
 2013-02-19  Dean Jackson  <dino@apple.com>
 
         Snapshotted plugin label should not be selectable
index 67196d4..5a088c9 100644 (file)
@@ -2743,8 +2743,6 @@ webcore_sources += \
        Source/WebCore/css/WebKitCSSViewportRule.h \
        Source/WebCore/dom/ActiveDOMObject.cpp \
        Source/WebCore/dom/ActiveDOMObject.h \
-       Source/WebCore/dom/AncestorChainWalker.cpp \
-       Source/WebCore/dom/AncestorChainWalker.h \
        Source/WebCore/dom/Attr.cpp \
        Source/WebCore/dom/Attr.h \
        Source/WebCore/dom/Attribute.h \
@@ -2876,6 +2874,8 @@ webcore_sources += \
        Source/WebCore/dom/EventListenerMap.h \
        Source/WebCore/dom/EventNames.cpp \
        Source/WebCore/dom/EventNames.h \
+       Source/WebCore/dom/EventPathWalker.cpp \
+       Source/WebCore/dom/EventPathWalker.h \
        Source/WebCore/dom/EventRetargeter.cpp \
        Source/WebCore/dom/EventTarget.cpp \
        Source/WebCore/dom/EventTarget.h \
index a33ed35..e4256cc 100644 (file)
@@ -352,7 +352,6 @@ SOURCES += \
     css/WebKitCSSTransformValue.cpp \
     css/WebKitCSSViewportRule.cpp \
     dom/ActiveDOMObject.cpp \
-    dom/AncestorChainWalker.cpp \
     dom/Attr.cpp \
     dom/BeforeTextInsertedEvent.cpp \
     dom/BeforeUnloadEvent.cpp \
@@ -410,6 +409,7 @@ SOURCES += \
     dom/EventException.cpp \
     dom/EventListenerMap.cpp \
     dom/EventNames.cpp \
+    dom/EventPathWalker.cpp \
     dom/EventRetargeter.cpp \
     dom/EventTarget.cpp \
     dom/ExceptionBase.cpp \
index 788fb38..ba5e354 100644 (file)
         ],
         'webcore_dom_files': [
             'dom/ActiveDOMObject.cpp',
-            'dom/AncestorChainWalker.cpp',
-            'dom/AncestorChainWalker.h',
             'dom/Attr.cpp',
             'dom/AutocompleteErrorEvent.h',
             'dom/BeforeLoadEvent.h',
             'dom/EventException.h',
             'dom/EventListenerMap.cpp',
             'dom/EventNames.cpp',
+            'dom/EventPathWalker.cpp',
+            'dom/EventPathWalker.h',
             'dom/EventQueue.h',
             'dom/EventSender.h',
             'dom/EventTarget.cpp',
index 2c65d64..a6cec40 100644 (file)
                4A9CC81816BB9AC600EC645A /* CSSDefaultStyleSheets.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A9CC81616BB9AC600EC645A /* CSSDefaultStyleSheets.h */; };
                4A9CC82016BF9BB400EC645A /* InspectorCSSOMWrappers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A9CC81E16BF9BB400EC645A /* InspectorCSSOMWrappers.cpp */; };
                4A9CC82116BF9BB400EC645A /* InspectorCSSOMWrappers.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A9CC81F16BF9BB400EC645A /* InspectorCSSOMWrappers.h */; };
+               4AAAB4C416D379B5001DA41B /* EventPathWalker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AAAB4C216D379B5001DA41B /* EventPathWalker.cpp */; };
+               4AAAB4C516D379B5001DA41B /* EventPathWalker.h in Headers */ = {isa = PBXBuildFile; fileRef = 4AAAB4C316D379B5001DA41B /* EventPathWalker.h */; };
                4ABDFF0B14DBE385004D117D /* HTMLShadowElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4ABDFF0714DBE312004D117D /* HTMLShadowElement.cpp */; };
                4ABDFF0C14DBE385004D117D /* HTMLShadowElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 4ABDFF0814DBE312004D117D /* HTMLShadowElement.h */; };
                4ACBC0BE12713CBD0094F9B2 /* ClassList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4ACBC0BC12713CBD0094F9B2 /* ClassList.cpp */; };
                A77E1FF014AACB6E005B7CB6 /* TreeScopeAdopter.h in Headers */ = {isa = PBXBuildFile; fileRef = A77E1FEE14AACB6E005B7CB6 /* TreeScopeAdopter.h */; };
                A781C6A713828B5D0012A62A /* DocumentMarker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A781C6A613828B5D0012A62A /* DocumentMarker.cpp */; };
                A784941B0B5FE507001E237A /* Clipboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A784941A0B5FE507001E237A /* Clipboard.cpp */; };
-               A78CDD2E169E91A1009136F3 /* AncestorChainWalker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A75CBE43169E913D0003A60F /* AncestorChainWalker.cpp */; };
-               A78CDD30169E91A4009136F3 /* AncestorChainWalker.h in Headers */ = {isa = PBXBuildFile; fileRef = A75CBE44169E913D0003A60F /* AncestorChainWalker.h */; };
                A78E526F1346BD1700AD9C31 /* MeterShadowElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A78E526D1346BD1700AD9C31 /* MeterShadowElement.cpp */; };
                A78E52701346BD1700AD9C31 /* MeterShadowElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A78E526E1346BD1700AD9C31 /* MeterShadowElement.h */; };
                A78FE13B12366B1000ACE8D0 /* SpellChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A78FE13912366B1000ACE8D0 /* SpellChecker.cpp */; };
                4A9CC81616BB9AC600EC645A /* CSSDefaultStyleSheets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSDefaultStyleSheets.h; sourceTree = "<group>"; };
                4A9CC81E16BF9BB400EC645A /* InspectorCSSOMWrappers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorCSSOMWrappers.cpp; sourceTree = "<group>"; };
                4A9CC81F16BF9BB400EC645A /* InspectorCSSOMWrappers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorCSSOMWrappers.h; sourceTree = "<group>"; };
+               4AAAB4C216D379B5001DA41B /* EventPathWalker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventPathWalker.cpp; sourceTree = "<group>"; };
+               4AAAB4C316D379B5001DA41B /* EventPathWalker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventPathWalker.h; sourceTree = "<group>"; };
                4ABDFF0714DBE312004D117D /* HTMLShadowElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLShadowElement.cpp; sourceTree = "<group>"; };
                4ABDFF0814DBE312004D117D /* HTMLShadowElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLShadowElement.h; sourceTree = "<group>"; };
                4ABDFF0914DBE312004D117D /* HTMLShadowElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLShadowElement.idl; sourceTree = "<group>"; };
                A73F95FC12C97BFE0031AAF9 /* RoundedRect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RoundedRect.cpp; sourceTree = "<group>"; };
                A73F95FD12C97BFE0031AAF9 /* RoundedRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RoundedRect.h; sourceTree = "<group>"; };
                A74BB76A13BDA86300FF7BF0 /* ExceptionCodePlaceholder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExceptionCodePlaceholder.h; sourceTree = "<group>"; };
-               A75CBE43169E913D0003A60F /* AncestorChainWalker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AncestorChainWalker.cpp; sourceTree = "<group>"; };
-               A75CBE44169E913D0003A60F /* AncestorChainWalker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AncestorChainWalker.h; sourceTree = "<group>"; };
                A75E497410752ACB00C9B896 /* SerializedScriptValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SerializedScriptValue.h; sourceTree = "<group>"; };
                A75E497510752ACB00C9B896 /* SerializedScriptValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SerializedScriptValue.cpp; sourceTree = "<group>"; };
                A75E8B800E1DE2D6007F2481 /* FEBlend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FEBlend.cpp; path = filters/FEBlend.cpp; sourceTree = "<group>"; };
                        children = (
                                E1C4DE6D0EA75C650023CCD6 /* ActiveDOMObject.cpp */,
                                E1C4DE680EA75C1E0023CCD6 /* ActiveDOMObject.h */,
-                               A75CBE43169E913D0003A60F /* AncestorChainWalker.cpp */,
-                               A75CBE44169E913D0003A60F /* AncestorChainWalker.h */,
                                A8C4A7FC09D563270003AC8D /* Attr.cpp */,
                                A8C4A7FB09D563270003AC8D /* Attr.h */,
                                93EEC1E509C2877700C515D1 /* Attr.idl */,
                                939885C108B7E3D100E707C4 /* EventNames.cpp */,
                                939885C208B7E3D100E707C4 /* EventNames.h */,
                                BC9A6142146859D9006057FD /* EventNames.in */,
+                               4AAAB4C216D379B5001DA41B /* EventPathWalker.cpp */,
+                               4AAAB4C316D379B5001DA41B /* EventPathWalker.h */,
                                8F6756191288B17B0047ACA3 /* EventQueue.h */,
                                4A5CB1C316C3A5FD00AB2886 /* EventRetargeter.cpp */,
                                4A5CB1C416C3A5FD00AB2886 /* EventRetargeter.h */,
                                CE08C3D2152B599A0021B8C2 /* AlternativeTextController.h in Headers */,
                                CE7B2DB31586ABAD0098B3FA /* AlternativeTextUIController.h in Headers */,
                                FD31603E12B0267600C1A359 /* AnalyserNode.h in Headers */,
-                               A78CDD30169E91A4009136F3 /* AncestorChainWalker.h in Headers */,
                                490707E71219C04300D90E51 /* ANGLEWebKitBridge.h in Headers */,
                                49E912AB0EFAC906009D0CAF /* Animation.h in Headers */,
                                316FE1120E6E1DA700BF6088 /* AnimationBase.h in Headers */,
                                AD4495F4141FC08900541EDF /* EventListenerMap.h in Headers */,
                                1CA19E160DC255CA0065A994 /* EventLoop.h in Headers */,
                                939885C408B7E3D100E707C4 /* EventNames.h in Headers */,
+                               4AAAB4C516D379B5001DA41B /* EventPathWalker.h in Headers */,
                                8F67561B1288B17B0047ACA3 /* EventQueue.h in Headers */,
                                E0FEF372B17C53EAC1C1FBEE /* EventSource.h in Headers */,
                                4A5CB1C616C3A5FD00AB2886 /* EventRetargeter.h in Headers */,
                                CE08C3D1152B599A0021B8C2 /* AlternativeTextController.cpp in Sources */,
                                CE7B2DB41586ABAD0098B3FA /* AlternativeTextUIController.mm in Sources */,
                                FD31603D12B0267600C1A359 /* AnalyserNode.cpp in Sources */,
-                               A78CDD2E169E91A1009136F3 /* AncestorChainWalker.cpp in Sources */,
                                490707E61219C04300D90E51 /* ANGLEWebKitBridge.cpp in Sources */,
                                49E912AA0EFAC906009D0CAF /* Animation.cpp in Sources */,
                                316FE1110E6E1DA700BF6088 /* AnimationBase.cpp in Sources */,
                                1CA19E050DC255950065A994 /* EventLoopMac.mm in Sources */,
                                939885C308B7E3D100E707C4 /* EventNames.cpp in Sources */,
                                E0FEF372B27C53EAC1C1FBEE /* EventSource.cpp in Sources */,
+                               4AAAB4C416D379B5001DA41B /* EventPathWalker.cpp in Sources */,
                                4A5CB1C516C3A5FD00AB2886 /* EventRetargeter.cpp in Sources */,
                                E12EDBEA0B308E0B002704B6 /* EventTarget.cpp in Sources */,
                                D6FDAEF3149C06190037B1E4 /* EventTracer.cpp in Sources */,
index d8c3007..43508cf 100644 (file)
@@ -26,7 +26,6 @@
 // This all-in-one cpp file cuts down on template bloat to allow us to build our Windows release build.
 
 #include "ActiveDOMObject.cpp"
-#include "AncestorChainWalker.cpp"
 #include "Attr.cpp"
 #include "BeforeTextInsertedEvent.cpp"
 #include "BeforeUnloadEvent.cpp"
@@ -80,6 +79,7 @@
 #include "EventException.cpp"
 #include "EventListenerMap.cpp"
 #include "EventNames.cpp"
+#include "EventPathWalker.cpp"
 #include "EventRetargeter.cpp"
 #include "EventTarget.cpp"
 #include "ExceptionBase.cpp"
index feb017e..2e7930d 100644 (file)
 #include "config.h"
 #include "EventDispatcher.h"
 
-#include "AncestorChainWalker.h"
 #include "ContainerNode.h"
 #include "ElementShadow.h"
 #include "EventContext.h"
 #include "EventDispatchMediator.h"
+#include "EventPathWalker.h"
 #include "EventRetargeter.h"
 #include "FrameView.h"
 #include "HTMLMediaElement.h"
similarity index 81%
rename from Source/WebCore/dom/AncestorChainWalker.cpp
rename to Source/WebCore/dom/EventPathWalker.cpp
index 970cdc2..0018bb8 100644 (file)
@@ -25,7 +25,7 @@
  */
 
 #include "config.h"
-#include "AncestorChainWalker.h"
+#include "EventPathWalker.h"
 
 #include "ContentDistributor.h"
 #include "InsertionPoint.h"
 
 namespace WebCore {
 
-AncestorChainWalker::AncestorChainWalker(const Node* node)
+EventPathWalker::EventPathWalker(const Node* node)
     : m_node(node)
     , m_distributedNode(node)
-    , m_isCrossingInsertionPoint(false)
+    , m_isVisitingInsertionPointInReprojection(false)
 {
     ASSERT(node);
 }
 
-void AncestorChainWalker::parent()
+Node* EventPathWalker::parent(const Node* node)
+{
+    EventPathWalker walker(node);
+    walker.moveToParent();
+    return walker.node();
+}
+
+void EventPathWalker::moveToParent()
 {
     ASSERT(m_node);
     ASSERT(m_distributedNode);
     if (ElementShadow* shadow = shadowOfParent(m_node)) {
         if (InsertionPoint* insertionPoint = shadow->distributor().findInsertionPointFor(m_distributedNode)) {
             m_node = insertionPoint;
-            m_isCrossingInsertionPoint = true;
+            m_isVisitingInsertionPointInReprojection = true;
             return;
         }
     }
@@ -56,19 +63,19 @@ void AncestorChainWalker::parent()
         m_node = m_node->parentNode();
         if (!(m_node && m_node->isShadowRoot() && ScopeContentDistribution::assignedTo(toShadowRoot(m_node))))
             m_distributedNode = m_node;
-        m_isCrossingInsertionPoint = false;
+        m_isVisitingInsertionPointInReprojection = false;
         return;
     }
 
     const ShadowRoot* shadowRoot = toShadowRoot(m_node);
     if (InsertionPoint* insertionPoint = ScopeContentDistribution::assignedTo(shadowRoot)) {
         m_node = insertionPoint;
-        m_isCrossingInsertionPoint = true;
+        m_isVisitingInsertionPointInReprojection = true;
         return;
     }
     m_node = shadowRoot->host();
     m_distributedNode = m_node;
-    m_isCrossingInsertionPoint = false;
+    m_isVisitingInsertionPointInReprojection = false;
 }
 
 } // namespace
similarity index 78%
rename from Source/WebCore/dom/AncestorChainWalker.h
rename to Source/WebCore/dom/EventPathWalker.h
index af552eb..9006e9b 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef AncestorChainWalker_h
-#define AncestorChainWalker_h
+#ifndef EventPathWalker_h
+#define EventPathWalker_h
 
 namespace WebCore {
 
 class Node;
 
-class AncestorChainWalker {
+class EventPathWalker {
 public:
-    explicit AncestorChainWalker(const Node*);
-    void parent();
-    Node* get() const { return const_cast<Node*>(m_node); }
-    bool crossingInsertionPoint() { return m_isCrossingInsertionPoint; }
+    explicit EventPathWalker(const Node*);
+    static Node* parent(const Node*);
+    void moveToParent();
+    Node* node() const { return const_cast<Node*>(m_node); }
+    bool isVisitingInsertionPointInReprojection() { return m_isVisitingInsertionPointInReprojection; }
 
 private:
     const Node* m_node;
     const Node* m_distributedNode;
-    bool m_isCrossingInsertionPoint;
+    bool m_isVisitingInsertionPointInReprojection;
 };
 
 } // namespace
index 92730d0..915da47 100644 (file)
@@ -20,9 +20,9 @@
 #include "config.h"
 #include "EventRetargeter.h"
 
-#include "AncestorChainWalker.h"
 #include "ContainerNode.h"
 #include "EventContext.h"
+#include "EventPathWalker.h"
 #include "FocusEvent.h"
 #include "MouseEvent.h"
 #include "ShadowRoot.h"
@@ -78,11 +78,11 @@ void EventRetargeter::calculateEventPath(Node* node, Event* event, EventPath& ev
     bool isSVGElement = node->isSVGElement();
     bool isMouseOrFocusEvent = event->isMouseEvent() || event->isFocusEvent();
     Vector<EventTarget*, 32> targetStack;
-    for (AncestorChainWalker walker(node); walker.get(); walker.parent()) {
-        Node* node = walker.get();
+    for (EventPathWalker walker(node); walker.node(); walker.moveToParent()) {
+        Node* node = walker.node();
         if (targetStack.isEmpty())
             targetStack.append(eventTargetRespectingTargetRules(node));
-        else if (walker.crossingInsertionPoint())
+        else if (walker.isVisitingInsertionPointInReprojection())
             targetStack.append(targetStack.last());
         if (isMouseOrFocusEvent)
             eventPath.append(adoptPtr(new MouseOrFocusEventContext(node, eventTargetRespectingTargetRules(node), targetStack.last())));
@@ -168,11 +168,11 @@ void EventRetargeter::buildRelatedNodeMap(Node* relatedNode, RelatedNodeMap& rel
 {
     Vector<Node*, 32> relatedNodeStack;
     TreeScope* lastTreeScope = 0;
-    for (AncestorChainWalker walker(relatedNode); walker.get(); walker.parent()) {
-        Node* node = walker.get();
+    for (EventPathWalker walker(relatedNode); walker.node(); walker.moveToParent()) {
+        Node* node = walker.node();
         if (relatedNodeStack.isEmpty())
             relatedNodeStack.append(node);
-        else if (walker.crossingInsertionPoint())
+        else if (walker.isVisitingInsertionPointInReprojection())
             relatedNodeStack.append(relatedNodeStack.last());
         TreeScope* scope = node->treeScope();
         // Skips adding a node to the map if treeScope does not change. Just for the performance optimization.
index 03b42fc..454af5d 100644 (file)
 #include "config.h"
 #include "TreeScope.h"
 
-#include "AncestorChainWalker.h"
 #include "ContainerNode.h"
 #include "DOMSelection.h"
 #include "DOMWindow.h"
 #include "Document.h"
 #include "Element.h"
+#include "EventPathWalker.h"
 #include "FocusController.h"
 #include "Frame.h"
 #include "FrameView.h"
@@ -352,11 +352,11 @@ Node* TreeScope::focusedNode()
     if (!node)
         return 0;
     Vector<Node*> targetStack;
-    for (AncestorChainWalker walker(node); walker.get(); walker.parent()) {
-        Node* node = walker.get();
+    for (EventPathWalker walker(node); walker.node(); walker.moveToParent()) {
+        Node* node = walker.node();
         if (targetStack.isEmpty())
             targetStack.append(node);
-        else if (walker.crossingInsertionPoint())
+        else if (walker.isVisitingInsertionPointInReprojection())
             targetStack.append(targetStack.last());
         if (node == rootNode())
             return targetStack.last();
index 8590ae1..a17a34f 100644 (file)
 #include "config.h"
 #include "HTMLLIElement.h"
 
-#include "AncestorChainWalker.h"
 #include "Attribute.h"
 #include "CSSPropertyNames.h"
 #include "CSSValueKeywords.h"
+#include "EventPathWalker.h"
 #include "HTMLNames.h"
 #include "RenderListItem.h"
 
@@ -96,13 +96,13 @@ void HTMLLIElement::attach()
 
         // Find the enclosing list node.
         Node* listNode = 0;
-        AncestorChainWalker walker(this);
+        EventPathWalker walker(this);
         while (!listNode) {
-            walker.parent();
-            if (!walker.get())
+            walker.moveToParent();
+            if (!walker.node())
                 break;
-            if (walker.get()->hasTagName(ulTag) || walker.get()->hasTagName(olTag))
-                listNode = walker.get();
+            if (walker.node()->hasTagName(ulTag) || walker.node()->hasTagName(olTag))
+                listNode = walker.node();
         }
 
         // If we are not in a list, tell the renderer so it can position us inside.
index 3bac4f2..3b8165e 100644 (file)
@@ -29,7 +29,6 @@
 #include "EventHandler.h"
 
 #include "AXObjectCache.h"
-#include "AncestorChainWalker.h"
 #include "AutoscrollController.h"
 #include "CachedImage.h"
 #include "Chrome.h"
@@ -43,6 +42,7 @@
 #include "Editor.h"
 #include "EditorClient.h"
 #include "EventNames.h"
+#include "EventPathWalker.h"
 #include "ExceptionCodePlaceholder.h"
 #include "FloatPoint.h"
 #include "FloatRect.h"
@@ -2119,11 +2119,8 @@ void EventHandler::updateMouseEventTargetNode(Node* targetNode, const PlatformMo
         result = m_capturingMouseEventsNode.get();
     else {
         // If the target node is a text node, dispatch on the parent node - rdar://4196646
-        if (result && result->isTextNode()) {
-            AncestorChainWalker walker(result);
-            walker.parent();
-            result = walker.get();
-        }
+        if (result && result->isTextNode())
+            result = EventPathWalker::parent(result);
     }
     m_nodeUnderMouse = result;
 #if ENABLE(SVG)
@@ -2331,11 +2328,8 @@ bool EventHandler::handleWheelEvent(const PlatformWheelEvent& e)
 
     Node* node = result.innerNode();
     // Wheel events should not dispatch to text nodes.
-    if (node && node->isTextNode()) {
-        AncestorChainWalker walker(node);
-        walker.parent();
-        node = walker.get();
-    }
+    if (node && node->isTextNode())
+        node = EventPathWalker::parent(node);
 
     bool isOverWidget;
     if (useLatchedWheelEventNode) {