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

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

Issue 2387883002: Use float for scroll offset. (Closed)
Patch Set: Fix README.md Created 4 years, 2 months 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 1779 matching lines...) Expand 10 before | Expand all | Expand 10 after
1790 // In a multiline edit, firstRect.maxY() would end up on the next line, so 1790 // In a multiline edit, firstRect.maxY() would end up on the next line, so
1791 // -1. 1791 // -1.
1792 int y = firstRect.maxY() ? firstRect.maxY() - 1 : 0; 1792 int y = firstRect.maxY() ? firstRect.maxY() - 1 : 0;
1793 locationInRootFrame = view->contentsToRootFrame(IntPoint(x, y)); 1793 locationInRootFrame = view->contentsToRootFrame(IntPoint(x, y));
1794 } else if (focusedElement) { 1794 } else if (focusedElement) {
1795 IntRect clippedRect = focusedElement->boundsInViewport(); 1795 IntRect clippedRect = focusedElement->boundsInViewport();
1796 locationInRootFrame = 1796 locationInRootFrame =
1797 visualViewport.viewportToRootFrame(clippedRect.center()); 1797 visualViewport.viewportToRootFrame(clippedRect.center());
1798 } else { 1798 } else {
1799 locationInRootFrame = IntPoint( 1799 locationInRootFrame = IntPoint(
1800 rightAligned ? visualViewport.visibleRect().maxX() - kContextMenuMargin 1800 rightAligned
1801 : visualViewport.location().x() + kContextMenuMargin, 1801 ? visualViewport.visibleRect().maxX() - kContextMenuMargin
1802 visualViewport.location().y() + kContextMenuMargin); 1802 : visualViewport.scrollOffset().width() + kContextMenuMargin,
1803 visualViewport.scrollOffset().height() + kContextMenuMargin);
1803 } 1804 }
1804 1805
1805 m_frame->view()->setCursor(pointerCursor()); 1806 m_frame->view()->setCursor(pointerCursor());
1806 IntPoint locationInViewport = 1807 IntPoint locationInViewport =
1807 visualViewport.rootFrameToViewport(locationInRootFrame); 1808 visualViewport.rootFrameToViewport(locationInRootFrame);
1808 IntPoint globalPosition = 1809 IntPoint globalPosition =
1809 view->getHostWindow() 1810 view->getHostWindow()
1810 ->viewportToScreen(IntRect(locationInViewport, IntSize()), 1811 ->viewportToScreen(IntRect(locationInViewport, IntSize()),
1811 m_frame->view()) 1812 m_frame->view())
1812 .location(); 1813 .location();
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
2050 } 2051 }
2051 2052
2052 FrameHost* EventHandler::frameHost() const { 2053 FrameHost* EventHandler::frameHost() const {
2053 if (!m_frame->page()) 2054 if (!m_frame->page())
2054 return nullptr; 2055 return nullptr;
2055 2056
2056 return &m_frame->page()->frameHost(); 2057 return &m_frame->page()->frameHost();
2057 } 2058 }
2058 2059
2059 } // namespace blink 2060 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698