Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 54bd0ad4968ca36a60f6561960c52631efed969b
      
https://github.com/WebKit/WebKit/commit/54bd0ad4968ca36a60f6561960c52631efed969b
  Author: Tyler Wilcock <[email protected]>
  Date:   2025-03-12 (Wed, 12 Mar 2025)

  Changed paths:
    A 
LayoutTests/accessibility/scroll-to-make-visible-empty-bounding-box-element-expected.txt
    A 
LayoutTests/accessibility/scroll-to-make-visible-empty-bounding-box-element.html
    M 
LayoutTests/platform/glib/accessibility/checkbox-radio-element-rect-expected.txt
    M LayoutTests/platform/gtk/accessibility/gtk/xml-roles-exposed-expected.txt
    M Source/WebCore/accessibility/AccessibilityNodeObject.cpp
    M Source/WebCore/accessibility/AccessibilityNodeObject.h
    M Source/WebCore/accessibility/AccessibilityRenderObject.cpp

  Log Message:
  -----------
  AX: Page constantly scrolls up and down when moving VoiceOver focus through 
YouTube comments
https://bugs.webkit.org/show_bug.cgi?id=289569
rdar://146797846

Reviewed by Chris Fleizach.

On YouTube, there is a tooltip custom element with rect {0, 0, 0, 0} (zero 
size, absolutely positioned at the page origin).
This means that when VoiceOver requests scrollToMakeVisible() on it, we scroll 
to the top of the page, then back down
when moving to a "normally" positioned element.

This commit solves the issue by adding a fallback to 
AccessibilityRenderObject::boundingBoxRect when we can't compute
a size for an element. This fallback takes the rect of the nearest ancestor 
with geometry. We actually already had
this fallback in place for AccessibilityNodeObjects, so let's use it for 
AccessibilityRenderObjects too. This is
generally more sensible, as some ATs may ignore elements with empty geometry, 
even though they truly be useful to
expose. It also makes it much less likely for scrolling to flicker as happened 
before this commit.

* 
LayoutTests/accessibility/scroll-to-make-visible-empty-bounding-box-element-expected.txt:
 Added.
* 
LayoutTests/accessibility/scroll-to-make-visible-empty-bounding-box-element.html:
 Added.
* Source/WebCore/accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::boundingBoxRect const):
(WebCore::AccessibilityNodeObject::nonEmptyAncestorBoundingBox const):
* Source/WebCore/accessibility/AccessibilityNodeObject.h:
* Source/WebCore/accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::boundingBoxRect const):

Canonical link: https://commits.webkit.org/292022@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