Skip to content

Commit

Permalink
Remove needsBlackFullscreenBackgroundQuirk
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=248323
rdar://102653160

Reviewed by Tim Nguyen.

This is removing the mlb.com quirk which was needed when
the background was white. Backdrop will take over.
A simple change to allow the fake backdrop to take effect.
SeeAlso https://github.com/WebKit/WebKit/pull/6021/files
This also aligns WebKit with Gecko for the fullscreen
background.
Further fixes will be made in
#6688
https://bugs.webkit.org/show_bug.cgi?id=248148

* LayoutTests/TestExpectations:
* LayoutTests/compositing/no-compositing-when-fulll-screen-is-present-expected.txt:
* LayoutTests/platform/gtk/compositing/no-compositing-when-fulll-screen-is-present-expected.txt:
* Source/WebCore/css/fullscreen.css:
(:-webkit-full-screen):
* Source/WebCore/page/Quirks.cpp:
(WebCore::Quirks::needsBlackFullscreenBackgroundQuirk const): Deleted.
* Source/WebCore/page/Quirks.h:
* Source/WebCore/rendering/RenderTheme.h:
(WebCore::RenderTheme::extraFullScreenStyleSheet): Deleted.
* Source/WebCore/style/UserAgentStyle.cpp:
(WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement):

Canonical link: https://commits.webkit.org/257271@main
  • Loading branch information
karlcow authored and nt1m committed Dec 2, 2022
1 parent a007efb commit 6525018
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 30 deletions.
2 changes: 2 additions & 0 deletions LayoutTests/TestExpectations
Expand Up @@ -5980,3 +5980,5 @@ imported/w3c/web-platform-tests/css/css-text-decor/text-shadow/decorations-multi
imported/w3c/web-platform-tests/css/css-text-decor/text-shadow/quirks-decor-noblur.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-text-decor/text-shadow/standards-decor-noblur.html [ ImageOnlyFailure ]

# This test isn't working as expected, it will be fixed in webkit.org/b/248148.
webkit.org/b/248148 fullscreen/full-screen-layer-dump.html [ Failure ]
Expand Up @@ -24,7 +24,6 @@ foobar
(children 1
(GraphicsLayer
(bounds 800.00 600.00)
(contentsOpaque 1)
(drawsContent 1)
(backingStoreAttached 1)
)
Expand Down
Expand Up @@ -24,7 +24,6 @@ foobar
(children 1
(GraphicsLayer
(bounds 800.00 600.00)
(contentsOpaque 1)
(drawsContent 1)
(backingStoreAttached 1)
)
Expand Down
1 change: 0 additions & 1 deletion Source/WebCore/css/fullscreen.css
Expand Up @@ -42,7 +42,6 @@
}

:-webkit-full-screen {
background-color: white;
z-index: 2147483647 !important;
width: 100%;
height: 100%;
Expand Down
15 changes: 0 additions & 15 deletions Source/WebCore/page/Quirks.cpp
Expand Up @@ -1290,21 +1290,6 @@ bool Quirks::needsFlightAwareSerializationQuirk() const
return *m_needsFlightAwareSerializationQuirk;
}

bool Quirks::needsBlackFullscreenBackgroundQuirk() const
{
// MLB.com sets a black background-color on the :backdrop pseudo element, which WebKit does not yet support. This
// quirk can be removed once support for :backdrop psedue element is added.
if (!needsQuirks())
return false;

if (!m_needsBlackFullscreenBackgroundQuirk) {
auto host = m_document->topDocument().url().host();
m_needsBlackFullscreenBackgroundQuirk = equalLettersIgnoringASCIICase(host, "mlb.com"_s) || host.endsWithIgnoringASCIICase(".mlb.com"_s);
}

return *m_needsBlackFullscreenBackgroundQuirk;
}

bool Quirks::requiresUserGestureToPauseInPictureInPicture() const
{
#if ENABLE(VIDEO_PRESENTATION_MODE)
Expand Down
2 changes: 0 additions & 2 deletions Source/WebCore/page/Quirks.h
Expand Up @@ -135,8 +135,6 @@ class Quirks {

bool needsFlightAwareSerializationQuirk() const;

bool needsBlackFullscreenBackgroundQuirk() const;

bool requiresUserGestureToPauseInPictureInPicture() const;
bool requiresUserGestureToLoadInPictureInPicture() const;

Expand Down
3 changes: 0 additions & 3 deletions Source/WebCore/rendering/RenderTheme.h
Expand Up @@ -92,9 +92,6 @@ class RenderTheme {
virtual String mediaControlsFormattedStringForDuration(double) { return String(); }
#endif // ENABLE(MODERN_MEDIA_CONTROLS)
#endif // ENABLE(VIDEO)
#if ENABLE(FULLSCREEN_API)
virtual String extraFullScreenStyleSheet() { return String(); }
#endif
#if ENABLE(ATTACHMENT_ELEMENT)
virtual String attachmentStyleSheet() const;
#endif
Expand Down
8 changes: 1 addition & 7 deletions Source/WebCore/style/UserAgentStyle.cpp
Expand Up @@ -49,7 +49,6 @@
#include "MathMLElement.h"
#include "MediaQueryEvaluator.h"
#include "Page.h"
#include "Quirks.h"
#include "RenderTheme.h"
#include "RuleSetBuilder.h"
#include "SVGElement.h"
Expand Down Expand Up @@ -231,12 +230,7 @@ void UserAgentStyle::ensureDefaultStyleSheetsForElement(const Element& element)

#if ENABLE(FULLSCREEN_API)
if (!fullscreenStyleSheet && element.document().fullscreenManager().isFullscreen()) {
StringBuilder fullscreenRules;
fullscreenRules.appendCharacters(fullscreenUserAgentStyleSheet, sizeof(fullscreenUserAgentStyleSheet));
fullscreenRules.append(RenderTheme::singleton().extraFullScreenStyleSheet());
if (element.document().quirks().needsBlackFullscreenBackgroundQuirk())
fullscreenRules.append(":-webkit-full-screen { background-color: black; }"_s);
fullscreenStyleSheet = parseUASheet(fullscreenRules.toString());
fullscreenStyleSheet = parseUASheet(StringImpl::createWithoutCopying(fullscreenUserAgentStyleSheet, sizeof(fullscreenUserAgentStyleSheet)));
addToDefaultStyle(*fullscreenStyleSheet);
}
#endif // ENABLE(FULLSCREEN_API)
Expand Down

0 comments on commit 6525018

Please sign in to comment.