Changeset 143148 in webkit
- Timestamp:
- Feb 17, 2013 10:31:19 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r143144 r143148 1 2013-02-17 Mike West <mkwst@chromium.org> 2 3 WheelEvent should not target text nodes. 4 https://bugs.webkit.org/show_bug.cgi?id=109939 5 6 Reviewed by Darin Adler. 7 8 * fast/events/wheelevent-in-text-node-expected.txt: Added. 9 * fast/events/wheelevent-in-text-node.html: Added. 10 1 11 2013-02-17 Philip Rogers <pdr@google.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r143147 r143148 1 2013-02-17 Mike West <mkwst@chromium.org> 2 3 WheelEvent should not target text nodes. 4 https://bugs.webkit.org/show_bug.cgi?id=109939 5 6 Reviewed by Darin Adler. 7 8 WheelEvent, like other mouse events, should not target text nodes. 9 EventHandler correctly handles other mouse events by retargeting 10 events to text nodes' parents; this patch adds that logic to the 11 WheelEvent handler. 12 13 This should allow jQuery to stop working around WebKit's behavior[1]. 14 15 [1]: https://github.com/jquery/jquery/commit/c61150427fc8ccc8e884df8f221a6c9bb5477929 16 17 Test: fast/events/wheelevent-in-text-node.html 18 19 * page/EventHandler.cpp: 20 (WebCore::EventHandler::handleWheelEvent): 21 If a WheelEvent's hit test lands on a text node, retarget the 22 event to the text node's parent. Do this before latching the node. 23 1 24 2013-02-17 Filip Pizlo <fpizlo@apple.com> 2 25 -
trunk/Source/WebCore/page/EventHandler.cpp
r142977 r143148 2324 2324 LayoutPoint vPoint = view->windowToContents(e.position()); 2325 2325 2326 Node* node;2327 bool isOverWidget;2328 2329 2326 HitTestRequest request(HitTestRequest::ReadOnly); 2330 2327 HitTestResult result(vPoint); … … 2333 2330 bool useLatchedWheelEventNode = e.useLatchedEventNode(); 2334 2331 2332 Node* node = result.innerNode(); 2333 // Wheel events should not dispatch to text nodes. 2334 if (node && node->isTextNode()) { 2335 AncestorChainWalker walker(node); 2336 walker.parent(); 2337 node = walker.get(); 2338 } 2339 2340 bool isOverWidget; 2335 2341 if (useLatchedWheelEventNode) { 2336 2342 if (!m_latchedWheelEventNode) { 2337 m_latchedWheelEventNode = result.innerNode();2343 m_latchedWheelEventNode = node; 2338 2344 m_widgetIsLatched = result.isOverWidget(); 2339 } 2340 2341 node = m_latchedWheelEventNode.get(); 2345 } else 2346 node = m_latchedWheelEventNode.get(); 2347 2342 2348 isOverWidget = m_widgetIsLatched; 2343 2349 } else { … … 2347 2353 m_previousWheelScrolledNode = 0; 2348 2354 2349 node = result.innerNode();2350 2355 isOverWidget = result.isOverWidget(); 2351 2356 }
Note: See TracChangeset
for help on using the changeset viewer.