Title: [273458] branches/safari-611-branch/Source/WebCore
Revision
273458
Author
alanc...@apple.com
Date
2021-02-24 16:39:53 -0800 (Wed, 24 Feb 2021)

Log Message

Cherry-pick r272977. rdar://problem/74500812

    REGRESSION (r266695): Unable to scroll the menu in 北京114预约挂号 official account - WeChat
    https://bugs.webkit.org/show_bug.cgi?id=221948
    <rdar://problem/71661277>

    Reviewed by Simon Fraser.

    r266695 caused this to regress, but it actually is a progression, because all browsers agree
    that this content, as it exists in the app, doesn't scroll. So, we don't want to revert the
    change itself, because it's a good change, but we also want to make sure that WeChat continues
    to work. So, we can temporarily quirk one particular element in the WeChat app, until the
    the content can be fixed (<rdar://problem/74377902>).

    Because this is a WeChat-specific quirk, it is untestable. I tested manually.

    * page/Quirks.cpp:
    (WebCore::Quirks::needsWeChatScrollingQuirk const):
    * page/Quirks.h:
    * platform/RuntimeApplicationChecks.h:
    * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
    (WebCore::IOSApplication::isWechat):
    * platform/cocoa/VersionChecks.h:
    * style/StyleAdjuster.cpp:
    (WebCore::Style::Adjuster::adjustForSiteSpecificQuirks const):

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

Modified Paths

Diff

Modified: branches/safari-611-branch/Source/WebCore/ChangeLog (273457 => 273458)


--- branches/safari-611-branch/Source/WebCore/ChangeLog	2021-02-25 00:39:49 UTC (rev 273457)
+++ branches/safari-611-branch/Source/WebCore/ChangeLog	2021-02-25 00:39:53 UTC (rev 273458)
@@ -1,5 +1,61 @@
 2021-02-24  Russell Epstein  <repst...@apple.com>
 
+        Cherry-pick r272977. rdar://problem/74500812
+
+    REGRESSION (r266695): Unable to scroll the menu in 北京114预约挂号 official account - WeChat
+    https://bugs.webkit.org/show_bug.cgi?id=221948
+    <rdar://problem/71661277>
+    
+    Reviewed by Simon Fraser.
+    
+    r266695 caused this to regress, but it actually is a progression, because all browsers agree
+    that this content, as it exists in the app, doesn't scroll. So, we don't want to revert the
+    change itself, because it's a good change, but we also want to make sure that WeChat continues
+    to work. So, we can temporarily quirk one particular element in the WeChat app, until the
+    the content can be fixed (<rdar://problem/74377902>).
+    
+    Because this is a WeChat-specific quirk, it is untestable. I tested manually.
+    
+    * page/Quirks.cpp:
+    (WebCore::Quirks::needsWeChatScrollingQuirk const):
+    * page/Quirks.h:
+    * platform/RuntimeApplicationChecks.h:
+    * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
+    (WebCore::IOSApplication::isWechat):
+    * platform/cocoa/VersionChecks.h:
+    * style/StyleAdjuster.cpp:
+    (WebCore::Style::Adjuster::adjustForSiteSpecificQuirks const):
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272977 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-02-16  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+            REGRESSION (r266695): Unable to scroll the menu in 北京114预约挂号 official account - WeChat
+            https://bugs.webkit.org/show_bug.cgi?id=221948
+            <rdar://problem/71661277>
+
+            Reviewed by Simon Fraser.
+
+            r266695 caused this to regress, but it actually is a progression, because all browsers agree
+            that this content, as it exists in the app, doesn't scroll. So, we don't want to revert the
+            change itself, because it's a good change, but we also want to make sure that WeChat continues
+            to work. So, we can temporarily quirk one particular element in the WeChat app, until the
+            the content can be fixed (<rdar://problem/74377902>).
+
+            Because this is a WeChat-specific quirk, it is untestable. I tested manually.
+
+            * page/Quirks.cpp:
+            (WebCore::Quirks::needsWeChatScrollingQuirk const):
+            * page/Quirks.h:
+            * platform/RuntimeApplicationChecks.h:
+            * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
+            (WebCore::IOSApplication::isWechat):
+            * platform/cocoa/VersionChecks.h:
+            * style/StyleAdjuster.cpp:
+            (WebCore::Style::Adjuster::adjustForSiteSpecificQuirks const):
+
+2021-02-24  Russell Epstein  <repst...@apple.com>
+
         Cherry-pick r272911. rdar://problem/74501076
 
     MediaRecorder.stop() does not work correctly when recording has been paused.

Modified: branches/safari-611-branch/Source/WebCore/page/Quirks.cpp (273457 => 273458)


--- branches/safari-611-branch/Source/WebCore/page/Quirks.cpp	2021-02-25 00:39:49 UTC (rev 273457)
+++ branches/safari-611-branch/Source/WebCore/page/Quirks.cpp	2021-02-25 00:39:53 UTC (rev 273458)
@@ -47,6 +47,7 @@
 #include "PlatformMouseEvent.h"
 #include "RegistrableDomain.h"
 #include "ResourceLoadObserver.h"
+#include "RuntimeApplicationChecks.h"
 #include "RuntimeEnabledFeatures.h"
 #include "SVGPathElement.h"
 #include "SVGSVGElement.h"
@@ -59,6 +60,10 @@
 #include "UserScript.h"
 #include "UserScriptTypes.h"
 
+#if PLATFORM(COCOA)
+#include "VersionChecks.h"
+#endif
+
 namespace WebCore {
 
 static inline OptionSet<AutoplayQuirk> allowedAutoplayQuirks(Document& document)
@@ -645,6 +650,16 @@
 #endif
 }
 
+// FIXME: Remove after the site is fixed, <rdar://problem/74377902>
+bool Quirks::needsWeChatScrollingQuirk() const
+{
+#if PLATFORM(IOS)
+    return needsQuirks() && !linkedOnOrAfter(SDKVersion::FirstWithoutWeChatScrollingQuirk) && IOSApplication::isWechat();
+#else
+    return false;
+#endif
+}
+
 bool Quirks::shouldSilenceWindowResizeEvents() const
 {
 #if PLATFORM(IOS)

Modified: branches/safari-611-branch/Source/WebCore/page/Quirks.h (273457 => 273458)


--- branches/safari-611-branch/Source/WebCore/page/Quirks.h	2021-02-25 00:39:49 UTC (rev 273457)
+++ branches/safari-611-branch/Source/WebCore/page/Quirks.h	2021-02-25 00:39:53 UTC (rev 273458)
@@ -93,6 +93,7 @@
     bool needsGMailOverflowScrollQuirk() const;
     bool needsYouTubeOverflowScrollQuirk() const;
     bool needsFullscreenDisplayNoneQuirk() const;
+    bool needsWeChatScrollingQuirk() const;
 
     bool shouldOpenAsAboutBlank(const String&) const;
 

Modified: branches/safari-611-branch/Source/WebCore/platform/RuntimeApplicationChecks.h (273457 => 273458)


--- branches/safari-611-branch/Source/WebCore/platform/RuntimeApplicationChecks.h	2021-02-25 00:39:49 UTC (rev 273457)
+++ branches/safari-611-branch/Source/WebCore/platform/RuntimeApplicationChecks.h	2021-02-25 00:39:53 UTC (rev 273458)
@@ -119,6 +119,7 @@
 WEBCORE_EXPORT bool isJWLibrary();
 WEBCORE_EXPORT bool isPaperIO();
 WEBCORE_EXPORT bool isCrunchyroll();
+bool isWechat();
 
 } // IOSApplication
 

Modified: branches/safari-611-branch/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm (273457 => 273458)


--- branches/safari-611-branch/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm	2021-02-25 00:39:49 UTC (rev 273457)
+++ branches/safari-611-branch/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm	2021-02-25 00:39:53 UTC (rev 273458)
@@ -446,6 +446,12 @@
     return isCrunchyroll;
 }
 
+bool IOSApplication::isWechat()
+{
+    static bool isWechat = applicationBundleIsEqualTo("com.tencent.xin"_s);
+    return isWechat;
+}
+
 #endif
 
 } // namespace WebCore

Modified: branches/safari-611-branch/Source/WebCore/platform/cocoa/VersionChecks.h (273457 => 273458)


--- branches/safari-611-branch/Source/WebCore/platform/cocoa/VersionChecks.h	2021-02-25 00:39:49 UTC (rev 273457)
+++ branches/safari-611-branch/Source/WebCore/platform/cocoa/VersionChecks.h	2021-02-25 00:39:53 UTC (rev 273458)
@@ -66,6 +66,7 @@
     FirstVersionWithiOSAppsOnMacOS = DYLD_IOS_VERSION_FIRST_WITH_IOS_APPS_ON_MACOS,
     FirstWithDataURLFragmentRemoval = DYLD_IOS_VERSION_14_5,
     FirstThatObservesClassProperty = DYLD_IOS_VERSION_14_5,
+    FirstWithoutWeChatScrollingQuirk = DYLD_IOS_VERSION_14_5,
 #elif PLATFORM(MAC)
     FirstWithNetworkCache = DYLD_MACOSX_VERSION_10_11,
     FirstWithExceptionsForDuplicateCompletionHandlerCalls = DYLD_MACOSX_VERSION_10_13,

Modified: branches/safari-611-branch/Source/WebCore/style/StyleAdjuster.cpp (273457 => 273458)


--- branches/safari-611-branch/Source/WebCore/style/StyleAdjuster.cpp	2021-02-25 00:39:49 UTC (rev 273457)
+++ branches/safari-611-branch/Source/WebCore/style/StyleAdjuster.cpp	2021-02-25 00:39:53 UTC (rev 273458)
@@ -31,6 +31,7 @@
 #include "StyleAdjuster.h"
 
 #include "CSSFontSelector.h"
+#include "DOMTokenList.h"
 #include "DOMWindow.h"
 #include "Element.h"
 #include "EventNames.h"
@@ -605,6 +606,20 @@
         if (style.overflowY() == Overflow::Hidden && m_element->idForStyleResolution() == idValue)
             style.setOverflowY(Overflow::Auto);
     }
+    if (m_document.quirks().needsWeChatScrollingQuirk()) {
+        static MainThreadNeverDestroyed<const AtomString> class1("tree-select", AtomString::ConstructFromLiteral);
+        static MainThreadNeverDestroyed<const AtomString> class2("v-tree-select", AtomString::ConstructFromLiteral);
+        const auto& flexBasis = style.flexBasis();
+        if (style.minHeight().isAuto()
+            && style.display() == DisplayType::Flex
+            && style.flexGrow() == 1
+            && style.flexShrink() == 1
+            && (flexBasis.isPercent() || flexBasis.isFixed())
+            && flexBasis.value() == 0
+            && const_cast<Element*>(m_element)->classList().contains(class1)
+            && const_cast<Element*>(m_element)->classList().contains(class2))
+            style.setMinHeight(Length(0, LengthType::Fixed));
+    }
 #if ENABLE(VIDEO)
     if (m_document.quirks().needsFullscreenDisplayNoneQuirk()) {
         if (is<HTMLDivElement>(m_element) && style.display() == DisplayType::None) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to