Title: [254574] trunk
Revision
254574
Author
jer.no...@apple.com
Date
2020-01-15 09:59:39 -0800 (Wed, 15 Jan 2020)

Log 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.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (254573 => 254574)


--- trunk/LayoutTests/ChangeLog	2020-01-15 17:50:58 UTC (rev 254573)
+++ trunk/LayoutTests/ChangeLog	2020-01-15 17:59:39 UTC (rev 254574)
@@ -1,3 +1,15 @@
+2020-01-15  Jer Noble  <jer.no...@apple.com>
+
+        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.
+
+        * fullscreen/full-screen-test.js:
+        (waitFor):
+        * fullscreen/fullscreen-user-agent-style-expected.txt: Added.
+        * fullscreen/fullscreen-user-agent-style.html: Added.
+
 2020-01-15  Truitt Savell  <tsav...@apple.com>
 
         REGRESSION: [ Mac iOS ] storage/websql/statement-error-callback.html is timing out flakily

Modified: trunk/LayoutTests/fullscreen/full-screen-test.js (254573 => 254574)


--- trunk/LayoutTests/fullscreen/full-screen-test.js	2020-01-15 17:50:58 UTC (rev 254573)
+++ trunk/LayoutTests/fullscreen/full-screen-test.js	2020-01-15 17:59:39 UTC (rev 254574)
@@ -144,6 +144,16 @@
     element.addEventListener(eventName, _eventCallback);
 }
 
+function waitFor(element, type, silent) {
+    return new Promise(resolve => {
+        element.addEventListener(type, event => {
+            if (!silent)
+                consoleWrite(`EVENT(${event.type})`);
+            resolve(event);
+        }, { once: true });
+    });
+}
+
 function waitForEventTestAndEnd(element, eventName, testFuncString)
 {
     waitForEventAndTest(element, eventName, testFuncString, true);
@@ -173,3 +183,5 @@
         return;
     logConsole().innerHTML += text + "<br>";
 }
+
+

Added: trunk/LayoutTests/fullscreen/fullscreen-user-agent-style-expected.txt (0 => 254574)


--- trunk/LayoutTests/fullscreen/fullscreen-user-agent-style-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fullscreen/fullscreen-user-agent-style-expected.txt	2020-01-15 17:59:39 UTC (rev 254574)
@@ -0,0 +1,12 @@
+EXPECTED (document.defaultView.getComputedStyle(span, null).getPropertyValue('width') == 'auto') OK
+EXPECTED (document.defaultView.getComputedStyle(span, null).getPropertyValue('height') == 'auto') OK
+RUN(span.webkitRequestFullscreen())
+EVENT(webkitfullscreenchange)
+EXPECTED (document.defaultView.getComputedStyle(span, null).getPropertyValue('width') == '100%') OK
+EXPECTED (document.defaultView.getComputedStyle(span, null).getPropertyValue('height') == '100%') OK
+RUN(document.webkitExitFullscreen())
+EVENT(webkitfullscreenchange)
+EXPECTED (document.defaultView.getComputedStyle(span, null).getPropertyValue('width') == 'auto') OK
+EXPECTED (document.defaultView.getComputedStyle(span, null).getPropertyValue('height') == 'auto') OK
+END OF TEST
+

Added: trunk/LayoutTests/fullscreen/fullscreen-user-agent-style.html (0 => 254574)


--- trunk/LayoutTests/fullscreen/fullscreen-user-agent-style.html	                        (rev 0)
+++ trunk/LayoutTests/fullscreen/fullscreen-user-agent-style.html	2020-01-15 17:59:39 UTC (rev 254574)
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>fullscreen-user-agent-style</title>
+    <script src=""
+    <script>
+        window.addEventListener('load', async event => {
+            window.span = document.querySelector('span');
+
+            testExpected("document.defaultView.getComputedStyle(span, null).getPropertyValue('width')", "auto");
+            testExpected("document.defaultView.getComputedStyle(span, null).getPropertyValue('height')", "auto");
+
+            runWithKeyDown(() => { run("span.webkitRequestFullscreen()") });
+            await waitFor(span, 'webkitfullscreenchange');
+
+            testExpected("document.defaultView.getComputedStyle(span, null).getPropertyValue('width')", "100%");
+            testExpected("document.defaultView.getComputedStyle(span, null).getPropertyValue('height')", "100%");
+
+            runWithKeyDown(() => { run("document.webkitExitFullscreen()") });
+            await waitFor(span, 'webkitfullscreenchange');
+
+            testExpected("document.defaultView.getComputedStyle(span, null).getPropertyValue('width')", "auto");
+            testExpected("document.defaultView.getComputedStyle(span, null).getPropertyValue('height')", "auto");
+
+            endTest();
+        });
+    </script>
+</head>
+<body>
+    <span></span>
+</body>
+</html>
\ No newline at end of file

