Changeset 166224 in webkit
- Timestamp:
- Mar 24, 2014 11:34:30 PM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r166213 r166224 1 2014-03-24 Chris Fleizach <cfleizach@apple.com> 2 3 AX: hit-testing doesn't always work correctly with WK2 4 https://bugs.webkit.org/show_bug.cgi?id=130706 5 6 Reviewed by Simon Fraser. 7 8 Accessibility code was trying to do screenToRootView itself, and in 9 some cases with embedded WK2 views that did not work. 10 11 * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: 12 (-[WKAccessibilityWebPageObject accessibilityHitTest:]): 13 1 14 2014-03-24 Benjamin Poulain <bpoulain@apple.com> 2 15 -
trunk/Source/WebKit2/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm
r165170 r166224 194 194 - (id)accessibilityHitTest:(NSPoint)point 195 195 { 196 // Hit-test point comes in as bottom-screen coordinates. Needs to be normalized to the frame of the web page. 197 NSPoint remotePosition = [[self accessibilityAttributeValue:NSAccessibilityPositionAttribute] pointValue]; 198 NSSize remoteSize = [[self accessibilityAttributeValue:NSAccessibilitySizeAttribute] sizeValue]; 199 200 // Get the y position of the WKView (we have to screen-flip and go from bottom left to top left). 201 CGFloat screenHeight = [(NSScreen *)[[NSScreen screens] objectAtIndex:0] frame].size.height; 202 remotePosition.y = (screenHeight - remotePosition.y) - remoteSize.height; 203 204 point.y = screenHeight - point.y; 205 206 // Re-center point into the web page's frame. 207 point.y -= remotePosition.y; 208 point.x -= remotePosition.x; 209 210 WebCore::FrameView* frameView = m_page ? m_page->mainFrameView() : 0; 211 if (frameView) { 212 point.y += frameView->scrollPosition().y(); 213 point.x += frameView->scrollPosition().x(); 214 } 215 216 return [[self accessibilityRootObjectWrapper] accessibilityHitTest:point]; 196 if (!m_page) 197 return nil; 198 199 IntPoint convertedPoint = m_page->screenToRootView(IntPoint(point)); 200 if (WebCore::FrameView* frameView = m_page->mainFrameView()) 201 convertedPoint.moveBy(frameView->scrollPosition()); 202 203 return [[self accessibilityRootObjectWrapper] accessibilityHitTest:convertedPoint]; 217 204 } 218 205 #pragma clang diagnostic pop
Note: See TracChangeset
for help on using the changeset viewer.