Skip to content

Commit

Permalink
Remove :-webkit-full-screen-controls-hidden pseudo-class
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=267820
rdar://121323330

Reviewed by Anne van Kesteren.

This was created but never evangelized, so it ended up never getting adoption.

* LayoutTests/fullscreen/fullscreen-env-expected.txt:
* LayoutTests/fullscreen/fullscreen-env.html:
* Source/WebCore/css/CSSPseudoSelectors.json:
* Source/WebCore/css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne const):
* Source/WebCore/css/SelectorCheckerTestFunctions.h:
(WebCore::matchesFullScreenControlsHiddenPseudoClass): Deleted.
* Source/WebCore/css/process-css-pseudo-selectors.py:
* Source/WebCore/cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::JSC_DEFINE_JIT_OPERATION):
(WebCore::SelectorCompiler::addPseudoClassType):
* Source/WebCore/dom/FullscreenManager.cpp:
(WebCore::FullscreenManager::areFullscreenControlsHidden const): Deleted.
(WebCore::FullscreenManager::setFullscreenControlsHidden): Deleted.
* Source/WebCore/dom/FullscreenManager.h:
* Source/WebCore/page/Page.cpp:
(WebCore::Page::setFullscreenControlsHidden): Deleted.
* Source/WebCore/page/Page.h:
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::setFullscreenControlsHidden): Deleted.
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:
* Source/WebKit/UIProcess/WebFullScreenManagerProxy.cpp:
(WebKit::WebFullScreenManagerProxy::setFullscreenControlsHidden): Deleted.
* Source/WebKit/UIProcess/WebFullScreenManagerProxy.h:
* Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
(-[WKFullScreenViewController showUI]):
(-[WKFullScreenViewController hideUI]):
* Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.cpp:
(WebKit::WebFullScreenManager::setFullscreenControlsHidden): Deleted.
* Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.h:
* Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.messages.in:

Canonical link: https://commits.webkit.org/273619@main
  • Loading branch information
nt1m committed Jan 28, 2024
1 parent 77fb364 commit b706dea
Show file tree
Hide file tree
Showing 20 changed files with 3 additions and 104 deletions.
5 changes: 0 additions & 5 deletions LayoutTests/fullscreen/fullscreen-env-expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,5 @@ RUN(internals.setFullscreenAutoHideDuration(30))
EXPECTED (window.getComputedStyle(target).transitionDuration == '30s') OK
RUN(internals.setFullscreenAutoHideDuration(0))
EXPECTED (window.getComputedStyle(target).transitionDuration == '0s') OK
EVENT(webkitfullscreenchange)
RUN(internals.setFullscreenControlsHidden(true))
EXPECTED (document.querySelector("#target:-webkit-full-screen-controls-hidden") == '[object HTMLDivElement]') OK
RUN(internals.setFullscreenControlsHidden(false))
EXPECTED (document.querySelector("#target:-webkit-full-screen-controls-hidden") == 'null') OK
END OF TEST

