Changeset 244912 in webkit


Ignore:
Timestamp:
May 3, 2019 11:18:12 AM (5 years ago)
Author:
Antti Koivisto
Message:

Add a quirk to make youtube navigation bar scrollable without mouse hover on iOS
https://bugs.webkit.org/show_bug.cgi?id=197555
<rdar://problem/49582231>

Reviewed by Brent Fulgham.

  • css/StyleResolver.cpp:

(WebCore::StyleResolver::adjustRenderStyleForSiteSpecificQuirks):

Turn 'overflow:hidden' into 'overflow:auto' on element with id="guide-inner-content".

  • page/Quirks.cpp:

(WebCore::Quirks::needsYouTubeOverflowScrollQuirk const):

  • page/Quirks.h:
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r244908 r244912  
     12019-05-03  Antti Koivisto  <antti@apple.com>
     2
     3        Add a quirk to make youtube navigation bar scrollable without mouse hover on iOS
     4        https://bugs.webkit.org/show_bug.cgi?id=197555
     5        <rdar://problem/49582231>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        * css/StyleResolver.cpp:
     10        (WebCore::StyleResolver::adjustRenderStyleForSiteSpecificQuirks):
     11
     12        Turn 'overflow:hidden' into 'overflow:auto' on element with id="guide-inner-content".
     13
     14        * page/Quirks.cpp:
     15        (WebCore::Quirks::needsYouTubeOverflowScrollQuirk const):
     16        * page/Quirks.h:
     17
    1182019-05-03  Devin Rousso  <drousso@apple.com>
    219
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r244904 r244912  
    11321132    if (document().quirks().needsGMailOverflowScrollQuirk()) {
    11331133        // This turns sidebar scrollable without mouse move event.
    1134         if (style.overflowY() == Overflow::Hidden && element.attributeWithoutSynchronization(roleAttr) == "navigation")
     1134        static NeverDestroyed<AtomicString> roleValue("navigation", AtomicString::ConstructFromLiteral);
     1135        if (style.overflowY() == Overflow::Hidden && element.attributeWithoutSynchronization(roleAttr) == roleValue)
     1136            style.setOverflowY(Overflow::Auto);
     1137    }
     1138    if (document().quirks().needsYouTubeOverflowScrollQuirk()) {
     1139        // This turns sidebar scrollable without hover.
     1140        static NeverDestroyed<AtomicString> idValue("guide-inner-content", AtomicString::ConstructFromLiteral);
     1141        if (style.overflowY() == Overflow::Hidden && element.idForStyleResolution() == idValue)
    11351142            style.setOverflowY(Overflow::Auto);
    11361143    }
  • trunk/Source/WebCore/page/Quirks.cpp

    r244904 r244912  
    288288}
    289289
     290// FIXME: Remove after the site is fixed, <rdar://problem/50374200>
    290291bool Quirks::needsGMailOverflowScrollQuirk() const
    291292{
     
    303304}
    304305
    305 
    306 }
     306// FIXME: Remove after the site is fixed, <rdar://problem/50374311>
     307bool Quirks::needsYouTubeOverflowScrollQuirk() const
     308{
     309#if PLATFORM(IOS_FAMILY)
     310    if (!needsQuirks())
     311        return false;
     312
     313    if (!m_needsYouTubeOverflowScrollQuirk)
     314        m_needsYouTubeOverflowScrollQuirk = equalLettersIgnoringASCIICase(m_document->url().host(), "www.youtube.com");
     315
     316    return *m_needsYouTubeOverflowScrollQuirk;
     317#else
     318    return false;
     319#endif
     320}
     321
     322
     323}
  • trunk/Source/WebCore/page/Quirks.h

    r244904 r244912  
    5656
    5757    bool needsGMailOverflowScrollQuirk() const;
     58    bool needsYouTubeOverflowScrollQuirk() const;
    5859
    5960private:
     
    6667#if PLATFORM(IOS_FAMILY)
    6768    mutable Optional<bool> m_needsGMailOverflowScrollQuirk;
     69    mutable Optional<bool> m_needsYouTubeOverflowScrollQuirk;
    6870#endif
    6971};
Note: See TracChangeset for help on using the changeset viewer.