Skip to content

Commit

Permalink
Make :-webkit-animating-full-screen-transition an internal pseudo-c…
Browse files Browse the repository at this point in the history
…lass

https://bugs.webkit.org/show_bug.cgi?id=267803
rdar://121302758

Reviewed by Anne van Kesteren.

All the hits on Github seem to be either MDN docs or WebKit repository clones: https://github.com/search?q=-webkit-animating-full-screen-transition&type=code&p=1

It seems safe to try this and catch issues with live-on.

* LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/invalid-pseudos-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/invalid-pseudos.html:
* Source/WebCore/Modules/modern-media-controls/controls/media-controls.css:
(:host(:-internal-animating-full-screen-transition) .media-controls):
(:host(:-webkit-animating-full-screen-transition) .media-controls): Deleted.
* Source/WebCore/css/CSSPseudoSelectors.json:
* Source/WebCore/css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne const):
* Source/WebCore/css/process-css-pseudo-selectors.py:
* Source/WebCore/cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoClassType):
* Source/WebCore/dom/FullscreenManager.cpp:
(WebCore::FullscreenManager::setAnimatingFullscreen):

Canonical link: https://commits.webkit.org/273259@main
  • Loading branch information
nt1m committed Jan 20, 2024
1 parent cb6d111 commit 8ebf7a9
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

PASS ":-internal-animating-full-screen-transition" should be an invalid selector
PASS ":-internal-html-document" should be an invalid selector
PASS "::-apple-attachment-controls-container" should be an invalid selector
PASS "::-internal-loading-auto-fill-button" should be an invalid selector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<script src="../../support/parsing-testcommon.js"></script>
<script>
// Pseudo-classes
test_invalid_selector(":-internal-animating-full-screen-transition");
test_invalid_selector(":-internal-html-document");

// Pseudo-elements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
transform-origin: 0 0;
}

:host(:-webkit-animating-full-screen-transition) .media-controls {
:host(:-internal-animating-full-screen-transition) .media-controls {
display: none;
}

Expand Down
8 changes: 3 additions & 5 deletions Source/WebCore/css/CSSPseudoSelectors.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,10 @@
"conditional": "ENABLE(ATTACHMENT_ELEMENT)",
"settings-flag": "DeprecatedGlobalSettings::attachmentElementEnabled"
},
"-internal-html-document": {},
"-webkit-animating-full-screen-transition": {
"comment": "For UA stylesheet use.",
"conditional": "ENABLE(FULLSCREEN_API)",
"status": "non-standard"
"-internal-animating-full-screen-transition": {
"conditional": "ENABLE(FULLSCREEN_API)"
},
"-internal-html-document": {},
"-webkit-any": {
"argument": "required",
"comment": "Alias of :is() with different specificity rules.",
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/css/SelectorChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ bool SelectorChecker::checkOne(CheckingContext& checkingContext, const LocalCont
#if ENABLE(FULLSCREEN_API)
case CSSSelector::PseudoClass::Fullscreen:
return matchesFullscreenPseudoClass(element);
case CSSSelector::PseudoClass::WebKitAnimatingFullScreenTransition:
case CSSSelector::PseudoClass::InternalAnimatingFullScreenTransition:
return matchesFullScreenAnimatingFullScreenTransitionPseudoClass(element);
case CSSSelector::PseudoClass::WebKitFullScreenAncestor:
return matchesFullScreenAncestorPseudoClass(element);
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': 10,
'pseudo-classes': 9,
'pseudo-elements': 59,
}

Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/cssjit/SelectorCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ static inline FunctionType addPseudoClassType(const CSSSelector& selector, Selec
case CSSSelector::PseudoClass::WebKitFullScreenAncestor:
fragment.unoptimizedPseudoClasses.append(CodePtr<JSC::OperationPtrTag>(operationMatchesFullScreenAncestorPseudoClass));
return FunctionType::SimpleSelectorChecker;
case CSSSelector::PseudoClass::WebKitAnimatingFullScreenTransition:
case CSSSelector::PseudoClass::InternalAnimatingFullScreenTransition:
fragment.unoptimizedPseudoClasses.append(CodePtr<JSC::OperationPtrTag>(operationMatchesFullScreenAnimatingFullScreenTransitionPseudoClass));
return FunctionType::SimpleSelectorChecker;

Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/dom/FullscreenManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ void FullscreenManager::setAnimatingFullscreen(bool flag)

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

Expand Down

0 comments on commit 8ebf7a9

Please sign in to comment.