⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 254574 in webkit


Ignore:
Timestamp:
Jan 15, 2020, 9:59:39 AM (7 years ago)
Author:
jer.noble@apple.com
Message:

Revert fullscreen CSS quirk for reddit.com; add width and height style to fullscreen.css.
​https://bugs.webkit.org/show_bug.cgi?id=206206

Reviewed by Eric Carlson.

Source/WebCore:

Test: fullscreen/fullscreen-user-agent-style.html

Add the "width:100%;height:100%;" from the modern Fullscreen API spec to our own
fullscreen stylesheet, and revert the quirk for reddit.com.

  • css/fullscreen.css:

(:-webkit-full-screen):

  • page/Quirks.cpp:

(WebCore::Quirks::needsFullWidthHeightFullscreenStyleQuirk const): Deleted.

  • page/Quirks.h:
  • style/UserAgentStyle.cpp:

(WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement):

LayoutTests:

  • fullscreen/full-screen-test.js:

(waitFor):

  • fullscreen/fullscreen-user-agent-style-expected.txt: Added.
  • fullscreen/fullscreen-user-agent-style.html: Added.
Location:
trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r254573 r254574  
     12020-01-15  Jer Noble  <jer.noble@apple.com>
     2
     3        Revert fullscreen CSS quirk for reddit.com; add width and height style to fullscreen.css.
     4        https://bugs.webkit.org/show_bug.cgi?id=206206
     5
     6        Reviewed by Eric Carlson.
     7
     8        * fullscreen/full-screen-test.js:
     9        (waitFor):
     10        * fullscreen/fullscreen-user-agent-style-expected.txt: Added.
     11        * fullscreen/fullscreen-user-agent-style.html: Added.
     12
    1132020-01-15  Truitt Savell  <tsavell@apple.com>
    214
  • trunk/LayoutTests/fullscreen/full-screen-test.js

    r229475 r254574  
    145145}
    146146
     147function waitFor(element, type, silent) {
     148    return new Promise(resolve => {
     149        element.addEventListener(type, event => {
     150            if (!silent)
     151                consoleWrite(`EVENT(${event.type})`);
     152            resolve(event);
     153        }, { once: true });
     154    });
     155}
     156
    147157function waitForEventTestAndEnd(element, eventName, testFuncString)
    148158{
    … …  
    174184    logConsole().innerHTML += text + "<br>";
    175185}
     186
     187
  • trunk/Source/WebCore/ChangeLog

    r254568 r254574  
     12020-01-15  Jer Noble  <jer.noble@apple.com>
     2
     3        Revert fullscreen CSS quirk for reddit.com; add width and height style to fullscreen.css.
     4        https://bugs.webkit.org/show_bug.cgi?id=206206
     5
     6        Reviewed by Eric Carlson.
     7
     8        Test: fullscreen/fullscreen-user-agent-style.html
     9
     10        Add the "width:100%;height:100%;" from the modern Fullscreen API spec to our own
     11        fullscreen stylesheet, and revert the quirk for reddit.com.
     12
     13        * css/fullscreen.css:
     14        (:-webkit-full-screen):
     15        * page/Quirks.cpp:
     16        (WebCore::Quirks::needsFullWidthHeightFullscreenStyleQuirk const): Deleted.
     17        * page/Quirks.h:
     18        * style/UserAgentStyle.cpp:
     19        (WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement):
     20
    1212020-01-15  Antti Koivisto  <antti@apple.com>
    222
  • trunk/Source/WebCore/css/fullscreen.css

    r232208 r254574  
    22    background-color: white;
    33    z-index: 2147483647 !important;
     4    width: 100%;
     5    height: 100%;
    46}
    57
  • trunk/Source/WebCore/page/Quirks.cpp

    r253090 r254574  
    595595}
    596596
    597 bool 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 
    612597bool Quirks::shouldBypassBackForwardCache() const
    613598{
  • trunk/Source/WebCore/page/Quirks.h

    r252854 r254574  
    8181
    8282    bool needsPreloadAutoQuirk() const;
    83     bool needsFullWidthHeightFullscreenStyleQuirk() const;
    8483
    8584    bool shouldBypassBackForwardCache() const;
  • trunk/Source/WebCore/style/UserAgentStyle.cpp

    r254166 r254574  
    292292        fullscreenRules.appendCharacters(fullscreenUserAgentStyleSheet, sizeof(fullscreenUserAgentStyleSheet));
    293293        fullscreenRules.append(RenderTheme::singleton().extraFullScreenStyleSheet());
    294         if (element.document().quirks().needsFullWidthHeightFullscreenStyleQuirk())
    295             fullscreenRules.append(":-webkit-full-screen { width:100%; height:100%; }");
    296294        fullscreenStyleSheet = parseUASheet(fullscreenRules.toString());
    297295        addToDefaultStyle(*fullscreenStyleSheet);
Note: See TracChangeset for help on using the changeset viewer.