Title: [248504] branches/safari-608.1-branch/Source/WebCore
Revision
248504
Author
bshaf...@apple.com
Date
2019-08-10 20:01:50 -0700 (Sat, 10 Aug 2019)

Log Message

Cherry-pick r248463. rdar://problem/54139834

    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):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248463 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-608.1-branch/Source/WebCore/ChangeLog (248503 => 248504)


--- branches/safari-608.1-branch/Source/WebCore/ChangeLog	2019-08-10 22:50:19 UTC (rev 248503)
+++ branches/safari-608.1-branch/Source/WebCore/ChangeLog	2019-08-11 03:01:50 UTC (rev 248504)
@@ -1,3 +1,56 @@
+2019-08-10  Babak Shafiei  <bshaf...@apple.com>
+
+        Cherry-pick r248463. rdar://problem/54139834
+
+    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):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248463 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-08-09  Ryosuke Niwa  <rn...@webkit.org>
+
+            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-09  Kocsen Chung  <kocsen_ch...@apple.com>
 
         Cherry-pick r248447. rdar://problem/54109873

Modified: branches/safari-608.1-branch/Source/WebCore/page/Quirks.cpp (248503 => 248504)


--- branches/safari-608.1-branch/Source/WebCore/page/Quirks.cpp	2019-08-10 22:50:19 UTC (rev 248503)
+++ branches/safari-608.1-branch/Source/WebCore/page/Quirks.cpp	2019-08-11 03:01:50 UTC (rev 248504)
@@ -375,6 +375,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: branches/safari-608.1-branch/Source/WebCore/page/Quirks.h (248503 => 248504)


--- branches/safari-608.1-branch/Source/WebCore/page/Quirks.h	2019-08-10 22:50:19 UTC (rev 248503)
+++ branches/safari-608.1-branch/Source/WebCore/page/Quirks.h	2019-08-11 03:01:50 UTC (rev 248504)
@@ -31,6 +31,7 @@
 namespace WebCore {
 
 class Document;
+class Element;
 class EventTarget;
 class HTMLElement;
 class LayoutUnit;
@@ -54,6 +55,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: branches/safari-608.1-branch/Source/WebCore/page/ios/ContentChangeObserver.cpp (248503 => 248504)


--- branches/safari-608.1-branch/Source/WebCore/page/ios/ContentChangeObserver.cpp	2019-08-10 22:50:19 UTC (rev 248503)
+++ branches/safari-608.1-branch/Source/WebCore/page/ios/ContentChangeObserver.cpp	2019-08-11 03:01:50 UTC (rev 248504)
@@ -35,6 +35,7 @@
 #include "Logging.h"
 #include "NodeRenderStyle.h"
 #include "Page.h"
+#include "Quirks.h"
 #include "RenderDescendantIterator.h"
 #include "Settings.h"
 
@@ -573,7 +574,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
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to