[webkit-changes] [WebKit/WebKit] a8671d: Placeholder text inside input overflows
Alan Baradlay
noreply at github.com
Tue May 30 11:10:21 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: a8671d24725890e2fe6a387f8a4866f01360b599
https://github.com/WebKit/WebKit/commit/a8671d24725890e2fe6a387f8a4866f01360b599
Author: Alan Baradlay <zalan at apple.com>
Date: 2023-05-30 (Tue, 30 May 2023)
Changed paths:
A LayoutTests/fast/forms/placeholder-content-clipping-expected.html
A LayoutTests/fast/forms/placeholder-content-clipping.html
M Source/WebCore/rendering/RenderTextControlSingleLine.cpp
Log Message:
-----------
Placeholder text inside input overflows
https://bugs.webkit.org/show_bug.cgi?id=257462
Reviewed by Simon Fraser.
1. hasControlClip was initially added at 19393 at main to specifically clip overflowing
magnifier glass/cancel button in search fields.
2. Later at 79370 at main, we slightly changed behavior by switching over to checking !!containerElement().
It expands clipping for other, single line text field types like password -anything with container based shadow DOM.
Placeholder text may be assigned to different type of <input> elements e.g.
<input type="text" placeholder="placeholder text">
<input type="password" placeholder="placeholder text">
and while we build a container based shadow DOM for "password" fields (yes clipping), type="text" initiates a single
inner-text renderer inside RenderTextControlSingleLine (no clipping).
In this patch we expand clipping to all input fields with placeholder text to fix this inconsistency.
* LayoutTests/fast/forms/placeholder-content-clipping-expected.html: Added.
* LayoutTests/fast/forms/placeholder-content-clipping.html: Added.
* Source/WebCore/rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::hasControlClip const):
(WebCore::RenderTextControlSingleLine::controlClipRect const):
Canonical link: https://commits.webkit.org/264684@main
More information about the webkit-changes
mailing list