Hitpoint for link which spans two lines in web content is incorrect
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 May 2019 22:33:52 +0000 (22:33 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 May 2019 22:33:52 +0000 (22:33 +0000)
commita62784a5e8bb08ec4a6ca5f2d455edf86b744f26
tree0599718d355333582dc2946c9d1696bbaa75422d
parentc3d3c27a14669b1ac3ede1fe823c17085bbb4aa1
Hitpoint for link which spans two lines in web content is incorrect
https://bugs.webkit.org/show_bug.cgi?id=197511
<rdar://problem/49971483>

Patch by Andres Gonzalez <andresg_22@apple.com> on 2019-05-06
Reviewed by Chris Fleizach.

Source/WebCore:

- Special case for links to return first char location as clickPoint instead of middle point of bounding rect.
- Modified iOS ActivationPoint to use clickPoint. This way all code paths go through the same function.
- Made boundsForRects to return content coordinates in all platforms. Adjusted all callers, directly or indirectly, appropriately.

Tests: accessibility/ios-simulator/links-activation.html
       accessibility/links-activation.html

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::clickPoint):
(WebCore::AccessibilityRenderObject::boundsForRects):
(WebCore::AccessibilityRenderObject::boundsForRects const): Deleted.
* accessibility/AccessibilityRenderObject.h:
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityActivationPoint]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):

LayoutTests:

- Added LayoutTest.

* accessibility/ios-simulator/links-activation-expected.txt: Added.
* accessibility/ios-simulator/links-activation.html: Added.
* accessibility/links-activation-expected.txt: Added.
* accessibility/links-activation.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244983 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/accessibility/ios-simulator/links-activation-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/ios-simulator/links-activation.html [new file with mode: 0644]
LayoutTests/accessibility/links-activation-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/links-activation.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/AccessibilityRenderObject.h
Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm