[webkit-changes] [WebKit/WebKit] 64d1b1: [macOS] Fix input[type=search] rendering in vertic...

Aditya Keerthi noreply at github.com
Wed Nov 8 16:58:24 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 64d1b1b4705a751713e9738ef37d43c7f7731368
      https://github.com/WebKit/WebKit/commit/64d1b1b4705a751713e9738ef37d43c7f7731368
  Author: Aditya Keerthi <akeerthi at apple.com>
  Date:   2023-11-08 (Wed, 08 Nov 2023)

  Changed paths:
    M Source/WebCore/html/shadow/TextControlInnerElements.cpp
    M Source/WebCore/rendering/RenderTheme.cpp
    M Source/WebCore/rendering/RenderTheme.h
    M Source/WebCore/rendering/RenderThemeMac.h
    M Source/WebCore/rendering/RenderThemeMac.mm

  Log Message:
  -----------
  [macOS] Fix input[type=search] rendering in vertical writing mode
https://bugs.webkit.org/show_bug.cgi?id=248334
rdar://102658361

Reviewed by Tim Nguyen.

Native search fields are not height resizable, and have shadows,
preventing their use in vertical writing mode. Instead, fall back
to drawing native text fields, which are height resizable.

Additionally, ensure that the cancel and results buttons are displayed
correctly in vertical writing mode.

* Source/WebCore/html/shadow/TextControlInnerElements.cpp:

253691 at main introduced logic to hide the cancel and results buttons when
authors specify `appearance: textfield` on search inputs. Preserve this
functionality, but also allow cases where the user agent applies
`appearance: textfield` for rendering purposes (in this case, in vertical
writing mode), by comparing `appearance` in addition to `effectiveAppearance`.

(WebCore::searchFieldStyleHasExplicitlySpecifiedTextFieldAppearance):
(WebCore::SearchFieldResultsButtonElement::resolveCustomStyle):
(WebCore::SearchFieldCancelButtonElement::resolveCustomStyle):
* Source/WebCore/rendering/RenderTheme.cpp:
(WebCore::RenderTheme::adjustStyle):

Set an effective appearance of `TextField` for search fields using a vertical
writing mode.

* Source/WebCore/rendering/RenderTheme.h:
(WebCore::RenderTheme::searchFieldShouldAppearAsTextField const):
* Source/WebCore/rendering/RenderThemeMac.h:
* Source/WebCore/rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::searchFieldShouldAppearAsTextField const):
(WebCore::RenderThemeMac::adjustSearchFieldDecorationPartStyle const):

While the results and cancel buttons are not being rotated, ensure there is not
an excessive amount of padding at the logical top of the control in cases where
the results button is hidden.

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




More information about the webkit-changes mailing list