[webkit-changes] [WebKit/WebKit] 9ea2d3: `text-indent` does not affect the selected file la...

Aditya Keerthi noreply at github.com
Tue Jan 9 20:36:57 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9ea2d325ad2d8b885ccb5835763a0773fd2e00ff
      https://github.com/WebKit/WebKit/commit/9ea2d325ad2d8b885ccb5835763a0773fd2e00ff
  Author: Aditya Keerthi <akeerthi at apple.com>
  Date:   2024-01-09 (Tue, 09 Jan 2024)

  Changed paths:
    A LayoutTests/fast/forms/file/file-input-text-indent-expected.html
    A LayoutTests/fast/forms/file/file-input-text-indent.html
    M Source/WebCore/rendering/RenderFileUploadControl.cpp

  Log Message:
  -----------
  `text-indent` does not affect the selected file label for file inputs
https://bugs.webkit.org/show_bug.cgi?id=253463
rdar://105223868

Reviewed by Alan Baradlay.

Sites, such as daum.net, use `text-indent` with a large negative value to hide
the contents (button and selected file label) of file inputs.

However, since the selected file label is not implemented as it's own element,
and is simply custom painted text inside the input element, it does not follow
`text-indent`. This results in the button being moved, but not the text.
Consequently, the text remains in the same position regardless of `text-indent`.

In the longer term, this issue should be fixed by making the selected file label
a real element in the file input's shadow subtree. However, as that is a larger
architectural change, the issue is addressed by honoring `text-indent` when
performing the custom text painting.

* LayoutTests/fast/forms/file/file-input-text-indent-expected.html: Added.
* LayoutTests/fast/forms/file/file-input-text-indent.html: Added.
* Source/WebCore/rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::paintControl):

Note that even after this fix, there is still an interoperability issue with
file inputs in WebKit. Specifically, file inputs in WebKit do not specify
`overflow: hidden`, while others engines do. This means that the button and
selected file label can be painted outside of the element's box when using
`text-indent`. However, while new to the label, this issue already exists for
the button. This interoperability issue should be addressed separately, as
it does not directly affect the known compatibility scenario. Additionally it
is non-trivial to fix, as `overflow: hidden` would clip the button element
inside file inputs in their default configuration. The issue is tracked in
webkit.org/b/267299.

Canonical link: https://commits.webkit.org/272837@main




More information about the webkit-changes mailing list