[webkit-changes] [WebKit/WebKit] 61e2bf: [macOS] Support rendering native <meter> in vertic...

Aditya Keerthi noreply at github.com
Sat Sep 16 15:23:51 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 61e2bf8a7a108046d848b944f487c665a25bab28
      https://github.com/WebKit/WebKit/commit/61e2bf8a7a108046d848b944f487c665a25bab28
  Author: Aditya Keerthi <akeerthi at apple.com>
  Date:   2023-09-16 (Sat, 16 Sep 2023)

  Changed paths:
    A LayoutTests/fast/forms/vertical-writing-mode/meter-expected.html
    A LayoutTests/fast/forms/vertical-writing-mode/meter.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-writing-modes/forms/meter-appearance-native-computed-style.optional-expected.txt
    M LayoutTests/platform/glib/TestExpectations
    M LayoutTests/platform/ios/TestExpectations
    M LayoutTests/platform/wincairo/TestExpectations
    M Source/WebCore/platform/graphics/controls/ControlPart.cpp
    M Source/WebCore/platform/graphics/controls/PlatformControl.h
    M Source/WebCore/platform/graphics/mac/controls/MeterMac.h
    M Source/WebCore/platform/graphics/mac/controls/MeterMac.mm

  Log Message:
  -----------
  [macOS] Support rendering native <meter> in vertical writing mode
https://bugs.webkit.org/show_bug.cgi?id=261592
rdar://115536577

Reviewed by Tim Nguyen.

* LayoutTests/fast/forms/vertical-writing-mode/meter-expected.html: Added.
* LayoutTests/fast/forms/vertical-writing-mode/meter.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-writing-modes/forms/meter-appearance-native-computed-style.optional-expected.txt:

This is a false failure, as our default size differs from the one that the test
expects. However, the default size is not a spec requirement, nor is it relevant
to the test. This test is currently being updated upstream.

* LayoutTests/platform/glib/TestExpectations:
* LayoutTests/platform/ios/TestExpectations:
* LayoutTests/platform/wincairo/TestExpectations:
* Source/WebCore/platform/graphics/controls/ControlPart.cpp:
(WebCore::ControlPart::sizeForBounds):
* Source/WebCore/platform/graphics/controls/PlatformControl.h:
(WebCore::PlatformControl::sizeForBounds const):
* Source/WebCore/platform/graphics/mac/controls/MeterMac.h:
* Source/WebCore/platform/graphics/mac/controls/MeterMac.mm:
(WebCore::MeterMac::sizeForBounds const):

`NSLevelIndicatorCell` only knows how to size itself horizontally. Transpose the
size to obtain a vertical size.

(WebCore::MeterMac::draw):

Rotate the graphics context by 90 degrees, relative to the top left of the cell
to render `<meter>` with `appearance: auto` with a vertical writing mode.

This approach is viable since the image does not have any shadows or
orientation specific behaviors.

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




More information about the webkit-changes mailing list