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

Unified Diff: Source/core/layout/LayoutTextControlSingleLine.cpp

Issue 1007013002: Make scrollWidth and scrollHeight match other DOM measurement APIs (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add additional test expectation Created 5 years, 8 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 | « Source/core/dom/Element.cpp ('k') | Source/web/WebViewImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutTextControlSingleLine.cpp
diff --git a/Source/core/layout/LayoutTextControlSingleLine.cpp b/Source/core/layout/LayoutTextControlSingleLine.cpp
index ea0a51c6b1e54f8cee33459444cddfc78e2af6f7..68385b95dbe5999df005aa36e89641a9513e23a8 100644
--- a/Source/core/layout/LayoutTextControlSingleLine.cpp
+++ b/Source/core/layout/LayoutTextControlSingleLine.cpp
@@ -390,7 +390,10 @@ LayoutUnit LayoutTextControlSingleLine::scrollWidth() const
// Adjust scrollWidth to inculde input element horizontal paddings and
// decoration width
LayoutUnit adjustment = clientWidth() - inner->clientWidth();
- return innerEditorElement()->scrollWidth() + adjustment;
+ // TODO(leviw): We floor to avoid breaking JS that tries to scroll to
+ // scrollWidth - clientWidth.
+ // TODO(leviw): These values are broken when zooming. crbug.com/471412
+ return inner->scrollWidth().floor() + adjustment;
}
return LayoutBlockFlow::scrollWidth();
}
@@ -401,7 +404,10 @@ LayoutUnit LayoutTextControlSingleLine::scrollHeight() const
// Adjust scrollHeight to include input element vertical paddings and
// decoration height
LayoutUnit adjustment = clientHeight() - inner->clientHeight();
- return innerEditorElement()->scrollHeight() + adjustment;
+ // TODO(leviw): We floor to avoid breaking JS that tries to scroll to
+ // scrollHeight - clientHeight.
+ // TODO(leviw): These values are broken when zooming. crbug.com/471412
+ return inner->scrollHeight().floor() + adjustment;
}
return LayoutBlockFlow::scrollHeight();
}
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698