summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/layout/layout_text_control_single_line.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/blink/renderer/core/layout/layout_text_control_single_line.cc')
-rw-r--r--chromium/third_party/blink/renderer/core/layout/layout_text_control_single_line.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/chromium/third_party/blink/renderer/core/layout/layout_text_control_single_line.cc b/chromium/third_party/blink/renderer/core/layout/layout_text_control_single_line.cc
index 135c0ce4703..2e5726c3993 100644
--- a/chromium/third_party/blink/renderer/core/layout/layout_text_control_single_line.cc
+++ b/chromium/third_party/blink/renderer/core/layout/layout_text_control_single_line.cc
@@ -276,6 +276,11 @@ void LayoutTextControlSingleLine::Autoscroll(const PhysicalOffset& position) {
}
LayoutUnit LayoutTextControlSingleLine::ScrollWidth() const {
+ // If in preview state, fake the scroll width to prevent that any information
+ // about the suggested content can be derived from the size.
+ if (!GetTextControlElement()->SuggestedValue().IsEmpty())
+ return ClientWidth();
+
if (LayoutBox* inner = InnerEditorElement()
? InnerEditorElement()->GetLayoutBox()
: nullptr) {
@@ -288,6 +293,11 @@ LayoutUnit LayoutTextControlSingleLine::ScrollWidth() const {
}
LayoutUnit LayoutTextControlSingleLine::ScrollHeight() const {
+ // If in preview state, fake the scroll height to prevent that any information
+ // about the suggested content can be derived from the size.
+ if (!GetTextControlElement()->SuggestedValue().IsEmpty())
+ return ClientHeight();
+
if (LayoutBox* inner = InnerEditorElement()
? InnerEditorElement()->GetLayoutBox()
: nullptr) {