AX: AXFrameGeometry should work for scrolling inside iframes#62325
Conversation
|
EWS run on previous version of this PR (hash 681610b) Details
|
681610b to
5b5ddbc
Compare
|
EWS run on previous version of this PR (hash 5b5ddbc) Details
|
minorninth
left a comment
There was a problem hiding this comment.
Could you add/update comments to the definition of FrameGeometry in AXObjectCache.h? Things to maybe define could include:
- Origin (top-left vs bottom-left on Mac?)
- Units (display pixels, CSS pixels)
- Relative to?
- Takes scroll into account?
I also wonder if that should also be named AXFrameGeometry, since it's referenced in a lot of non-AX code and I wouldn't want people confusing it with other general-purpose structs.
| } | ||
| } | ||
|
|
||
| void WebPageProxy::applyFrameScreenPosition(FrameIdentifier frameID, const FloatRect& rootViewRect) |
There was a problem hiding this comment.
This is an accessibility-specific function, it should maybe have accessibility in the name
There was a problem hiding this comment.
Good idea! Addressed this, and your other comment, in my latest update
5b5ddbc to
28902a6
Compare
|
EWS run on previous version of this PR (hash 28902a6) Details
|
28902a6 to
4d2831c
Compare
|
EWS run on current version of this PR (hash 4d2831c) Details
|
https://bugs.webkit.org/show_bug.cgi?id=311763 rdar://174356334 Reviewed by Tyler Wilcock. This PR fixes AXFrameGeometry to be more accurate in more cases. Prior, we were not accurately computing the screen position for elements that were within a scrolled iframe. This was due to double-applying the scroll position, via using contentsToView in AXFrameGeometry + the relative frame, both of which applied the scroll position. Now, we have much simpler math when computing screen position: - AXFrameGeometry.screenPosition: the is the position of that frame *including* scroll (which means, that the position is not necessarily the top left corner of the frame, since it may be scrolled, but rather the position of the top left of that document). - ElementRect: this is just the position of an element (without sccroll applied) relative to the top left corner of it's document. By adding these together, we can correctly compute the screen position, including when it is nested. I've added two tests to verify this behavior. Tests: accessibility/mac/iframe-content-position-after-inner-scroll.html accessibility/mac/iframe-nested-scroll-position.html * LayoutTests/accessibility/mac/iframe-content-position-after-inner-scroll-expected.txt: Added. * LayoutTests/accessibility/mac/iframe-content-position-after-inner-scroll.html: Added. * LayoutTests/accessibility/mac/iframe-nested-scroll-position-expected.txt: Added. * LayoutTests/accessibility/mac/iframe-nested-scroll-position.html: Added. * LayoutTests/accessibility/mac/iframe-position-after-div-move.html: * LayoutTests/accessibility/mac/iframe-position-after-scroll.html: * LayoutTests/resources/accessibility-helper.js: * Source/WebCore/accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::setFrameGeometry): (WebCore::AXObjectCache::getAndUpdateFrameGeometry): * Source/WebCore/accessibility/AXObjectCache.h: * Source/WebCore/accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::convertFrameToSpace const): * Source/WebCore/accessibility/AccessibilityScrollView.cpp: (WebCore::AccessibilityScrollView::frameGeometry const): * Source/WebCore/accessibility/AccessibilityScrollView.h: * Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::convertFrameToSpace const): * Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::create): (WebCore::AXIsolatedTree::setFrameGeometry): (WebCore::AXIsolatedTree::updateRootScreenRelativePosition): * Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h: (WebCore::AXIsolatedTree::frameGeometry const): * Source/WebCore/rendering/AccessibilityRegionContext.cpp: (WebCore::AccessibilityRegionContext::takeBoundsInternal): (WebCore::AccessibilityRegionContext::takeBounds): (WebCore::AccessibilityRegionContext::onPaint): * Source/WebKit/Scripts/webkit/messages.py: (headers_for_type): * Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in: * Source/WebKit/UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestFrameScreenPosition): (WebKit::WebPageProxy::applyAccessibilityFrameScreenPosition): * Source/WebKit/UIProcess/WebPageProxy.h: * Source/WebKit/WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updateRemotePageAccessibilityScreenPosition): (WebKit::WebPage::didChangeScrollOffsetForFrame): * Source/WebKit/WebProcess/WebPage/WebPage.h: * Source/WebKit/WebProcess/WebPage/WebPage.messages.in: Canonical link: https://commits.webkit.org/310935@main
4d2831c to
5a72101
Compare
|
Committed 310935@main (5a72101): https://commits.webkit.org/310935@main Reviewed commits have been landed. Closing PR #62325 and removing active labels. |
🛠 mac-apple
5a72101
4d2831c
🛠 win🧪 win-tests🛠 ios-safer-cpp🛠 playstation