Title: [250460] trunk/Source
Revision
250460
Author
[email protected]
Date
2019-09-27 14:52:37 -0700 (Fri, 27 Sep 2019)

Log Message

[iPadOS] Can’t use RalphLauren.com on iPad because hover menus don’t stay up
https://bugs.webkit.org/show_bug.cgi?id=202331
<rdar://problem/55629493>

Reviewed by Tim Horton.

Source/WebCore:

Unfortunately the top level menu items now are ARIA labelled as 'buttons' and that triggers the fast path on content observation.
This patch introduces a quirk on ralphLauren.com to ignore the ARIA labels when checking whether the target node should always click through.

* page/Quirks.cpp:
(WebCore::Quirks::shouldIgnoreAriaForFastPathContentObservationCheck const):
* page/Quirks.h:

Source/WebKit:

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
(WebKit::nodeTriggersFastPath): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (250459 => 250460)


--- trunk/Source/WebCore/ChangeLog	2019-09-27 21:05:05 UTC (rev 250459)
+++ trunk/Source/WebCore/ChangeLog	2019-09-27 21:52:37 UTC (rev 250460)
@@ -1,3 +1,18 @@
+2019-09-27  Zalan Bujtas  <[email protected]>
+
+        [iPadOS] Can’t use RalphLauren.com on iPad because hover menus don’t stay up
+        https://bugs.webkit.org/show_bug.cgi?id=202331
+        <rdar://problem/55629493>
+
+        Reviewed by Tim Horton.
+
+        Unfortunately the top level menu items now are ARIA labelled as 'buttons' and that triggers the fast path on content observation.
+        This patch introduces a quirk on ralphLauren.com to ignore the ARIA labels when checking whether the target node should always click through.
+
+        * page/Quirks.cpp:
+        (WebCore::Quirks::shouldIgnoreAriaForFastPathContentObservationCheck const):
+        * page/Quirks.h:
+
 2019-09-27  Per Arne Vollan  <[email protected]>
 
         [Win] Crash under FontCache::lastResortFallbackFont

Modified: trunk/Source/WebCore/page/Quirks.cpp (250459 => 250460)


--- trunk/Source/WebCore/page/Quirks.cpp	2019-09-27 21:05:05 UTC (rev 250459)
+++ trunk/Source/WebCore/page/Quirks.cpp	2019-09-27 21:52:37 UTC (rev 250460)
@@ -555,6 +555,18 @@
     return equalLettersIgnoringASCIICase(host, "att.com") || host.endsWithIgnoringASCIICase(".att.com");
 }
 
+bool Quirks::shouldIgnoreAriaForFastPathContentObservationCheck() const
+{
+#if PLATFORM(IOS_FAMILY)
+    if (!needsQuirks())
+        return false;
+
+    auto host = m_document->url().host();
+    return equalLettersIgnoringASCIICase(host, "www.ralphlauren.com");
+#endif
+    return false;
+}
+
 bool Quirks::shouldOpenAsAboutBlank(const String& stringToOpen) const
 {
 #if PLATFORM(IOS_FAMILY)

Modified: trunk/Source/WebCore/page/Quirks.h (250459 => 250460)


--- trunk/Source/WebCore/page/Quirks.h	2019-09-27 21:05:05 UTC (rev 250459)
+++ trunk/Source/WebCore/page/Quirks.h	2019-09-27 21:52:37 UTC (rev 250460)
@@ -69,6 +69,7 @@
     WEBCORE_EXPORT bool shouldAvoidResizingWhenInputViewBoundsChange() const;
     WEBCORE_EXPORT bool shouldAvoidScrollingWhenFocusedContentIsVisible() const;
     WEBCORE_EXPORT bool shouldUseLegacySelectPopoverDismissalBehaviorInDataActivation() const;
+    WEBCORE_EXPORT bool shouldIgnoreAriaForFastPathContentObservationCheck() const;
 
     WEBCORE_EXPORT bool needsYouTubeMouseOutQuirk() const;
     

Modified: trunk/Source/WebKit/ChangeLog (250459 => 250460)


--- trunk/Source/WebKit/ChangeLog	2019-09-27 21:05:05 UTC (rev 250459)
+++ trunk/Source/WebKit/ChangeLog	2019-09-27 21:52:37 UTC (rev 250460)
@@ -1,3 +1,15 @@
+2019-09-27  Zalan Bujtas  <[email protected]>
+
+        [iPadOS] Can’t use RalphLauren.com on iPad because hover menus don’t stay up
+        https://bugs.webkit.org/show_bug.cgi?id=202331
+        <rdar://problem/55629493>
+
+        Reviewed by Tim Horton.
+
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::handleSyntheticClick):
+        (WebKit::nodeTriggersFastPath): Deleted.
+
 2019-09-27  Alex Christensen  <[email protected]>
 
         Move shouldUseTestingNetworkSession from NetworkProcessCreationParameters to NetworkSessionCreationParameters

Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (250459 => 250460)


--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2019-09-27 21:05:05 UTC (rev 250459)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2019-09-27 21:52:37 UTC (rev 250460)
@@ -600,18 +600,6 @@
     mainFrame.eventHandler().dispatchSyntheticMouseMove(mouseEvent);
 }
 
-static bool nodeTriggersFastPath(const Node& targetNode)
-{
-    if (!is<Element>(targetNode))
-        return false;
-
-    if (is<HTMLFormControlElement>(targetNode))
-        return true;
-
-    auto ariaRole = AccessibilityObject::ariaRoleToWebCoreRole(downcast<Element>(targetNode).getAttribute(HTMLNames::roleAttr));
-    return AccessibilityObject::isARIAControl(ariaRole) || AccessibilityObject::isARIAInput(ariaRole);
-}
-
 void WebPage::generateSyntheticEditingCommand(SyntheticEditingCommandType command)
 {
     PlatformKeyboardEvent keyEvent;
@@ -707,9 +695,19 @@
         return;
     }
 
-    auto observedContentChange = contentChangeObserver.observedContentChange();
+    auto nodeTriggersFastPath = [&](auto& targetNode) {
+        if (!is<Element>(targetNode))
+            return false;
+        if (is<HTMLFormControlElement>(targetNode))
+            return true;
+        if (targetNode.document().quirks().shouldIgnoreAriaForFastPathContentObservationCheck())
+            return false;
+        auto ariaRole = AccessibilityObject::ariaRoleToWebCoreRole(downcast<Element>(targetNode).getAttribute(HTMLNames::roleAttr));
+        return AccessibilityObject::isARIAControl(ariaRole) || AccessibilityObject::isARIAInput(ariaRole);
+    };
     auto targetNodeTriggersFastPath = nodeTriggersFastPath(nodeRespondingToClick);
 
+    auto observedContentChange = contentChangeObserver.observedContentChange();
     auto continueContentObservation = !(observedContentChange == WKContentVisibilityChange || targetNodeTriggersFastPath);
     if (continueContentObservation) {
         // Wait for callback to completePendingSyntheticClickForContentChangeObserver() to decide whether to send the click event.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to