Changeset 244392 in webkit
- Timestamp:
- Apr 17, 2019 11:57:51 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r244388 r244392 1 2019-04-17 Zalan Bujtas <zalan@apple.com> 2 3 [ContentChangeObserver] Use aria role as a hint whether a tap should result in a synthetic click 4 https://bugs.webkit.org/show_bug.cgi?id=196988 5 <rdar://problem/49955328> 6 7 Reviewed by Simon Fraser. 8 9 * fast/events/touch/ios/content-observation/tap-on-input-looking-div-with-role-expected.txt: Added. 10 * fast/events/touch/ios/content-observation/tap-on-input-looking-div-with-role.html: Added. 11 1 12 2019-04-17 Wenson Hsieh <wenson_hsieh@apple.com> 2 13 -
trunk/Source/WebCore/ChangeLog
r244391 r244392 1 2019-04-17 Zalan Bujtas <zalan@apple.com> 2 3 [ContentChangeObserver] Use aria role as a hint whether a tap should result in a synthetic click 4 https://bugs.webkit.org/show_bug.cgi?id=196988 5 <rdar://problem/49955328> 6 7 Reviewed by Simon Fraser. 8 9 Test: fast/events/touch/ios/content-observation/tap-on-input-looking-div-with-role.html 10 11 * accessibility/AccessibilityObject.h: 12 1 13 2019-04-17 Alex Christensen <achristensen@webkit.org> 2 14 -
trunk/Source/WebCore/accessibility/AccessibilityObject.cpp
r244115 r244392 2515 2515 AccessibilityRole AccessibilityObject::ariaRoleToWebCoreRole(const String& value) 2516 2516 { 2517 ASSERT(!value.isEmpty()); 2517 if (value.isNull() || value.isEmpty()) 2518 return AccessibilityRole::Unknown; 2519 2518 2520 for (auto roleName : StringView(value).split(' ')) { 2519 2521 AccessibilityRole role = ariaRoleMap().get<ASCIICaseInsensitiveStringViewHashTranslator>(roleName); -
trunk/Source/WebCore/accessibility/AccessibilityObject.h
r244059 r244392 526 526 virtual int layoutCount() const { return 0; } 527 527 virtual double estimatedLoadingProgress() const { return 0; } 528 static bool isARIAControl(AccessibilityRole);529 static bool isARIAInput(AccessibilityRole);528 WEBCORE_EXPORT static bool isARIAControl(AccessibilityRole); 529 WEBCORE_EXPORT static bool isARIAInput(AccessibilityRole); 530 530 531 531 virtual bool supportsARIAOwns() const { return false; } … … 756 756 AccessibilityObject* firstAnonymousBlockChild() const; 757 757 758 static AccessibilityRole ariaRoleToWebCoreRole(const String&);758 WEBCORE_EXPORT static AccessibilityRole ariaRoleToWebCoreRole(const String&); 759 759 bool hasAttribute(const QualifiedName&) const; 760 760 const AtomicString& getAttribute(const QualifiedName&) const; -
trunk/Source/WebKit/ChangeLog
r244390 r244392 1 2019-04-17 Zalan Bujtas <zalan@apple.com> 2 3 [ContentChangeObserver] Use aria role as a hint whether a tap should result in a synthetic click 4 https://bugs.webkit.org/show_bug.cgi?id=196988 5 <rdar://problem/49955328> 6 7 Reviewed by Simon Fraser. 8 9 Tapping on elements with cretain aria role attributes should trigger synthetic click the same way it does on form control elements. 10 11 * WebProcess/WebPage/ios/WebPageIOS.mm: 12 (WebKit::isAriaRoleForImmediateClick): 13 (WebKit::nodeAlwaysRequiresClick): 14 (WebKit::WebPage::handleSyntheticClick): 15 1 16 2019-04-17 Alex Christensen <achristensen@webkit.org> 2 17 -
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r244356 r244392 567 567 } 568 568 569 static bool nodeAlwaysTriggersClick(const Node& targetNode) 570 { 571 if (!is<Element>(targetNode)) 572 return false; 573 574 if (is<HTMLFormControlElement>(targetNode)) 575 return true; 576 577 auto ariaRole = AccessibilityObject::ariaRoleToWebCoreRole(downcast<Element>(targetNode).getAttribute(HTMLNames::roleAttr)); 578 return AccessibilityObject::isARIAControl(ariaRole) || AccessibilityObject::isARIAInput(ariaRole); 579 } 580 569 581 void WebPage::handleSyntheticClick(Node& nodeRespondingToClick, const WebCore::FloatPoint& location, OptionSet<WebEvent::Modifier> modifiers) 570 582 { … … 588 600 auto& contentChangeObserver = respondingDocument.contentChangeObserver(); 589 601 auto observedContentChange = contentChangeObserver.observedContentChange(); 590 591 auto continueContentObservation = !(observedContentChange == WKContentVisibilityChange || is<HTMLFormControlElement>(nodeRespondingToClick)); 602 auto targetNodeTriggersClick = nodeAlwaysTriggersClick(nodeRespondingToClick); 603 604 auto continueContentObservation = !(observedContentChange == WKContentVisibilityChange || targetNodeTriggersClick); 592 605 if (continueContentObservation) { 593 606 // Wait for callback to completePendingSyntheticClickForContentChangeObserver() to decide whether to send the click event. … … 601 614 } 602 615 603 callOnMainThread([protectedThis = makeRefPtr(this), targetNode = Ref<Node>(nodeRespondingToClick), location, modifiers, observedContentChange ] {616 callOnMainThread([protectedThis = makeRefPtr(this), targetNode = Ref<Node>(nodeRespondingToClick), location, modifiers, observedContentChange, targetNodeTriggersClick] { 604 617 if (protectedThis->m_isClosed || !protectedThis->corePage()) 605 618 return; 606 619 607 auto shouldStayAtHoverState = observedContentChange == WKContentVisibilityChange && ! is<HTMLFormControlElement>(targetNode);620 auto shouldStayAtHoverState = observedContentChange == WKContentVisibilityChange && !targetNodeTriggersClick; 608 621 if (shouldStayAtHoverState) { 609 622 // The move event caused new contents to appear. Don't send synthetic click event, but just ensure that the mouse is on the most recent content.
Note: See TracChangeset
for help on using the changeset viewer.