9 changes: 1 addition & 8 deletions LayoutTests/fullscreen/fullscreen-env.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,7 @@
testExpected('window.getComputedStyle(target).transitionDuration', '30s');
run('internals.setFullscreenAutoHideDuration(0)');
testExpected('window.getComputedStyle(target).transitionDuration', '0s');
runWithKeyDown(() => {target.webkitRequestFullscreen() });
waitForEventOnce(document, 'webkitfullscreenchange', event => {
run('internals.setFullscreenControlsHidden(true)');
testExpected('document.querySelector("#target:-webkit-full-screen-controls-hidden")', target);
run('internals.setFullscreenControlsHidden(false)');
testExpected('document.querySelector("#target:-webkit-full-screen-controls-hidden")', null);
endTest();
});
endTest();
});
</script>
<style>
Expand Down
5 changes: 0 additions & 5 deletions Source/WebCore/css/CSSPseudoSelectors.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,6 @@
"conditional": "ENABLE(FULLSCREEN_API)",
"status": "non-standard"
},
"-webkit-full-screen-controls-hidden": {
"comment": "For compatibility.",
"conditional": "ENABLE(FULLSCREEN_API)",
"status": "non-standard"
},
"active": {},
"any-link": {
"aliases": [
Expand Down
2 changes: 0 additions & 2 deletions Source/WebCore/css/SelectorChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1057,8 +1057,6 @@ bool SelectorChecker::checkOne(CheckingContext& checkingContext, const LocalCont
return matchesFullScreenAncestorPseudoClass(element);
case CSSSelector::PseudoClass::WebKitFullScreenDocument:
return matchesFullScreenDocumentPseudoClass(element);
case CSSSelector::PseudoClass::WebKitFullScreenControlsHidden:
return matchesFullScreenControlsHiddenPseudoClass(element);
#endif
#if ENABLE(PICTURE_IN_PICTURE_API)
case CSSSelector::PseudoClass::PictureInPicture:
Expand Down
8 changes: 0 additions & 8 deletions Source/WebCore/css/SelectorCheckerTestFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -438,14 +438,6 @@ ALWAYS_INLINE bool matchesFullScreenDocumentPseudoClass(const Element& element)
return fullscreenManager && fullscreenManager->fullscreenElement();
}

ALWAYS_INLINE bool matchesFullScreenControlsHiddenPseudoClass(const Element& element)
{
CheckedPtr fullscreenManager = element.document().fullscreenManagerIfExists();
if (!fullscreenManager || &element != fullscreenManager->fullscreenElement())
return false;
return fullscreenManager->areFullscreenControlsHidden();
}

#endif

#if ENABLE(PICTURE_IN_PICTURE_API)
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/css/process-css-pseudo-selectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
# - an `-internal-` prefix for things only meant to be styled in the user agent stylesheet
# - an `-apple-` prefix only exposed to certain Apple clients (there is a settings-flag requirement for using this prefix)
WEBKIT_PREFIX_COUNTS_DO_NOT_INCREASE = {
'pseudo-classes': 8,
'pseudo-classes': 7,
'pseudo-elements': 59,
}

Expand Down
12 changes: 0 additions & 12 deletions Source/WebCore/cssjit/SelectorCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ using PseudoClassesSet = HashSet<CSSSelector::PseudoClass, IntHash<CSSSelector::
v(operationMatchesFullScreenDocumentPseudoClass) \
v(operationMatchesFullScreenAncestorPseudoClass) \
v(operationMatchesFullScreenAnimatingFullScreenTransitionPseudoClass) \
v(operationMatchesFullScreenControlsHiddenPseudoClass) \
v(operationMatchesPictureInPicturePseudoClass) \
v(operationMatchesFutureCuePseudoClass) \
v(operationMatchesPastCuePseudoClass) \
Expand Down Expand Up @@ -260,7 +259,6 @@ static JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(operationMatchesFullscreen
static JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(operationMatchesFullScreenDocumentPseudoClass, bool, (const Element&));
static JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(operationMatchesFullScreenAncestorPseudoClass, bool, (const Element&));
static JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(operationMatchesFullScreenAnimatingFullScreenTransitionPseudoClass, bool, (const Element&));
static JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(operationMatchesFullScreenControlsHiddenPseudoClass, bool, (const Element&));
#endif
#if ENABLE(PICTURE_IN_PICTURE_API)
static JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(operationMatchesPictureInPicturePseudoClass, bool, (const Element&));
Expand Down Expand Up @@ -918,12 +916,6 @@ JSC_DEFINE_JIT_OPERATION(operationMatchesFullScreenAnimatingFullScreenTransition
COUNT_SELECTOR_OPERATION(operationMatchesFullScreenAnimatingFullScreenTransitionPseudoClass);
return matchesFullScreenAnimatingFullScreenTransitionPseudoClass(element);
}

JSC_DEFINE_JIT_OPERATION(operationMatchesFullScreenControlsHiddenPseudoClass, bool, (const Element& element))
{
COUNT_SELECTOR_OPERATION(operationMatchesFullScreenControlsHiddenPseudoClass);
return matchesFullScreenControlsHiddenPseudoClass(element);
}
#endif

#if ENABLE(PICTURE_IN_PICTURE_API)
Expand Down Expand Up @@ -1125,10 +1117,6 @@ static inline FunctionType addPseudoClassType(const CSSSelector& selector, Selec
case CSSSelector::PseudoClass::InternalAnimatingFullScreenTransition:
fragment.unoptimizedPseudoClasses.append(CodePtr<JSC::OperationPtrTag>(operationMatchesFullScreenAnimatingFullScreenTransitionPseudoClass));
return FunctionType::SimpleSelectorChecker;

case CSSSelector::PseudoClass::WebKitFullScreenControlsHidden:
fragment.unoptimizedPseudoClasses.append(CodePtr<JSC::OperationPtrTag>(operationMatchesFullScreenControlsHiddenPseudoClass));
return FunctionType::SimpleSelectorChecker;
#endif

#if ENABLE(PICTURE_IN_PICTURE_API)
Expand Down
18 changes: 0 additions & 18 deletions Source/WebCore/dom/FullscreenManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -743,24 +743,6 @@ void FullscreenManager::setAnimatingFullscreen(bool flag)
m_isAnimatingFullscreen = flag;
}

bool FullscreenManager::areFullscreenControlsHidden() const
{
return m_areFullscreenControlsHidden;
}

void FullscreenManager::setFullscreenControlsHidden(bool flag)
{
if (m_areFullscreenControlsHidden == flag)
return;

INFO_LOG(LOGIDENTIFIER, flag);

std::optional<Style::PseudoClassChangeInvalidation> styleInvalidation;
if (m_fullscreenElement)
emplace(styleInvalidation, *m_fullscreenElement, { { CSSSelector::PseudoClass::WebKitFullScreenControlsHidden, flag } });
m_areFullscreenControlsHidden = flag;
}

void FullscreenManager::clear()
{
m_fullscreenElement = nullptr;
Expand Down
4 changes: 0 additions & 4 deletions Source/WebCore/dom/FullscreenManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ class FullscreenManager final : public CanMakeWeakPtr<FullscreenManager>, public
WEBCORE_EXPORT bool isAnimatingFullscreen() const;
WEBCORE_EXPORT void setAnimatingFullscreen(bool);

WEBCORE_EXPORT bool areFullscreenControlsHidden() const;
WEBCORE_EXPORT void setFullscreenControlsHidden(bool);

void clear();
void emptyEventQueue();

Expand Down Expand Up @@ -127,7 +124,6 @@ class FullscreenManager final : public CanMakeWeakPtr<FullscreenManager>, public

bool m_areKeysEnabledInFullscreen { false };
bool m_isAnimatingFullscreen { false };
bool m_areFullscreenControlsHidden { false };

#if !RELEASE_LOG_DISABLED
const void* m_logIdentifier;
Expand Down
11 changes: 0 additions & 11 deletions Source/WebCore/page/Page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3799,17 +3799,6 @@ void Page::setFullscreenAutoHideDuration(Seconds duration)
});
}

void Page::setFullscreenControlsHidden(bool hidden)
{
#if ENABLE(FULLSCREEN_API)
forEachDocument([&] (Document& document) {
document.fullscreenManager().setFullscreenControlsHidden(hidden);
});
#else
UNUSED_PARAM(hidden);
#endif
}

Document* Page::outermostFullscreenDocument() const
{
#if ENABLE(FULLSCREEN_API)
Expand Down
3 changes: 1 addition & 2 deletions Source/WebCore/page/Page.h
Original file line number Diff line number Diff line change
Expand Up @@ -560,14 +560,13 @@ class Page : public RefCounted<Page>, public Supplementable<Page>, public CanMak

const Seconds fullscreenAutoHideDuration() const { return m_fullscreenAutoHideDuration; }
WEBCORE_EXPORT void setFullscreenAutoHideDuration(Seconds);
WEBCORE_EXPORT void setFullscreenControlsHidden(bool);

Document* outermostFullscreenDocument() const;

bool shouldSuppressScrollbarAnimations() const { return m_suppressScrollbarAnimations; }
WEBCORE_EXPORT void setShouldSuppressScrollbarAnimations(bool suppressAnimations);
void lockAllOverlayScrollbarsToHidden(bool lockOverlayScrollbars);

WEBCORE_EXPORT void setVerticalScrollElasticity(ScrollElasticity);
ScrollElasticity verticalScrollElasticity() const { return static_cast<ScrollElasticity>(m_verticalScrollElasticity); }

Expand Down
9 changes: 0 additions & 9 deletions Source/WebCore/testing/Internals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,6 @@ void Internals::resetToConsistentState(Page& page)

page.setFullscreenAutoHideDuration(0_s);
page.setFullscreenInsets({ });
page.setFullscreenControlsHidden(false);

MediaEngineConfigurationFactory::disableMock();

Expand Down Expand Up @@ -3792,14 +3791,6 @@ void Internals::setFullscreenAutoHideDuration(double duration)
page->setFullscreenAutoHideDuration(Seconds(duration));
}

void Internals::setFullscreenControlsHidden(bool hidden)
{
Page* page = contextDocument()->frame()->page();
ASSERT(page);

page->setFullscreenControlsHidden(hidden);
}

#if ENABLE(VIDEO)
bool Internals::isChangingPresentationMode(HTMLVideoElement& element) const
{
Expand Down
1 change: 0 additions & 1 deletion Source/WebCore/testing/Internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,6 @@ class Internals final : public RefCounted<Internals>, private ContextDestruction
};
void setFullscreenInsets(FullscreenInsets);
void setFullscreenAutoHideDuration(double);
void setFullscreenControlsHidden(bool);

#if ENABLE(VIDEO)
bool isChangingPresentationMode(HTMLVideoElement&) const;
Expand Down
1 change: 0 additions & 1 deletion Source/WebCore/testing/Internals.idl
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,6 @@ typedef (FetchRequest or FetchResponse) FetchObject;

undefined setFullscreenInsets(FullscreenInsets insets);
undefined setFullscreenAutoHideDuration(double duration);
undefined setFullscreenControlsHidden(boolean hidden);

[Conditional=VIDEO] boolean isChangingPresentationMode(HTMLVideoElement element);
[Conditional=VIDEO_PRESENTATION_MODE] undefined setMockVideoPresentationModeEnabled(boolean enabled);
Expand Down
5 changes: 0 additions & 5 deletions Source/WebKit/UIProcess/WebFullScreenManagerProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,6 @@ void WebFullScreenManagerProxy::setFullscreenAutoHideDuration(Seconds duration)
m_page.send(Messages::WebFullScreenManager::SetFullscreenAutoHideDuration(duration));
}

