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

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

Issue 1516723003: [Element / Autofill] Add boundsInViewportFloat() to fix <input> popup misalignment. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refator to use boundsInViewportFloat() eventually, but keep boundsInViewportInt(). Created 5 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 reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 2958 matching lines...) Expand 10 before | Expand all | Expand 10 after
2969 VisualViewport& visualViewport = m_frame->page()->frameHost().visualViewport (); 2969 VisualViewport& visualViewport = m_frame->page()->frameHost().visualViewport ();
2970 2970
2971 if (!overrideTargetElement && start.anchorNode() && (selection.rootEditableE lement() || selection.isRange())) { 2971 if (!overrideTargetElement && start.anchorNode() && (selection.rootEditableE lement() || selection.isRange())) {
2972 IntRect firstRect = m_frame->editor().firstRectForRange(selection.select ion().toNormalizedEphemeralRange()); 2972 IntRect firstRect = m_frame->editor().firstRectForRange(selection.select ion().toNormalizedEphemeralRange());
2973 2973
2974 int x = rightAligned ? firstRect.maxX() : firstRect.x(); 2974 int x = rightAligned ? firstRect.maxX() : firstRect.x();
2975 // In a multiline edit, firstRect.maxY() would endup on the next line, s o -1. 2975 // In a multiline edit, firstRect.maxY() would endup on the next line, s o -1.
2976 int y = firstRect.maxY() ? firstRect.maxY() - 1 : 0; 2976 int y = firstRect.maxY() ? firstRect.maxY() - 1 : 0;
2977 locationInRootFrame = view->contentsToRootFrame(IntPoint(x, y)); 2977 locationInRootFrame = view->contentsToRootFrame(IntPoint(x, y));
2978 } else if (focusedElement) { 2978 } else if (focusedElement) {
2979 IntRect clippedRect = focusedElement->boundsInViewport(); 2979 IntRect clippedRect = focusedElement->boundsInViewportInt();
2980 locationInRootFrame = visualViewport.viewportToRootFrame(clippedRect.cen ter()); 2980 locationInRootFrame = visualViewport.viewportToRootFrame(clippedRect.cen ter());
2981 } else { 2981 } else {
2982 locationInRootFrame = IntPoint( 2982 locationInRootFrame = IntPoint(
2983 rightAligned 2983 rightAligned
2984 ? visualViewport.visibleRect().maxX() - kContextMenuMargin 2984 ? visualViewport.visibleRect().maxX() - kContextMenuMargin
2985 : visualViewport.location().x() + kContextMenuMargin, 2985 : visualViewport.location().x() + kContextMenuMargin,
2986 visualViewport.location().y() + kContextMenuMargin); 2986 visualViewport.location().y() + kContextMenuMargin);
2987 } 2987 }
2988 2988
2989 m_frame->view()->setCursor(pointerCursor()); 2989 m_frame->view()->setCursor(pointerCursor());
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after
4137 PlatformEvent::Modifiers EventHandler::accessKeyModifiers() 4137 PlatformEvent::Modifiers EventHandler::accessKeyModifiers()
4138 { 4138 {
4139 #if OS(MACOSX) 4139 #if OS(MACOSX)
4140 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo rmEvent::AltKey); 4140 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo rmEvent::AltKey);
4141 #else 4141 #else
4142 return PlatformEvent::AltKey; 4142 return PlatformEvent::AltKey;
4143 #endif 4143 #endif
4144 } 4144 }
4145 4145
4146 } // namespace blink 4146 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | third_party/WebKit/Source/platform/Widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698