[webkit-changes] [WebKit/WebKit] 5cf446: [macOS] Form controls with visual overflow and `wr...

Aditya Keerthi noreply at github.com
Mon Jan 8 21:40:55 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5cf446ee596f18fe1365d20d7bbe064667fb734d
      https://github.com/WebKit/WebKit/commit/5cf446ee596f18fe1365d20d7bbe064667fb734d
  Author: Aditya Keerthi <akeerthi at apple.com>
  Date:   2024-01-08 (Mon, 08 Jan 2024)

  Changed paths:
    A LayoutTests/fast/repaint/checkbox-overflow-vertical-rl-expected.txt
    A LayoutTests/fast/repaint/checkbox-overflow-vertical-rl.html
    A LayoutTests/fast/repaint/switch-overflow-vertical-rl-expected.txt
    A LayoutTests/fast/repaint/switch-overflow-vertical-rl.html
    A LayoutTests/platform/gtk/fast/repaint/checkbox-overflow-vertical-rl-expected.txt
    A LayoutTests/platform/gtk/fast/repaint/switch-overflow-vertical-rl-expected.txt
    M Source/WebCore/accessibility/AccessibilityObject.cpp
    M Source/WebCore/rendering/RenderTheme.h
    M Source/WebCore/rendering/RenderThemeMac.h
    M Source/WebCore/rendering/RenderThemeMac.mm

  Log Message:
  -----------
  [macOS] Form controls with visual overflow and `writing-mode: vertical-rl` do not fully repaint
https://bugs.webkit.org/show_bug.cgi?id=266532
rdar://120066970

Reviewed by Richard Robinson.

Due to AppKit's fixed sizes for controls, many controls in macOS WebKit have
visual overflow. For example, a checkbox with a 5px x 5px box size, will
actually paint a 10px x 10px control. In order to ensure that repaint works
correctly for these controls, the rect used for repaint is inflated to match
the control size.

Support for vertical form controls was recently turned on. However, the method
to adjust the repaint rect does not account for flipped block writing modes.
Instead, the method currently always returns a visual rect ignoring the block
direction. This is incorrect, as the rest of the visual overflow code expects a
visual rect account for the block direction.

Fix by flipping the inflated rect based on the block direction.

* LayoutTests/fast/repaint/checkbox-overflow-vertical-rl-expected.txt: Added.
* LayoutTests/fast/repaint/checkbox-overflow-vertical-rl.html: Added.
* LayoutTests/fast/repaint/switch-overflow-vertical-rl-expected.txt: Added.
* LayoutTests/fast/repaint/switch-overflow-vertical-rl.html: Added.
* LayoutTests/platform/gtk/fast/repaint/checkbox-overflow-vertical-rl-expected.txt: Added.
* LayoutTests/platform/gtk/fast/repaint/switch-overflow-vertical-rl-expected.txt: Added.
* Source/WebCore/accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::boundingBoxForQuads):

This accessibility method expects a rect ignoring the block direction.

* Source/WebCore/rendering/RenderTheme.h:
(WebCore::RenderTheme::inflateRectForControlRenderer):
(WebCore::RenderTheme::adjustRepaintRect):
* Source/WebCore/rendering/RenderThemeMac.h:
* Source/WebCore/rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::inflateRectForControlRenderer):

Introduce a new method to inflate the rect ignoring block direction. This is
used directly by the accessibility code.

(WebCore::RenderThemeMac::adjustRepaintRect):

Flip the inflated rect based on the block direction.

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




More information about the webkit-changes mailing list