WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Renamed
bug-110146-20130219184250.patch (text/plain), 32.29 KB, created by
Hayato Ito
on 2013-02-19 01:46:28 PST
(
hide
)
Description:
Renamed
Filename:
MIME Type:
Creator:
Hayato Ito
Created:
2013-02-19 01:46:28 PST
Size:
32.29 KB
patch
obsolete
>Subversion Revision: 143291 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 51b9a370c283852bc64b60e96557bdb00c829cef..160569f1d32ec4b915d73a81b80ed2d8d57c9aea 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -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 NOBODY (OOPS!). >+ >+ 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-18 Ryosuke Niwa <rniwa@webkit.org> > > Merge handleSpecialChild into layoutBlockChildren >diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt >index da6d6e5fbb4521487fa38fb99ea547790d05dd96..6bc0be2ded6cb6b2be15df26f573753d5f8951b3 100644 >--- a/Source/WebCore/CMakeLists.txt >+++ b/Source/WebCore/CMakeLists.txt >@@ -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 >diff --git a/Source/WebCore/GNUmakefile.list.am b/Source/WebCore/GNUmakefile.list.am >index 67196d46aaa042e17bdc4fcc55dbde1904189883..5a088c99f7a9e4741897c23e8d03801ecfa58b9c 100644 >--- a/Source/WebCore/GNUmakefile.list.am >+++ b/Source/WebCore/GNUmakefile.list.am >@@ -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 \ >diff --git a/Source/WebCore/Target.pri b/Source/WebCore/Target.pri >index a33ed35ac4adce5b956b40f84825ddf11b7b8341..e4256ccde81f71996732ffa18c66ec70901b4129 100644 >--- a/Source/WebCore/Target.pri >+++ b/Source/WebCore/Target.pri >@@ -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 \ >diff --git a/Source/WebCore/WebCore.gypi b/Source/WebCore/WebCore.gypi >index c11af02efa69a78d2959a8f246b24e4ff61e2449..3ca42a275a3fc4ee5ec6d5a177c7305da557edca 100644 >--- a/Source/WebCore/WebCore.gypi >+++ b/Source/WebCore/WebCore.gypi >@@ -2740,8 +2740,6 @@ > ], > 'webcore_dom_files': [ > 'dom/ActiveDOMObject.cpp', >- 'dom/AncestorChainWalker.cpp', >- 'dom/AncestorChainWalker.h', > 'dom/Attr.cpp', > 'dom/AutocompleteErrorEvent.h', > 'dom/BeforeLoadEvent.h', >@@ -2845,6 +2843,8 @@ > 'dom/EventException.h', > 'dom/EventListenerMap.cpp', > 'dom/EventNames.cpp', >+ 'dom/EventPathWalker.cpp', >+ 'dom/EventPathWalker.h', > 'dom/EventQueue.h', > 'dom/EventSender.h', > 'dom/EventTarget.cpp', >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 2c65d643e2b4c5ec1b536003b7cf4466c3ef9608..a6cec401fc6c14c86c8403e096bed10c7193818b 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -1460,6 +1460,8 @@ > 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 */; }; >@@ -3958,8 +3960,6 @@ > 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 */; }; >@@ -8894,6 +8894,8 @@ > 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>"; }; >@@ -11434,8 +11436,6 @@ > 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>"; }; >@@ -22443,8 +22443,6 @@ > children = ( > E1C4DE6D0EA75C650023CCD6 /* ActiveDOMObject.cpp */, > E1C4DE680EA75C1E0023CCD6 /* ActiveDOMObject.h */, >- A75CBE43169E913D0003A60F /* AncestorChainWalker.cpp */, >- A75CBE44169E913D0003A60F /* AncestorChainWalker.h */, > A8C4A7FC09D563270003AC8D /* Attr.cpp */, > A8C4A7FB09D563270003AC8D /* Attr.h */, > 93EEC1E509C2877700C515D1 /* Attr.idl */, >@@ -22605,6 +22603,8 @@ > 939885C108B7E3D100E707C4 /* EventNames.cpp */, > 939885C208B7E3D100E707C4 /* EventNames.h */, > BC9A6142146859D9006057FD /* EventNames.in */, >+ 4AAAB4C216D379B5001DA41B /* EventPathWalker.cpp */, >+ 4AAAB4C316D379B5001DA41B /* EventPathWalker.h */, > 8F6756191288B17B0047ACA3 /* EventQueue.h */, > 4A5CB1C316C3A5FD00AB2886 /* EventRetargeter.cpp */, > 4A5CB1C416C3A5FD00AB2886 /* EventRetargeter.h */, >@@ -23226,7 +23226,6 @@ > 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 */, >@@ -24333,6 +24332,7 @@ > 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 */, >@@ -26961,7 +26961,6 @@ > 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 */, >@@ -27681,6 +27680,7 @@ > 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 */, >diff --git a/Source/WebCore/dom/AncestorChainWalker.cpp b/Source/WebCore/dom/AncestorChainWalker.cpp >deleted file mode 100644 >index 970cdc20597c50b218df431038e6c58b9eabaae6..0000000000000000000000000000000000000000 >--- a/Source/WebCore/dom/AncestorChainWalker.cpp >+++ /dev/null >@@ -1,74 +0,0 @@ >-/* >- * Copyright (C) 2013 Google Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions are >- * met: >- * >- * * Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * * Neither the name of Google Inc. nor the names of its >- * contributors may be used to endorse or promote products derived from >- * this software without specific prior written permission. >- * >- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS >- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT >- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR >- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT >- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, >- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT >- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, >- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY >- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#include "config.h" >-#include "AncestorChainWalker.h" >- >-#include "ContentDistributor.h" >-#include "InsertionPoint.h" >-#include "ShadowRoot.h" >- >-namespace WebCore { >- >-AncestorChainWalker::AncestorChainWalker(const Node* node) >- : m_node(node) >- , m_distributedNode(node) >- , m_isCrossingInsertionPoint(false) >-{ >- ASSERT(node); >-} >- >-void AncestorChainWalker::parent() >-{ >- 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; >- return; >- } >- } >- if (!m_node->isShadowRoot()) { >- m_node = m_node->parentNode(); >- if (!(m_node && m_node->isShadowRoot() && ScopeContentDistribution::assignedTo(toShadowRoot(m_node)))) >- m_distributedNode = m_node; >- m_isCrossingInsertionPoint = false; >- return; >- } >- >- const ShadowRoot* shadowRoot = toShadowRoot(m_node); >- if (InsertionPoint* insertionPoint = ScopeContentDistribution::assignedTo(shadowRoot)) { >- m_node = insertionPoint; >- m_isCrossingInsertionPoint = true; >- return; >- } >- m_node = shadowRoot->host(); >- m_distributedNode = m_node; >- m_isCrossingInsertionPoint = false; >-} >- >-} // namespace >diff --git a/Source/WebCore/dom/AncestorChainWalker.h b/Source/WebCore/dom/AncestorChainWalker.h >deleted file mode 100644 >index af552eb9ab9693fb478a773d964cf436a8ae4984..0000000000000000000000000000000000000000 >--- a/Source/WebCore/dom/AncestorChainWalker.h >+++ /dev/null >@@ -1,49 +0,0 @@ >-/* >- * Copyright (C) 2013 Google Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions are >- * met: >- * >- * * Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * * Neither the name of Google Inc. nor the names of its >- * contributors may be used to endorse or promote products derived from >- * this software without specific prior written permission. >- * >- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS >- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT >- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR >- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT >- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, >- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT >- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, >- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY >- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#ifndef AncestorChainWalker_h >-#define AncestorChainWalker_h >- >-namespace WebCore { >- >-class Node; >- >-class AncestorChainWalker { >-public: >- explicit AncestorChainWalker(const Node*); >- void parent(); >- Node* get() const { return const_cast<Node*>(m_node); } >- bool crossingInsertionPoint() { return m_isCrossingInsertionPoint; } >- >-private: >- const Node* m_node; >- const Node* m_distributedNode; >- bool m_isCrossingInsertionPoint; >-}; >- >-} // namespace >- >-#endif >diff --git a/Source/WebCore/dom/DOMAllInOne.cpp b/Source/WebCore/dom/DOMAllInOne.cpp >index d8c30072ad91cd66f250869fa00ac7c439971887..43508cf0dac4da9c9d099f4a8918fc66fd2f973e 100644 >--- a/Source/WebCore/dom/DOMAllInOne.cpp >+++ b/Source/WebCore/dom/DOMAllInOne.cpp >@@ -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" >diff --git a/Source/WebCore/dom/EventDispatcher.cpp b/Source/WebCore/dom/EventDispatcher.cpp >index 4c6c8353c8802acb79c7d1033e788504e9f48a88..23e2398d26abe2a04cfc90bbb6604b9a88dad6a5 100644 >--- a/Source/WebCore/dom/EventDispatcher.cpp >+++ b/Source/WebCore/dom/EventDispatcher.cpp >@@ -26,11 +26,11 @@ > #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" >diff --git a/Source/WebCore/dom/EventPathWalker.cpp b/Source/WebCore/dom/EventPathWalker.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..0018bb824884179324deec82d0c24598b9f2afbd >--- /dev/null >+++ b/Source/WebCore/dom/EventPathWalker.cpp >@@ -0,0 +1,81 @@ >+/* >+ * Copyright (C) 2013 Google Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions are >+ * met: >+ * >+ * * Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * * Neither the name of Google Inc. nor the names of its >+ * contributors may be used to endorse or promote products derived from >+ * this software without specific prior written permission. >+ * >+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS >+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT >+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR >+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT >+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, >+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT >+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, >+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY >+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "EventPathWalker.h" >+ >+#include "ContentDistributor.h" >+#include "InsertionPoint.h" >+#include "ShadowRoot.h" >+ >+namespace WebCore { >+ >+EventPathWalker::EventPathWalker(const Node* node) >+ : m_node(node) >+ , m_distributedNode(node) >+ , m_isVisitingInsertionPointInReprojection(false) >+{ >+ ASSERT(node); >+} >+ >+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_isVisitingInsertionPointInReprojection = true; >+ return; >+ } >+ } >+ if (!m_node->isShadowRoot()) { >+ m_node = m_node->parentNode(); >+ if (!(m_node && m_node->isShadowRoot() && ScopeContentDistribution::assignedTo(toShadowRoot(m_node)))) >+ m_distributedNode = m_node; >+ m_isVisitingInsertionPointInReprojection = false; >+ return; >+ } >+ >+ const ShadowRoot* shadowRoot = toShadowRoot(m_node); >+ if (InsertionPoint* insertionPoint = ScopeContentDistribution::assignedTo(shadowRoot)) { >+ m_node = insertionPoint; >+ m_isVisitingInsertionPointInReprojection = true; >+ return; >+ } >+ m_node = shadowRoot->host(); >+ m_distributedNode = m_node; >+ m_isVisitingInsertionPointInReprojection = false; >+} >+ >+} // namespace >diff --git a/Source/WebCore/dom/EventPathWalker.h b/Source/WebCore/dom/EventPathWalker.h >new file mode 100644 >index 0000000000000000000000000000000000000000..9006e9bfe986b2a6b3170b1e2613c1b0d1e24fac >--- /dev/null >+++ b/Source/WebCore/dom/EventPathWalker.h >@@ -0,0 +1,50 @@ >+/* >+ * Copyright (C) 2013 Google Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions are >+ * met: >+ * >+ * * Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * * Neither the name of Google Inc. nor the names of its >+ * contributors may be used to endorse or promote products derived from >+ * this software without specific prior written permission. >+ * >+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS >+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT >+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR >+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT >+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, >+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT >+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, >+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY >+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#ifndef EventPathWalker_h >+#define EventPathWalker_h >+ >+namespace WebCore { >+ >+class Node; >+ >+class EventPathWalker { >+public: >+ 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_isVisitingInsertionPointInReprojection; >+}; >+ >+} // namespace >+ >+#endif >diff --git a/Source/WebCore/dom/EventRetargeter.cpp b/Source/WebCore/dom/EventRetargeter.cpp >index 92730d0e9c2e6e7d5bbb93c62d4fa82172200f2a..915da47120b0e8265675f2ada6adac92e5a5cbc2 100644 >--- a/Source/WebCore/dom/EventRetargeter.cpp >+++ b/Source/WebCore/dom/EventRetargeter.cpp >@@ -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. >diff --git a/Source/WebCore/dom/TreeScope.cpp b/Source/WebCore/dom/TreeScope.cpp >index 03b42fce8586862cc4899bb5123ef9455e9c5e0e..454af5da9dfa8660de0e31249bef986e1cc7d0b8 100644 >--- a/Source/WebCore/dom/TreeScope.cpp >+++ b/Source/WebCore/dom/TreeScope.cpp >@@ -27,12 +27,12 @@ > #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(); >diff --git a/Source/WebCore/html/HTMLLIElement.cpp b/Source/WebCore/html/HTMLLIElement.cpp >index 8590ae1029d14e97fb8933ab1eda290a9071dfb9..a17a34f82d820bf875a8a4ebed00e505157f6b19 100644 >--- a/Source/WebCore/html/HTMLLIElement.cpp >+++ b/Source/WebCore/html/HTMLLIElement.cpp >@@ -23,10 +23,10 @@ > #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. >diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp >index 3bac4f209011d480bba9d90c4adfa719aff813ac..3b8165e76d1dfebbd237e7e02ca0ecd86317404c 100644 >--- a/Source/WebCore/page/EventHandler.cpp >+++ b/Source/WebCore/page/EventHandler.cpp >@@ -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) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 110146
: 189026