Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Side by Side Diff: third_party/WebKit/Source/core/input/EventHandler.cpp

Issue 2523903002: Document::updateHoverActiveState only cancel hover and active state when hitting native scrollbar (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 // the user can't have intentionally clicked on something belonging to this 267 // the user can't have intentionally clicked on something belonging to this
268 // page. Furthermore, mousemove events before the first layout should not 268 // page. Furthermore, mousemove events before the first layout should not
269 // lead to a premature layout() happening, which could show a flash of white. 269 // lead to a premature layout() happening, which could show a flash of white.
270 // See also the similar code in Document::performMouseEventHitTest. 270 // See also the similar code in Document::performMouseEventHitTest.
271 if (m_frame->contentLayoutItem().isNull() || !m_frame->view() || 271 if (m_frame->contentLayoutItem().isNull() || !m_frame->view() ||
272 !m_frame->view()->didFirstLayout()) 272 !m_frame->view()->didFirstLayout())
273 return result; 273 return result;
274 274
275 m_frame->contentLayoutItem().hitTest(result); 275 m_frame->contentLayoutItem().hitTest(result);
276 if (!request.readOnly()) { 276 if (!request.readOnly()) {
277 m_frame->document()->updateHoverActiveState(request, result.innerElement(), 277 m_frame->document()->updateHoverActiveState(
278 result.scrollbar()); 278 request, result.innerElement(),
279 result.scrollbar() && result.scrollbar()->isOverlayScrollbar());
279 } 280 }
280 281
281 return result; 282 return result;
282 } 283 }
283 284
284 void EventHandler::stopAutoscroll() { 285 void EventHandler::stopAutoscroll() {
285 m_scrollManager->stopAutoscroll(); 286 m_scrollManager->stopAutoscroll();
286 } 287 }
287 288
288 // TODO(bokan): This should be merged with logicalScroll assuming 289 // TODO(bokan): This should be merged with logicalScroll assuming
(...skipping 1562 matching lines...) Expand 10 before | Expand all | Expand 10 after
1851 1852
1852 Node* targetNode = 1853 Node* targetNode =
1853 overrideTargetElement ? overrideTargetElement : doc->focusedElement(); 1854 overrideTargetElement ? overrideTargetElement : doc->focusedElement();
1854 if (!targetNode) 1855 if (!targetNode)
1855 targetNode = doc; 1856 targetNode = doc;
1856 1857
1857 // Use the focused node as the target for hover and active. 1858 // Use the focused node as the target for hover and active.
1858 HitTestRequest request(HitTestRequest::Active); 1859 HitTestRequest request(HitTestRequest::Active);
1859 HitTestResult result(request, locationInRootFrame); 1860 HitTestResult result(request, locationInRootFrame);
1860 result.setInnerNode(targetNode); 1861 result.setInnerNode(targetNode);
1861 doc->updateHoverActiveState(request, result.innerElement(), 1862 doc->updateHoverActiveState(
1862 result.scrollbar()); 1863 request, result.innerElement(),
1864 result.scrollbar() && result.scrollbar()->isOverlayScrollbar());
1863 1865
1864 // The contextmenu event is a mouse event even when invoked using the 1866 // The contextmenu event is a mouse event even when invoked using the
1865 // keyboard. This is required for web compatibility. 1867 // keyboard. This is required for web compatibility.
1866 PlatformEvent::EventType eventType = PlatformEvent::MousePressed; 1868 PlatformEvent::EventType eventType = PlatformEvent::MousePressed;
1867 if (m_frame->settings() && m_frame->settings()->showContextMenuOnMouseUp()) 1869 if (m_frame->settings() && m_frame->settings()->showContextMenuOnMouseUp())
1868 eventType = PlatformEvent::MouseReleased; 1870 eventType = PlatformEvent::MouseReleased;
1869 1871
1870 PlatformMouseEvent mouseEvent( 1872 PlatformMouseEvent mouseEvent(
1871 locationInRootFrame, globalPosition, 1873 locationInRootFrame, globalPosition,
1872 WebPointerProperties::Button::NoButton, eventType, /* clickCount */ 0, 1874 WebPointerProperties::Button::NoButton, eventType, /* clickCount */ 0,
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1919 ASSERT(m_frame->document()); 1921 ASSERT(m_frame->document());
1920 1922
1921 if (LayoutViewItem layoutItem = m_frame->contentLayoutItem()) { 1923 if (LayoutViewItem layoutItem = m_frame->contentLayoutItem()) {
1922 if (FrameView* view = m_frame->view()) { 1924 if (FrameView* view = m_frame->view()) {
1923 HitTestRequest request(HitTestRequest::Move); 1925 HitTestRequest request(HitTestRequest::Move);
1924 HitTestResult result(request, 1926 HitTestResult result(request,
1925 view->rootFrameToContents( 1927 view->rootFrameToContents(
1926 m_mouseEventManager->lastKnownMousePosition())); 1928 m_mouseEventManager->lastKnownMousePosition()));
1927 layoutItem.hitTest(result); 1929 layoutItem.hitTest(result);
1928 m_frame->document()->updateHoverActiveState( 1930 m_frame->document()->updateHoverActiveState(
1929 request, result.innerElement(), result.scrollbar()); 1931 request, result.innerElement(),
1932 result.scrollbar() && result.scrollbar()->isOverlayScrollbar());
1930 } 1933 }
1931 } 1934 }
1932 } 1935 }
1933 1936
1934 void EventHandler::activeIntervalTimerFired(TimerBase*) { 1937 void EventHandler::activeIntervalTimerFired(TimerBase*) {
1935 TRACE_EVENT0("input", "EventHandler::activeIntervalTimerFired"); 1938 TRACE_EVENT0("input", "EventHandler::activeIntervalTimerFired");
1936 m_activeIntervalTimer.stop(); 1939 m_activeIntervalTimer.stop();
1937 1940
1938 if (m_frame && m_frame->document() && m_lastDeferredTapElement) { 1941 if (m_frame && m_frame->document() && m_lastDeferredTapElement) {
1939 // FIXME: Enable condition when http://crbug.com/226842 lands 1942 // FIXME: Enable condition when http://crbug.com/226842 lands
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
2102 } 2105 }
2103 2106
2104 FrameHost* EventHandler::frameHost() const { 2107 FrameHost* EventHandler::frameHost() const {
2105 if (!m_frame->page()) 2108 if (!m_frame->page())
2106 return nullptr; 2109 return nullptr;
2107 2110
2108 return &m_frame->page()->frameHost(); 2111 return &m_frame->page()->frameHost();
2109 } 2112 }
2110 2113
2111 } // namespace blink 2114 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698