Skip to content

Commit

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

Reviewed by Anne van Kesteren.

This pseudo-class was used internally to bring the fullscreen element on top everything else, before the top layer was introduced.

Now that the internal usage is gone, we can try to remove this pseudo-class.

* LayoutTests/fast/shadow-dom/fullscreen-in-shadow-full-screen-ancestor-expected.txt: Removed.
* LayoutTests/fast/shadow-dom/fullscreen-in-shadow-full-screen-ancestor.html: Removed.
* LayoutTests/platform/ios-wk2/TestExpectations:
* Source/WebCore/css/CSSPseudoSelectors.json:
* Source/WebCore/css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne const):
* Source/WebCore/css/SelectorCheckerTestFunctions.h:
(WebCore::matchesFullScreenAncestorPseudoClass): Deleted.
* Source/WebCore/css/process-css-pseudo-selectors.py:
* Source/WebCore/cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoClassType):

Canonical link: https://commits.webkit.org/273620@main
  • Loading branch information
nt1m committed Jan 28, 2024
1 parent b706dea commit ac6af58
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 87 deletions.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion LayoutTests/platform/ios-wk2/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,6 @@ imported/blink/fast/forms/label/label-contains-other-interactive-content.html [
fast/dom/Window/post-message-user-action.html [ Skip ]
fast/images/image-usemap-parsing.html [ Skip ]
fast/shadow-dom/fullscreen-in-shadow-event-should-propagate.html [ Skip ]
fast/shadow-dom/fullscreen-in-shadow-full-screen-ancestor.html [ Skip ]
fast/shadow-dom/fullscreen-in-shadow-fullscreenElement.html [ Skip ]
fast/shadow-dom/fullscreen-in-shadow-webkitCurrentFullScreenElement.html [ Skip ]
fast/shadow-dom/fullscreen-in-slot-fullscreenElement.html [ Skip ]
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 @@ -68,11 +68,6 @@
"comment": "Currently has no standard equivalent.",
"status": "non-standard"
},
"-webkit-full-screen-ancestor": {
"comment": "For compatibility.",
"conditional": "ENABLE(FULLSCREEN_API)",
"status": "non-standard"
},
"-webkit-full-screen-document": {
"comment": "For UA stylesheet use.",
"conditional": "ENABLE(FULLSCREEN_API)",
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 @@ -1053,8 +1053,6 @@ bool SelectorChecker::checkOne(CheckingContext& checkingContext, const LocalCont
return matchesFullscreenPseudoClass(element);
case CSSSelector::PseudoClass::InternalAnimatingFullScreenTransition:
return matchesFullScreenAnimatingFullScreenTransitionPseudoClass(element);
case CSSSelector::PseudoClass::WebKitFullScreenAncestor:
return matchesFullScreenAncestorPseudoClass(element);
case CSSSelector::PseudoClass::WebKitFullScreenDocument:
return matchesFullScreenDocumentPseudoClass(element);
#endif
Expand Down
6 changes: 0 additions & 6 deletions Source/WebCore/css/SelectorCheckerTestFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -424,12 +424,6 @@ ALWAYS_INLINE bool matchesFullScreenAnimatingFullScreenTransitionPseudoClass(con
return fullscreenManager->isAnimatingFullscreen();
}

ALWAYS_INLINE bool matchesFullScreenAncestorPseudoClass(const Element& element)
{
auto* currentFullscreenElement = element.document().fullscreenManager().currentFullscreenElement();
return currentFullscreenElement && currentFullscreenElement->isDescendantOrShadowDescendantOf(element);
}

ALWAYS_INLINE bool matchesFullScreenDocumentPseudoClass(const Element& element)
{
// While a Document is in the fullscreen state, the 'full-screen-document' pseudoclass applies
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': 7,
'pseudo-classes': 6,
'pseudo-elements': 59,
}

Expand Down
11 changes: 0 additions & 11 deletions Source/WebCore/cssjit/SelectorCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ using PseudoClassesSet = HashSet<CSSSelector::PseudoClass, IntHash<CSSSelector::
v(operationIsWindowInactive) \
v(operationMatchesFullscreenPseudoClass) \
v(operationMatchesFullScreenDocumentPseudoClass) \
v(operationMatchesFullScreenAncestorPseudoClass) \
v(operationMatchesFullScreenAnimatingFullScreenTransitionPseudoClass) \
v(operationMatchesPictureInPicturePseudoClass) \
v(operationMatchesFutureCuePseudoClass) \
Expand Down Expand Up @@ -257,7 +256,6 @@ static JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(operationMatchesLangPseudo
#if ENABLE(FULLSCREEN_API)
static JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(operationMatchesFullscreenPseudoClass, bool, (const Element&));
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&));
#endif
#if ENABLE(PICTURE_IN_PICTURE_API)
Expand Down Expand Up @@ -905,12 +903,6 @@ JSC_DEFINE_JIT_OPERATION(operationMatchesFullScreenDocumentPseudoClass, bool, (c
return matchesFullScreenDocumentPseudoClass(element);
}

JSC_DEFINE_JIT_OPERATION(operationMatchesFullScreenAncestorPseudoClass, bool, (const Element& element))
{
COUNT_SELECTOR_OPERATION(operationMatchesFullScreenAncestorPseudoClass);
return matchesFullScreenAncestorPseudoClass(element);
}

JSC_DEFINE_JIT_OPERATION(operationMatchesFullScreenAnimatingFullScreenTransitionPseudoClass, bool, (const Element& element))
{
COUNT_SELECTOR_OPERATION(operationMatchesFullScreenAnimatingFullScreenTransitionPseudoClass);
Expand Down Expand Up @@ -1111,9 +1103,6 @@ static inline FunctionType addPseudoClassType(const CSSSelector& selector, Selec
case CSSSelector::PseudoClass::WebKitFullScreenDocument:
fragment.unoptimizedPseudoClasses.append(CodePtr<JSC::OperationPtrTag>(operationMatchesFullScreenDocumentPseudoClass));
return FunctionType::SimpleSelectorChecker;
case CSSSelector::PseudoClass::WebKitFullScreenAncestor:
fragment.unoptimizedPseudoClasses.append(CodePtr<JSC::OperationPtrTag>(operationMatchesFullScreenAncestorPseudoClass));
return FunctionType::SimpleSelectorChecker;
case CSSSelector::PseudoClass::InternalAnimatingFullScreenTransition:
fragment.unoptimizedPseudoClasses.append(CodePtr<JSC::OperationPtrTag>(operationMatchesFullScreenAnimatingFullScreenTransitionPseudoClass));
return FunctionType::SimpleSelectorChecker;
Expand Down

0 comments on commit ac6af58

Please sign in to comment.