Changeset 244904 in webkit


Ignore:
Timestamp:
May 2, 2019 11:48:14 PM (5 years ago)
Author:
Antti Koivisto
Message:

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

Reviewed by Simon Fraser.

  • css/StyleResolver.cpp:

(WebCore::StyleResolver::adjustRenderStyle):
(WebCore::StyleResolver::adjustRenderStyleForSiteSpecificQuirks):

Turn 'overflow:hidden' to 'overflow:auto' on element with role="navigation".
This should be both reasonably targeted and robust.

  • css/StyleResolver.h:
  • page/Quirks.cpp:

(WebCore::Quirks::needsGMailOverflowScrollQuirk const):

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

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r244900 r244904  
     12019-05-02  Antti Koivisto  <antti@apple.com>
     2
     3        Add a quirk to make gmail navigation bar scrollable without mouse hover on iOS
     4        https://bugs.webkit.org/show_bug.cgi?id=197529
     5        <rdar://problem/49403416>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * css/StyleResolver.cpp:
     10        (WebCore::StyleResolver::adjustRenderStyle):
     11        (WebCore::StyleResolver::adjustRenderStyleForSiteSpecificQuirks):
     12
     13        Turn 'overflow:hidden' to 'overflow:auto' on element with role="navigation".
     14        This should be both reasonably targeted and robust.
     15
     16        * css/StyleResolver.h:
     17        * page/Quirks.cpp:
     18        (WebCore::Quirks::needsGMailOverflowScrollQuirk const):
     19        * page/Quirks.h:
     20
    1212019-05-02  Simon Fraser  <simon.fraser@apple.com>
    222
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r244408 r244904  
    7777#include "PaintWorkletGlobalScope.h"
    7878#include "Pair.h"
     79#include "Quirks.h"
    7980#include "RenderScrollbar.h"
    8081#include "RenderStyleConstants.h"
     
    11221123    style.setEffectiveTouchActions(computeEffectiveTouchActions(style, parentStyle.effectiveTouchActions()));
    11231124#endif
     1125
     1126    if (element)
     1127        adjustRenderStyleForSiteSpecificQuirks(style, *element);
     1128}
     1129
     1130void StyleResolver::adjustRenderStyleForSiteSpecificQuirks(RenderStyle& style, const Element& element)
     1131{
     1132    if (document().quirks().needsGMailOverflowScrollQuirk()) {
     1133        // This turns sidebar scrollable without mouse move event.
     1134        if (style.overflowY() == Overflow::Hidden && element.attributeWithoutSynchronization(roleAttr) == "navigation")
     1135            style.setOverflowY(Overflow::Auto);
     1136    }
    11241137}
    11251138
  • trunk/Source/WebCore/css/StyleResolver.h

    r238771 r244904  
    320320
    321321    void adjustRenderStyle(RenderStyle&, const RenderStyle& parentStyle, const RenderStyle* parentBoxStyle, const Element*);
     322    void adjustRenderStyleForSiteSpecificQuirks(RenderStyle&, const Element&);
     323
    322324    std::unique_ptr<GridPosition> adjustNamedGridItemPosition(const NamedGridAreaMap&, const NamedGridLinesMap&, const GridPosition&, GridPositionSide) const;
    323325   
  • trunk/Source/WebCore/page/Quirks.cpp

    r244894 r244904  
    288288}
    289289
    290 }
     290bool Quirks::needsGMailOverflowScrollQuirk() const
     291{
     292#if PLATFORM(IOS_FAMILY)
     293    if (!needsQuirks())
     294        return false;
     295
     296    if (!m_needsGMailOverflowScrollQuirk)
     297        m_needsGMailOverflowScrollQuirk = equalLettersIgnoringASCIICase(m_document->url().host(), "mail.google.com");
     298
     299    return *m_needsGMailOverflowScrollQuirk;
     300#else
     301    return false;
     302#endif
     303}
     304
     305
     306}
  • trunk/Source/WebCore/page/Quirks.h

    r244894 r244904  
    5555    WEBCORE_EXPORT bool isNeverRichlyEditableForTouchBar() const;
    5656
     57    bool needsGMailOverflowScrollQuirk() const;
     58
    5759private:
    5860    bool needsQuirks() const;
     
    6264    mutable Optional<bool> m_hasBrokenEncryptedMediaAPISupportQuirk;
    6365    mutable Optional<bool> m_hasWebSQLSupportQuirk;
     66#if PLATFORM(IOS_FAMILY)
     67    mutable Optional<bool> m_needsGMailOverflowScrollQuirk;
     68#endif
    6469};
    6570
Note: See TracChangeset for help on using the changeset viewer.