Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 886a5ee88e7807183ac4743f6750022beec3320e
      
https://github.com/WebKit/WebKit/commit/886a5ee88e7807183ac4743f6750022beec3320e
  Author: Tyler Wilcock <[email protected]>
  Date:   2025-04-23 (Wed, 23 Apr 2025)

  Changed paths:
    A LayoutTests/accessibility/clip-path-bounding-box-expected.txt
    A LayoutTests/accessibility/clip-path-bounding-box.html
    M LayoutTests/accessibility/opacity-0-bounding-box.html
    M LayoutTests/platform/glib/TestExpectations
    M LayoutTests/platform/ios/TestExpectations
    A LayoutTests/platform/ios/accessibility/clip-path-bounding-box-expected.txt
    M LayoutTests/platform/mac-wk1/TestExpectations
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp
    M Source/WebCore/rendering/RenderLayer.cpp

  Log Message:
  -----------
  AX: WebKit doesn't return valid bounding boxes for elements affected by 
clip-path, causing various issues with ATs
https://bugs.webkit.org/show_bug.cgi?id=291959
rdar://149858058

Reviewed by Joshua Hoffman.

It's common for web developers to create a "screenreader-only" CSS class that 
uses clip-path to prevent visual rendering,
but with the expectation that these elements still show up in the accessibility 
tree. Because this type of clipping prevents
these elements from being painted, which we rely on for accessibility geometry, 
we produce invalid bounding boxes for these
elements (zero width and height, very wrong x and y). This can cause various 
issues with ATs like VoiceOver, which may
ignore zero-sized elements, won't draw a cursor for them, etc.

Fix this by not applying clip-path for accessibility paints.

These ".screenreader-only" CSS classes also commonly set a 1px height and 
width. While this is valid, macOS VoiceOver
will not draw a cursor for anything smaller than 2x2px. With this commit, we 
detect this scenario for controls, and
bump the width and height up 1px, ensuring a cursor is drawn for these critical 
UI components.

* LayoutTests/accessibility/clip-path-bounding-box-expected.txt: Added.
* LayoutTests/accessibility/clip-path-bounding-box.html:
* LayoutTests/accessibility/opacity-0-bounding-box.html: Fix a few small issues.
* LayoutTests/platform/glib/TestExpectations: Disable new test.
* LayoutTests/platform/ios/TestExpectations: Enable new test.
* LayoutTests/platform/ios/accessibility/clip-path-bounding-box-expected.txt: 
Added.
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::relativeFrame const):
* Source/WebCore/rendering/RenderLayer.cpp:
(WebCore::RenderLayer::setupClipPath):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to