Modified: trunk/Source/WebCore/ChangeLog (254573 => 254574)


--- trunk/Source/WebCore/ChangeLog	2020-01-15 17:50:58 UTC (rev 254573)
+++ trunk/Source/WebCore/ChangeLog	2020-01-15 17:59:39 UTC (rev 254574)
@@ -1,3 +1,23 @@
+2020-01-15  Jer Noble  <jer.no...@apple.com>
+
+        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.
+
+        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):
+
 2020-01-15  Antti Koivisto  <an...@apple.com>
 
         [LFC][Integration] Call SimpleLineLayout::canUseFor only once

Modified: trunk/Source/WebCore/css/fullscreen.css (254573 => 254574)


--- trunk/Source/WebCore/css/fullscreen.css	2020-01-15 17:50:58 UTC (rev 254573)
+++ trunk/Source/WebCore/css/fullscreen.css	2020-01-15 17:59:39 UTC (rev 254574)
@@ -1,6 +1,8 @@
 :-webkit-full-screen {
     background-color: white;
     z-index: 2147483647 !important;
+    width: 100%;
+    height: 100%;
 }
 
 :root:-webkit-full-screen-document:not(:-webkit-full-screen), :root:-webkit-full-screen-ancestor {

Modified: trunk/Source/WebCore/page/Quirks.cpp (254573 => 254574)


--- trunk/Source/WebCore/page/Quirks.cpp	2020-01-15 17:50:58 UTC (rev 254573)
+++ trunk/Source/WebCore/page/Quirks.cpp	2020-01-15 17:59:39 UTC (rev 254574)
@@ -594,21 +594,6 @@
 #endif
 }
 
-bool Quirks::needsFullWidthHeightFullscreenStyleQuirk() const
-{
-    if (!needsQuirks())
-        return false;
-
-    if (m_needsFullWidthHeightFullscreenStyleQuirk)
-        return m_needsFullWidthHeightFullscreenStyleQuirk.value();
-
-    auto domain = m_document->securityOrigin().domain().convertToASCIILowercase();
-
-    m_needsFullWidthHeightFullscreenStyleQuirk = domain == "reddit.com" || domain.endsWith(".reddit.com");
-
-    return m_needsFullWidthHeightFullscreenStyleQuirk.value();
-}
-
 bool Quirks::shouldBypassBackForwardCache() const
 {
     if (!needsQuirks())

Modified: trunk/Source/WebCore/page/Quirks.h (254573 => 254574)


--- trunk/Source/WebCore/page/Quirks.h	2020-01-15 17:50:58 UTC (rev 254573)
+++ trunk/Source/WebCore/page/Quirks.h	2020-01-15 17:59:39 UTC (rev 254574)
@@ -80,7 +80,6 @@
     bool shouldOpenAsAboutBlank(const String&) const;
 
     bool needsPreloadAutoQuirk() const;
-    bool needsFullWidthHeightFullscreenStyleQuirk() const;
 
     bool shouldBypassBackForwardCache() const;
 

Modified: trunk/Source/WebCore/style/UserAgentStyle.cpp (254573 => 254574)


--- trunk/Source/WebCore/style/UserAgentStyle.cpp	2020-01-15 17:50:58 UTC (rev 254573)
+++ trunk/Source/WebCore/style/UserAgentStyle.cpp	2020-01-15 17:59:39 UTC (rev 254574)
@@ -291,8 +291,6 @@
         StringBuilder fullscreenRules;
         fullscreenRules.appendCharacters(fullscreenUserAgentStyleSheet, sizeof(fullscreenUserAgentStyleSheet));
         fullscreenRules.append(RenderTheme::singleton().extraFullScreenStyleSheet());
-        if (element.document().quirks().needsFullWidthHeightFullscreenStyleQuirk())
-            fullscreenRules.append(":-webkit-full-screen { width:100%; height:100%; }");
         fullscreenStyleSheet = parseUASheet(fullscreenRules.toString());
         addToDefaultStyle(*fullscreenStyleSheet);
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to