Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2a76b69c444ec8b19a4c910069bf62660a09816b
      
https://github.com/WebKit/WebKit/commit/2a76b69c444ec8b19a4c910069bf62660a09816b
  Author: Tyler Wilcock <[email protected]>
  Date:   2026-04-25 (Sat, 25 Apr 2026)

  Changed paths:
    A LayoutTests/accessibility/canvas-drawFocusIfNeeded-bounds-expected.txt
    A 
LayoutTests/accessibility/canvas-drawFocusIfNeeded-bounds-with-object-fit-expected.txt
    A 
LayoutTests/accessibility/canvas-drawFocusIfNeeded-bounds-with-object-fit.html
    A 
LayoutTests/accessibility/canvas-drawFocusIfNeeded-bounds-with-transform-expected.txt
    A 
LayoutTests/accessibility/canvas-drawFocusIfNeeded-bounds-with-transform.html
    A LayoutTests/accessibility/canvas-drawFocusIfNeeded-bounds.html
    M LayoutTests/platform/glib/TestExpectations
    M LayoutTests/platform/ios/TestExpectations
    M LayoutTests/resources/accessibility-helper.js
    M Source/WebCore/accessibility/AXGeometryManager.cpp
    M Source/WebCore/accessibility/AXGeometryManager.h
    M Source/WebCore/accessibility/AXLogger.cpp
    M Source/WebCore/accessibility/AXObjectCache.cpp
    M Source/WebCore/accessibility/AXObjectCache.h
    M Source/WebCore/accessibility/AccessibilityNodeObject.cpp
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp
    M Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp

  Log Message:
  -----------
  AX: VoiceOver cannot position the focus ring correctly element is being 
focused by drawFocusIfNeeded()
https://bugs.webkit.org/show_bug.cgi?id=289189
rdar://146323788

Reviewed by Joshua Hoffman.

When drawFocusIfNeeded() draws a focus ring on a canvas fallback element,
compute the CSS-pixel bounds of the focus path and cache them in the
AXGeometryManager so VoiceOver can position its cursor correctly.

The bounds are converted from canvas backing-store coordinates to CSS pixels
using the ratio of the canvas element's CSS content size to its backing
store size, which handles devicePixelRatio scaling.

On the isolated tree path, clearing getsGeometryFromChildren when a
RelativeFrame is explicitly set ensures canvas fallback elements (which
have no renderer) use the cached frame rather than computing geometry
from their children.

* LayoutTests/accessibility/canvas-drawFocusIfNeeded-bounds-expected.txt: Added.
* LayoutTests/accessibility/canvas-drawFocusIfNeeded-bounds.html: Added.
* LayoutTests/platform/ios/TestExpectations:
* Source/WebCore/accessibility/AXGeometryManager.cpp:
(WebCore::AXGeometryManager::cachedRectForID const):
(WebCore::AXGeometryManager::cachedRectForID): Deleted.
* Source/WebCore/accessibility/AXGeometryManager.h:
* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::performDeferredCacheUpdate):
(WebCore::AXObjectCache::deferCanvasFocusPathBoundsUpdate):
(WebCore::AXObjectCache::cachedBoundsForID const):
(WebCore::AXObjectCache::handleCanvasFocusPathBoundsChange):
* Source/WebCore/accessibility/AXObjectCache.h:
* Source/WebCore/accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::boundingBoxRect const):
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::setProperty):
* Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to