Title: [248463] trunk/Source/WebCore
Revision
248463
Author
[email protected]
Date
2019-08-09 00:17:44 -0700 (Fri, 09 Aug 2019)

Log Message

REGRESSION (iOS 13): united.com web forms do not respond to taps
https://bugs.webkit.org/show_bug.cgi?id=200531

Reviewed by Antti Koivisto and Wenson Hsieh.

The bug is caused by the content change observer detecting “Site Feedback” link at the bottom of
the page (https://www.united.com/ual/en/US/account/enroll/default) constantly getting re-generated
in every frame via requestAnimationFrame when the page is opened with iPhone UA string.
Note that the content re-generation can be reproduced even in Chrome if iPhone UA string is used.

Ignore this constant content change in ContentChangeObserver as a site specific quirk.

In the future, we should make ContentChangeObserver observe the final location of each element
being observed so that we can ignore content that like this which is placed outside the viewport,
and/or far away from where the user tapped.

* page/Quirks.cpp:
(WebCore::Quirks::shouldIgnoreContentChange const): Added.
* page/Quirks.h:
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::shouldObserveVisibilityChangeForElement):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (248462 => 248463)


--- trunk/Source/WebCore/ChangeLog	2019-08-09 05:51:44 UTC (rev 248462)
+++ trunk/Source/WebCore/ChangeLog	2019-08-09 07:17:44 UTC (rev 248463)
@@ -1,3 +1,27 @@
+2019-08-09  Ryosuke Niwa  <[email protected]>
+
+        REGRESSION (iOS 13): united.com web forms do not respond to taps
+        https://bugs.webkit.org/show_bug.cgi?id=200531
+
+        Reviewed by Antti Koivisto and Wenson Hsieh.
+
+        The bug is caused by the content change observer detecting “Site Feedback” link at the bottom of
+        the page (https://www.united.com/ual/en/US/account/enroll/default) constantly getting re-generated
+        in every frame via requestAnimationFrame when the page is opened with iPhone UA string.
+        Note that the content re-generation can be reproduced even in Chrome if iPhone UA string is used.
+
+        Ignore this constant content change in ContentChangeObserver as a site specific quirk.
+
+        In the future, we should make ContentChangeObserver observe the final location of each element
+        being observed so that we can ignore content that like this which is placed outside the viewport,
+        and/or far away from where the user tapped.
+
+        * page/Quirks.cpp:
+        (WebCore::Quirks::shouldIgnoreContentChange const): Added.
+        * page/Quirks.h:
+        * page/ios/ContentChangeObserver.cpp:
+        (WebCore::ContentChangeObserver::shouldObserveVisibilityChangeForElement):
+
 2019-08-08  Devin Rousso  <[email protected]>
 
         Web Inspector: Page: don't allow the domain to be disabled

Modified: trunk/Source/WebCore/page/Quirks.cpp (248462 => 248463)


--- trunk/Source/WebCore/page/Quirks.cpp	2019-08-09 05:51:44 UTC (rev 248462)
+++ trunk/Source/WebCore/page/Quirks.cpp	2019-08-09 07:17:44 UTC (rev 248463)
@@ -410,6 +410,30 @@
 #endif
 }
 
+bool Quirks::shouldIgnoreContentChange(const Element& element) const
+{
+#if PLATFORM(IOS_FAMILY)
+    if (!needsQuirks())
+        return false;
+
+    auto* parentElement = element.parentElement();
+    if (!parentElement || !parentElement->hasClass())
+        return false;
+
+    DOMTokenList& classList = parentElement->classList();
+    if (!classList.contains("feedback") || !classList.contains("feedback-mid"))
+        return false;
+
+    if (!equalLettersIgnoringASCIICase(topPrivatelyControlledDomain(m_document->url().host().toString()), "united.com"))
+        return false;
+
+    return true;
+#else
+    UNUSED_PARAM(element);
+    return false;
+#endif
+}
+
 // FIXME(<rdar://problem/50394969>): Remove after desmos.com adopts inputmode="none".
 bool Quirks::needsInputModeNoneImplicitly(const HTMLElement& element) const
 {

Modified: trunk/Source/WebCore/page/Quirks.h (248462 => 248463)


--- trunk/Source/WebCore/page/Quirks.h	2019-08-09 05:51:44 UTC (rev 248462)
+++ trunk/Source/WebCore/page/Quirks.h	2019-08-09 07:17:44 UTC (rev 248463)
@@ -31,6 +31,7 @@
 namespace WebCore {
 
 class Document;
+class Element;
 class EventTarget;
 class HTMLElement;
 class LayoutUnit;
@@ -55,6 +56,7 @@
     Optional<Event::IsCancelable> simulatedMouseEventTypeForTarget(EventTarget*) const;
 #endif
     bool shouldDisablePointerEventsQuirk() const;
+    bool shouldIgnoreContentChange(const Element&) const;
     bool needsInputModeNoneImplicitly(const HTMLElement&) const;
     bool needsDeferKeyDownAndKeyPressTimersUntilNextEditingCommand() const;
     bool shouldLightenJapaneseBoldSansSerif() const;

Modified: trunk/Source/WebCore/page/ios/ContentChangeObserver.cpp (248462 => 248463)


--- trunk/Source/WebCore/page/ios/ContentChangeObserver.cpp	2019-08-09 05:51:44 UTC (rev 248462)
+++ trunk/Source/WebCore/page/ios/ContentChangeObserver.cpp	2019-08-09 07:17:44 UTC (rev 248463)
@@ -36,6 +36,7 @@
 #include "Logging.h"
 #include "NodeRenderStyle.h"
 #include "Page.h"
+#include "Quirks.h"
 #include "RenderDescendantIterator.h"
 #include "Settings.h"
 
@@ -596,7 +597,7 @@
 
 bool ContentChangeObserver::shouldObserveVisibilityChangeForElement(const Element& element)
 {
-    return isObservingContentChanges() && !hasVisibleChangeState() && !visibleRendererWasDestroyed(element);
+    return isObservingContentChanges() && !hasVisibleChangeState() && !visibleRendererWasDestroyed(element) && !element.document().quirks().shouldIgnoreContentChange(element);
 }
 
 ContentChangeObserver::StyleChangeScope::StyleChangeScope(Document& document, const Element& element)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to