Changeset 251827 in webkit


Ignore:
Timestamp:
Oct 30, 2019 6:41:11 PM (4 years ago)
Author:
jer.noble@apple.com
Message:

Add fullscreen style quirk for reddit.com
https://bugs.webkit.org/show_bug.cgi?id=203635
<rdar://problem/55813774>

Reviewed by Eric Carlson.

Reddit.com expects the UA stylesheet to give the fullscreen element
a "width:100%; height:100%;" style.

  • css/CSSDefaultStyleSheets.cpp:

(WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):

  • page/Quirks.cpp:

(WebCore::Quirks::needsFullWidthHeightFullscreenStyleQuirk const):

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

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r251826 r251827  
     12019-10-30  Jer Noble  <jer.noble@apple.com>
     2
     3        Add fullscreen style quirk for reddit.com
     4        https://bugs.webkit.org/show_bug.cgi?id=203635
     5        <rdar://problem/55813774>
     6
     7        Reviewed by Eric Carlson.
     8
     9        Reddit.com expects the UA stylesheet to give the fullscreen element
     10        a "width:100%; height:100%;" style.
     11
     12        * css/CSSDefaultStyleSheets.cpp:
     13        (WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
     14        * page/Quirks.cpp:
     15        (WebCore::Quirks::needsFullWidthHeightFullscreenStyleQuirk const):
     16        * page/Quirks.h:
     17
    1182019-10-30  Yusuke Suzuki  <ysuzuki@apple.com>
    219
  • trunk/Source/WebCore/css/CSSDefaultStyleSheets.cpp

    r250916 r251827  
    4848#include "MediaQueryEvaluator.h"
    4949#include "Page.h"
     50#include "Quirks.h"
    5051#include "RenderTheme.h"
    5152#include "RuleSet.h"
     
    278279#if ENABLE(FULLSCREEN_API)
    279280    if (!fullscreenStyleSheet && element.document().fullscreenManager().isFullscreen()) {
    280         String fullscreenRules = String(fullscreenUserAgentStyleSheet, sizeof(fullscreenUserAgentStyleSheet)) + RenderTheme::singleton().extraFullScreenStyleSheet();
    281         fullscreenStyleSheet = parseUASheet(fullscreenRules);
     281        StringBuilder fullscreenRules;
     282        fullscreenRules.appendCharacters(fullscreenUserAgentStyleSheet, sizeof(fullscreenUserAgentStyleSheet));
     283        fullscreenRules.append(RenderTheme::singleton().extraFullScreenStyleSheet());
     284        if (element.document().quirks().needsFullWidthHeightFullscreenStyleQuirk())
     285            fullscreenRules.append(":-webkit-full-screen { width:100%; height:100%; }");
     286        fullscreenStyleSheet = parseUASheet(fullscreenRules.toString());
    282287        addToDefaultStyle(*fullscreenStyleSheet);
    283288    }
  • trunk/Source/WebCore/page/Quirks.cpp

    r251508 r251827  
    595595}
    596596
    597 }
     597bool Quirks::needsFullWidthHeightFullscreenStyleQuirk() const
     598{
     599    if (!needsQuirks())
     600        return false;
     601
     602    if (m_needsFullWidthHeightFullscreenStyleQuirk)
     603        return m_needsFullWidthHeightFullscreenStyleQuirk.value();
     604
     605    auto domain = m_document->securityOrigin().domain().convertToASCIILowercase();
     606
     607    m_needsFullWidthHeightFullscreenStyleQuirk = domain == "reddit.com" || domain.endsWith(".reddit.com");
     608
     609    return m_needsFullWidthHeightFullscreenStyleQuirk.value();
     610}
     611
     612}
  • trunk/Source/WebCore/page/Quirks.h

    r251508 r251827  
    8181
    8282    bool needsPreloadAutoQuirk() const;
     83    bool needsFullWidthHeightFullscreenStyleQuirk() const;
    8384
    8485private:
     
    9394
    9495    mutable Optional<bool> m_hasBrokenEncryptedMediaAPISupportQuirk;
     96    mutable Optional<bool> m_needsFullWidthHeightFullscreenStyleQuirk;
    9597#if PLATFORM(IOS_FAMILY)
    9698    mutable Optional<bool> m_needsGMailOverflowScrollQuirk;
Note: See TracChangeset for help on using the changeset viewer.