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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 527003002: Improve text inputs focusing behaviour (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix build error Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index 0a3b0633fb540b0c6557f06cfbba6271216ae32e..22bb8081413a3e661ad3d592a3473c3d772cd5a5 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -2727,6 +2727,7 @@ void WebViewImpl::computeScaleAndScrollForFocusedNode(Node* focusedNode, float&
// the caret height will become minReadableCaretHeight (adjusted for dpi
// and font scale factor).
newScale = clampPageScaleFactorToLimits(legibleScale() * minReadableCaretHeight / caret.height);
+ newScale = std::max(newScale, pageScaleFactor());
const float deltaScale = newScale / pageScaleFactor();
// Convert the rects to absolute space in the new scale.
@@ -2765,6 +2766,7 @@ void WebViewImpl::computeScaleAndScrollForFocusedNode(Node* focusedNode, float&
needAnimation = true;
// If the caret is offscreen, then animate.
IntRect sizeRect(0, 0, viewWidth, viewHeight);
+ sizeRect.scale(newScale / pageScaleFactor());
if (!sizeRect.contains(caret))
needAnimation = true;
// If the box is partially offscreen and it's possible to bring it fully
« no previous file with comments | « no previous file | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698