Changeset 200851 in webkit
- Timestamp:
- May 13, 2016, 6:26:37 AM (9 years ago)
- Location:
- releases/WebKitGTK/webkit-2.12
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog
r200849 r200851 1 2016-05-04 Youenn Fablet <youenn.fablet@crf.canon.fr> 2 3 Clicks inside button elements are sometimes discarded when the mouse moves 4 https://bugs.webkit.org/show_bug.cgi?id=39620 5 6 Reviewed by Darin Adler. 7 8 Test coming from http://src.chromium.org/viewvc/blink?view=revision&revision=162081. 9 Modified to ensure click events do not end up being considered as double click events. 10 11 * fast/events/click-over-descendant-elements-expected.txt: Added. 12 * fast/events/click-over-descendant-elements.html: Added. 13 * platform/ios-simulator/TestExpectations: Marked new test as failing. 14 1 15 2016-04-29 Alex Christensen <achristensen@webkit.org> 2 16 -
releases/WebKitGTK/webkit-2.12/LayoutTests/platform/ios-simulator/TestExpectations
r199991 r200851 1641 1641 fast/events/tab-focus-link-in-canvas.html [ Failure ] 1642 1642 fast/events/tabindex-focus-blur-all.html [ Failure ] 1643 fast/events/click-over-descendant-elements.html [ Failure ] 1643 1644 1644 1645 # Ref-test imported from W3C that is failing because type=image input elements have rounded corners on iOS. -
releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog
r200850 r200851 1 2016-05-04 Youenn Fablet <youenn.fablet@crf.canon.fr> 2 3 Clicks inside button elements are sometimes discarded when the mouse moves 4 https://bugs.webkit.org/show_bug.cgi?id=39620 5 6 Reviewed by Darin Adler. 7 8 Test: fast/events/click-over-descendant-elements.html 9 10 * dom/Node.cpp: 11 (WebCore::ancestor): 12 (WebCore::commonAncestor): Method inspired from 13 http://src.chromium.org/viewvc/blink?view=revision&revision=162081. 14 (WebCore::commonAncestorCrossingShadowBoundary): Helper routine 15 that handles the case of nodes into a shadow node. 16 * dom/Node.h: 17 * page/EventHandler.cpp: 18 (WebCore::EventHandler::handleMouseReleaseEvent): Selecting click event 19 target node according commonAncestorOverShadowBoundary method. 20 (WebCore::EventHandler::targetNodeForClickEvent): Deleted. 21 1 22 2016-05-04 Jiewen Tan <jiewen_tan@apple.com> 2 23 -
releases/WebKitGTK/webkit-2.12/Source/WebCore/dom/Node.cpp
r195927 r200851 939 939 } 940 940 941 static inline Node* ancestor(Node* node, unsigned depth) 942 { 943 for (unsigned i = 0; i < depth; ++i) 944 node = node->parentNode(); 945 return node; 946 } 947 948 Node* commonAncestor(Node& thisNode, Node& otherNode) 949 { 950 unsigned thisDepth = 0; 951 for (auto node = &thisNode; node; node = node->parentNode()) { 952 if (node == &otherNode) 953 return node; 954 thisDepth++; 955 } 956 unsigned otherDepth = 0; 957 for (auto node = &otherNode; node; node = node->parentNode()) { 958 if (node == &thisNode) 959 return &thisNode; 960 otherDepth++; 961 } 962 963 Node* thisAncestor = &thisNode; 964 Node* otherAncestor = &otherNode; 965 if (thisDepth > otherDepth) 966 thisAncestor = ancestor(thisAncestor, thisDepth - otherDepth); 967 else if (otherDepth > thisDepth) 968 otherAncestor = ancestor(otherAncestor, otherDepth - thisDepth); 969 970 for (; thisAncestor; thisAncestor = thisAncestor->parentNode()) { 971 if (thisAncestor == otherAncestor) 972 return thisAncestor; 973 otherAncestor = otherAncestor->parentNode(); 974 } 975 ASSERT(!otherAncestor); 976 return nullptr; 977 } 978 979 Node* commonAncestorCrossingShadowBoundary(Node& node, Node& other) 980 { 981 if (&node == &other) 982 return &node; 983 984 Element* shadowHost = node.shadowHost(); 985 // FIXME: This test might be wrong for user-authored shadow trees. 986 if (shadowHost && shadowHost == other.shadowHost()) 987 return shadowHost; 988 989 TreeScope* scope = commonTreeScope(&node, &other); 990 if (!scope) 991 return nullptr; 992 993 Node* parentNode = scope->ancestorInThisScope(&node); 994 ASSERT(parentNode); 995 Node* parentOther = scope->ancestorInThisScope(&other); 996 ASSERT(parentOther); 997 return commonAncestor(*parentNode, *parentOther); 998 } 999 941 1000 Node* Node::pseudoAwarePreviousSibling() const 942 1001 { -
releases/WebKitGTK/webkit-2.12/Source/WebCore/dom/Node.h
r199997 r200851 791 791 } 792 792 793 Node* commonAncestor(Node&, Node&); 794 Node* commonAncestorCrossingShadowBoundary(Node&, Node&); 795 793 796 } // namespace WebCore 794 797 -
releases/WebKitGTK/webkit-2.12/Source/WebCore/page/EventHandler.cpp
r200846 r200851 1947 1947 } 1948 1948 1949 static Node* targetNodeForClickEvent(Node* mousePressNode, Node* mouseReleaseNode)1950 {1951 if (!mousePressNode || !mouseReleaseNode)1952 return nullptr;1953 1954 if (mousePressNode == mouseReleaseNode)1955 return mouseReleaseNode;1956 1957 Element* mouseReleaseShadowHost = mouseReleaseNode->shadowHost();1958 if (mouseReleaseShadowHost && mouseReleaseShadowHost == mousePressNode->shadowHost()) {1959 // We want to dispatch the click to the shadow tree host element to give listeners the illusion that the1960 // shadom tree is a single element. For example, we want to give the illusion that <input type="range">1961 // is a single element even though it is a composition of multiple shadom tree elements.1962 return mouseReleaseShadowHost;1963 }1964 return nullptr;1965 }1966 1967 1949 bool EventHandler::handleMouseReleaseEvent(const PlatformMouseEvent& platformMouseEvent) 1968 1950 { … … 2026 2008 bool contextMenuEvent = platformMouseEvent.button() == RightButton; 2027 2009 2028 Node* nodeToClick = targetNodeForClickEvent(m_clickNode.get(), mouseEvent.targetNode()); 2010 Node* targetNode = mouseEvent.targetNode(); 2011 Node* nodeToClick = (m_clickNode && targetNode) ? commonAncestorCrossingShadowBoundary(*m_clickNode, *targetNode) : nullptr; 2029 2012 bool swallowClickEvent = m_clickCount > 0 && !contextMenuEvent && nodeToClick && !dispatchMouseEvent(eventNames().clickEvent, nodeToClick, true, m_clickCount, platformMouseEvent, true); 2030 2013
Note:
See TracChangeset
for help on using the changeset viewer.