void WebFullScreenManagerProxy::setFullscreenControlsHidden(bool hidden)
{
m_page.send(Messages::WebFullScreenManager::SetFullscreenControlsHidden(hidden));
}

void WebFullScreenManagerProxy::close()
{
m_client.closeFullScreenManager();
Expand Down
1 change: 0 additions & 1 deletion Source/WebKit/UIProcess/WebFullScreenManagerProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ class WebFullScreenManagerProxy : public IPC::MessageReceiver {
void restoreScrollPosition();
void setFullscreenInsets(const WebCore::FloatBoxExtent&);
void setFullscreenAutoHideDuration(Seconds);
void setFullscreenControlsHidden(bool);
void closeWithCallback(CompletionHandler<void()>&&);
bool lockFullscreenOrientation(WebCore::ScreenOrientationType);
void unlockFullscreenOrientation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,6 @@ - (void)showUI
[NSLayoutConstraint deactivateConstraints:@[_topConstraint.get()]];
_topConstraint = [[_topGuide topAnchor] constraintEqualToAnchor:self.view.safeAreaLayoutGuide.topAnchor];
[_topConstraint setActive:YES];
if (auto* manager = self._manager)
manager->setFullscreenControlsHidden(false);
}];
}

Expand All @@ -287,8 +285,6 @@ - (void)hideUI
[_stackView setAlpha:0];
self.prefersStatusBarHidden = YES;
self.prefersHomeIndicatorAutoHidden = YES;
if (auto* manager = self._manager)
manager->setFullscreenControlsHidden(true);
} completion:^(BOOL finished) {
if (!finished)
return;
Expand Down
5 changes: 0 additions & 5 deletions Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,11 +458,6 @@ void WebFullScreenManager::setFullscreenAutoHideDuration(Seconds duration)
m_page->corePage()->setFullscreenAutoHideDuration(duration);
}

void WebFullScreenManager::setFullscreenControlsHidden(bool hidden)
{
m_page->corePage()->setFullscreenControlsHidden(hidden);
}

void WebFullScreenManager::handleEvent(WebCore::ScriptExecutionContext& context, WebCore::Event& event)
{
#if ENABLE(VIDEO)
Expand Down
1 change: 0 additions & 1 deletion Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ class WebFullScreenManager final : public WebCore::EventListener {
void requestExitFullScreen();
void setFullscreenInsets(const WebCore::FloatBoxExtent&);
void setFullscreenAutoHideDuration(Seconds);
void setFullscreenControlsHidden(bool);

void didReceiveWebFullScreenManagerMessage(IPC::Connection&, IPC::Decoder&);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,5 @@ messages -> WebFullScreenManager LegacyReceiver {
RestoreScrollPosition()
SetFullscreenInsets(WebCore::RectEdges<float> insets)
SetFullscreenAutoHideDuration(Seconds duration)
SetFullscreenControlsHidden(bool hidden)
}
#endif

0 comments on commit b706dea

Please sign in to comment.