[webkit-changes] [WebKit/WebKit] 7590b2: Safari input elements don't respect line-heights s...

Alan Baradlay noreply at github.com
Thu Jun 1 11:49:11 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7590b24a0d0211ea2819e7885d8c4cb071dd11b5
      https://github.com/WebKit/WebKit/commit/7590b24a0d0211ea2819e7885d8c4cb071dd11b5
  Author: Alan Baradlay <zalan at apple.com>
  Date:   2023-06-01 (Thu, 01 Jun 2023)

  Changed paths:
    M LayoutTests/TestExpectations
    A LayoutTests/fast/forms/single-text-line-content-clipping-expected.html
    A LayoutTests/fast/forms/single-text-line-content-clipping.html
    A LayoutTests/fast/forms/textfield-overflow-by-value-update-expected.html
    R LayoutTests/fast/forms/textfield-overflow-by-value-update-expected.png
    R LayoutTests/fast/forms/textfield-overflow-by-value-update-expected.txt
    M LayoutTests/fast/forms/textfield-overflow-by-value-update.html
    R LayoutTests/platform/gtk/fast/forms/textfield-overflow-by-value-update-expected.txt
    M LayoutTests/platform/ios/TestExpectations
    A LayoutTests/platform/ios/editing/editable-region/overflow-scroll-text-field-and-contenteditable-expected.txt
    A LayoutTests/platform/ios/editing/editable-region/text-field-basic-expected.txt
    A LayoutTests/platform/ios/editing/editable-region/text-field-inside-composited-negative-z-index-layer-expected.txt
    M LayoutTests/platform/ios/fast/forms/textfield-overflow-expected.txt
    M LayoutTests/platform/mac/fast/forms/search-vertical-alignment-expected.txt
    M LayoutTests/platform/mac/fast/forms/textfield-overflow-expected.txt
    M Source/WebCore/rendering/RenderTextControlSingleLine.cpp
    M Source/WebCore/rendering/RenderTextControlSingleLine.h

  Log Message:
  -----------
  Safari input elements don't respect line-heights smaller than 'normal'.
https://bugs.webkit.org/show_bug.cgi?id=167209

Reviewed by Simon Fraser.

Center and clip the inner text renderer when it is not enclosed in a "container content".
Container content is triggered by input types that are slightly more complex than "type: text".

It ensures that placeholder and the actual content are positioned and clipped the same way.
e.g.

  <input type="text" placeholder="centered">
  <input type="text" value="centered">

They should produce the same rendering (provided same color is set).

* LayoutTests/fast/forms/single-text-line-content-clipping-expected.html: Added.
* LayoutTests/fast/forms/single-text-line-content-clipping.html: Added.
* Source/WebCore/rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::layout):
(WebCore::RenderTextControlSingleLine::hasControlClip const):
(WebCore::RenderTextControlSingleLine::centerRenderer const): Deleted.
* Source/WebCore/rendering/RenderTextControlSingleLine.h:

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




More information about the webkit-changes mailing list