[Webkit-unassigned] [Bug 129643] New: AX: Refactor code in WKAccessibilityWebPageObjectMac to use existing viewToScreenMethods
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Mar 3 17:03:12 PST 2014
https://bugs.webkit.org/show_bug.cgi?id=129643
Summary: AX: Refactor code in WKAccessibilityWebPageObjectMac
to use existing viewToScreenMethods
Product: WebKit
Version: 528+ (Nightly build)
Platform: All
OS/Version: All
Status: NEW
Severity: Normal
Priority: P2
Component: Accessibility
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: cfleizach at apple.com
CC: webkit-bug-importer at group.apple.com
There's a bunch of code in the hit-testing that could probably be reduced by moving to a viewToScreen method
//#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- (id)accessibilityHitTest:(NSPoint)point
{
// Hit-test point comes in as bottom-screen coordinates. Needs to be normalized to the frame of the web page.
NSPoint remotePosition = [[self accessibilityAttributeValue:NSAccessibilityPositionAttribute] pointValue];
NSSize remoteSize = [[self accessibilityAttributeValue:NSAccessibilitySizeAttribute] sizeValue];
// Get the y position of the WKView (we have to screen-flip and go from bottom left to top left).
CGFloat screenHeight = [(NSScreen *)[[NSScreen screens] objectAtIndex:0] frame].size.height;
remotePosition.y = (screenHeight - remotePosition.y) - remoteSize.height;
point.y = screenHeight - point.y;
// Re-center point into the web page's frame.
point.y -= remotePosition.y;
point.x -= remotePosition.x;
WebCore::FrameView* frameView = m_page ? m_page->mainFrameView() : 0;
if (frameView) {
point.y += frameView->scrollPosition().y();
point.x += frameView->scrollPosition().x();
}
return [[self accessibilityRootObjectWrapper] accessibilityHitTest:point];
}
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list