Changeset 229729 in webkit


Ignore:
Timestamp:
Mar 19, 2018 6:08:53 PM (6 years ago)
Author:
n_wang@apple.com
Message:

AX: embedded attachments do not work correctly with text marker APIs on macOS
https://bugs.webkit.org/show_bug.cgi?id=183751

Reviewed by Chris Fleizach.

In WebKit1, embedded attachments are not working well with text marker APIs.
We should use the corresponding attachment view in the following cases:

  1. Hit testing on an attachment object.
  2. Getting the attachment object at a text marker position.
  3. Asking for the associated element with NSAccessibilityAttachmentTextAttribute.

Not able to construct a layout test because it relies on embedded attachments.

  • accessibility/mac/WebAccessibilityObjectWrapperMac.mm:

(AXAttributeStringSetElement):
(-[WebAccessibilityObjectWrapper accessibilityHitTest:]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r229727 r229729  
     12018-03-19  Nan Wang  <n_wang@apple.com>
     2
     3        AX: embedded attachments do not work correctly with text marker APIs on macOS
     4        https://bugs.webkit.org/show_bug.cgi?id=183751
     5
     6        Reviewed by Chris Fleizach.
     7
     8        In WebKit1, embedded attachments are not working well with text marker APIs.
     9        We should use the corresponding attachment view in the following cases:
     10        1. Hit testing on an attachment object.
     11        2. Getting the attachment object at a text marker position.
     12        3. Asking for the associated element with NSAccessibilityAttachmentTextAttribute.
     13
     14        Not able to construct a layout test because it relies on embedded attachments.
     15
     16        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
     17        (AXAttributeStringSetElement):
     18        (-[WebAccessibilityObjectWrapper accessibilityHitTest:]):
     19        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
     20
    1212018-03-19  Jiewen Tan  <jiewen_tan@apple.com>
    222
  • trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm

    r229500 r229729  
    10161016            return;
    10171017       
    1018         AXUIElementRef axElement = NSAccessibilityCreateAXUIElementRef(object->wrapper());
     1018        id objectWrapper = object->wrapper();
     1019        if ([attribute isEqualToString:NSAccessibilityAttachmentTextAttribute] && object->isAttachment() && [objectWrapper attachmentView])
     1020            objectWrapper = [objectWrapper attachmentView];
     1021       
     1022        AXUIElementRef axElement = NSAccessibilityCreateAXUIElementRef(objectWrapper);
    10191023        if (axElement) {
    10201024            [attrString addAttribute:attribute value:(id)axElement range:range];
     
    33083312    m_object->updateChildrenIfNecessary();
    33093313    RefPtr<AccessibilityObject> axObject = m_object->accessibilityHitTest(IntPoint(point));
    3310     if (axObject)
     3314    if (axObject) {
     3315        if (axObject->isAttachment() && [axObject->wrapper() attachmentView])
     3316            return [axObject->wrapper() attachmentView];
    33113317        return NSAccessibilityUnignoredAncestor(axObject->wrapper());
     3318    }
    33123319    return NSAccessibilityUnignoredAncestor(self);
    33133320}
     
    39923999        if (!axObject)
    39934000            return nil;
     4001        if (axObject->isAttachment() && [axObject->wrapper() attachmentView])
     4002            return [axObject->wrapper() attachmentView];
    39944003        return axObject->wrapper();
    39954004    }
Note: See TracChangeset for help on using the changeset viewer.