Skip to content

Commit

Permalink
[popup] Replace :top-layer with :open
Browse files Browse the repository at this point in the history
The CSSWG just resolved [1] to add an `:open` pseudo class, which
is for many things, but pop-up is one of them. This CL replaces
`:top-layer` with `:open` everywhere.

[1] w3c/csswg-drafts#7319 (comment)

Bug: 1307772
Fixed: 1356645
Change-Id: Ie399712952f549108413878fb31a8077e730f218
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3854979
Commit-Queue: Mason Freed <[email protected]>
Auto-Submit: Mason Freed <[email protected]>
Reviewed-by: David Baron <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1039324}
NOKEYCHECK=True
GitOrigin-RevId: bf52faea8d868f8a933444d1cfa06c8f4c23b48d
  • Loading branch information
mfreed7 authored and copybara-github committed Aug 25, 2022
1 parent 94ed7bd commit 6ff660d
Show file tree
Hide file tree
Showing 34 changed files with 414 additions and 414 deletions.
160 changes: 80 additions & 80 deletions blink/renderer/core/css/css_selector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -258,106 +258,106 @@ PseudoId CSSSelector::GetPseudoId(PseudoType type) {
return kPseudoIdPageTransitionOutgoingImage;
case kPseudoPageTransitionIncomingImage:
return kPseudoIdPageTransitionIncomingImage;
case kPseudoUnknown:
case kPseudoEmpty:
case kPseudoFirstChild:
case kPseudoFirstOfType:
case kPseudoLastChild:
case kPseudoLastOfType:
case kPseudoOnlyChild:
case kPseudoOnlyOfType:
case kPseudoNthChild:
case kPseudoNthOfType:
case kPseudoNthLastChild:
case kPseudoNthLastOfType:
case kPseudoLink:
case kPseudoVisited:
case kPseudoActive:
case kPseudoAny:
case kPseudoIs:
case kPseudoWhere:
case kPseudoAnyLink:
case kPseudoWebkitAnyLink:
case kPseudoAutofill:
case kPseudoWebKitAutofill:
case kPseudoAutofillPreviewed:
case kPseudoAutofillSelected:
case kPseudoHover:
case kPseudoBlinkInternalElement:
case kPseudoChecked:
case kPseudoCornerPresent:
case kPseudoCue:
case kPseudoDecrement:
case kPseudoDefault:
case kPseudoDefined:
case kPseudoDir:
case kPseudoDisabled:
case kPseudoDoubleButton:
case kPseudoDrag:
case kPseudoEmpty:
case kPseudoEnabled:
case kPseudoEnd:
case kPseudoFileSelectorButton:
case kPseudoFirstChild:
case kPseudoFirstOfType:
case kPseudoFirstPage:
case kPseudoFocus:
case kPseudoFocusVisible:
case kPseudoFocusWithin:
case kPseudoActive:
case kPseudoChecked:
case kPseudoEnabled:
case kPseudoFullPageMedia:
case kPseudoDefault:
case kPseudoDisabled:
case kPseudoOptional:
case kPseudoPlaceholder:
case kPseudoPlaceholderShown:
case kPseudoFileSelectorButton:
case kPseudoRequired:
case kPseudoReadOnly:
case kPseudoReadWrite:
case kPseudoValid:
case kPseudoInvalid:
case kPseudoFullScreen:
case kPseudoFullScreenAncestor:
case kPseudoFullscreen:
case kPseudoFutureCue:
case kPseudoHas:
case kPseudoHasDatalist:
case kPseudoHorizontal:
case kPseudoHost:
case kPseudoHostContext:
case kPseudoHostHasAppearance:
case kPseudoHover:
case kPseudoInRange:
case kPseudoIncrement:
case kPseudoIndeterminate:
case kPseudoTarget:
case kPseudoInvalid:
case kPseudoIs:
case kPseudoIsHtml:
case kPseudoLang:
case kPseudoDir:
case kPseudoNot:
case kPseudoRoot:
case kPseudoScope:
case kPseudoWindowInactive:
case kPseudoCornerPresent:
case kPseudoDecrement:
case kPseudoIncrement:
case kPseudoHorizontal:
case kPseudoVertical:
case kPseudoStart:
case kPseudoEnd:
case kPseudoDoubleButton:
case kPseudoSingleButton:
case kPseudoNoButton:
case kPseudoFirstPage:
case kPseudoLastChild:
case kPseudoLastOfType:
case kPseudoLeftPage:
case kPseudoRightPage:
case kPseudoInRange:
case kPseudoLink:
case kPseudoListBox:
case kPseudoModal:
case kPseudoMultiSelectFocus:
case kPseudoNoButton:
case kPseudoNot:
case kPseudoNthChild:
case kPseudoNthLastChild:
case kPseudoNthLastOfType:
case kPseudoNthOfType:
case kPseudoOnlyChild:
case kPseudoOnlyOfType:
case kPseudoOpen:
case kPseudoOptional:
case kPseudoOutOfRange:
case kPseudoToggle:
case kPseudoWebKitCustomElement:
case kPseudoBlinkInternalElement:
case kPseudoCue:
case kPseudoFutureCue:
case kPseudoPastCue:
case kPseudoDefined:
case kPseudoHost:
case kPseudoHostContext:
case kPseudoPart:
case kPseudoState:
case kPseudoFullScreen:
case kPseudoFullScreenAncestor:
case kPseudoFullscreen:
case kPseudoPastCue:
case kPseudoPaused:
case kPseudoPictureInPicture:
case kPseudoPlaceholder:
case kPseudoPlaceholderShown:
case kPseudoPlaying:
case kPseudoPopupHidden:
case kPseudoReadOnly:
case kPseudoReadWrite:
case kPseudoRelativeAnchor:
case kPseudoRequired:
case kPseudoRightPage:
case kPseudoRoot:
case kPseudoScope:
case kPseudoSelectorFragmentAnchor:
case kPseudoSingleButton:
case kPseudoSlotted:
case kPseudoSpatialNavigationFocus:
case kPseudoSpatialNavigationInterest:
case kPseudoHasDatalist:
case kPseudoIsHtml:
case kPseudoListBox:
case kPseudoMultiSelectFocus:
case kPseudoHostHasAppearance:
case kPseudoSlotted:
case kPseudoTopLayer:
case kPseudoPopupHidden:
case kPseudoStart:
case kPseudoState:
case kPseudoTarget:
case kPseudoToggle:
case kPseudoUnknown:
case kPseudoValid:
case kPseudoVertical:
case kPseudoVideoPersistent:
case kPseudoVideoPersistentAncestor:
case kPseudoVisited:
case kPseudoWebKitAutofill:
case kPseudoWebKitCustomElement:
case kPseudoWebkitAnyLink:
case kPseudoWhere:
case kPseudoWindowInactive:
case kPseudoXrOverlay:
case kPseudoModal:
case kPseudoSelectorFragmentAnchor:
case kPseudoHas:
case kPseudoRelativeAnchor:
return kPseudoIdNone;
}

Expand Down Expand Up @@ -454,6 +454,7 @@ const static NameToPseudoStruct kPseudoTypeWithoutArgumentsMap[] = {
{"no-button", CSSSelector::kPseudoNoButton},
{"only-child", CSSSelector::kPseudoOnlyChild},
{"only-of-type", CSSSelector::kPseudoOnlyOfType},
{"open", CSSSelector::kPseudoOpen},
{"optional", CSSSelector::kPseudoOptional},
{"out-of-range", CSSSelector::kPseudoOutOfRange},
{"page-transition", CSSSelector::kPseudoPageTransition},
Expand All @@ -475,7 +476,6 @@ const static NameToPseudoStruct kPseudoTypeWithoutArgumentsMap[] = {
{"start", CSSSelector::kPseudoStart},
{"target", CSSSelector::kPseudoTarget},
{"target-text", CSSSelector::kPseudoTargetText},
{"top-layer", CSSSelector::kPseudoTopLayer},
{"valid", CSSSelector::kPseudoValid},
{"vertical", CSSSelector::kPseudoVertical},
{"visited", CSSSelector::kPseudoVisited},
Expand Down Expand Up @@ -573,7 +573,7 @@ CSSSelector::PseudoType CSSSelector::NameToPseudoType(
bool popup_attribute_enabled =
!document || RuntimeEnabledFeatures::HTMLPopupAttributeEnabled(
document->GetExecutionContext());
if (match->type == CSSSelector::kPseudoTopLayer && !popup_attribute_enabled)
if (match->type == CSSSelector::kPseudoOpen && !popup_attribute_enabled)
return CSSSelector::kPseudoUnknown;

if (match->type == CSSSelector::kPseudoPopupHidden &&
Expand Down Expand Up @@ -771,6 +771,7 @@ void CSSSelector::UpdatePseudoType(const AtomicString& value,
case kPseudoNthOfType:
case kPseudoOnlyChild:
case kPseudoOnlyOfType:
case kPseudoOpen:
case kPseudoOptional:
case kPseudoOutOfRange:
case kPseudoPastCue:
Expand All @@ -791,7 +792,6 @@ void CSSSelector::UpdatePseudoType(const AtomicString& value,
case kPseudoState:
case kPseudoTarget:
case kPseudoToggle:
case kPseudoTopLayer:
case kPseudoUnknown:
case kPseudoValid:
case kPseudoVertical:
Expand Down
114 changes: 57 additions & 57 deletions blink/renderer/core/css/css_selector.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,64 +173,65 @@ class CORE_EXPORT CSSSelector {
};

enum PseudoType {
kPseudoUnknown,
kPseudoEmpty,
kPseudoFirstChild,
kPseudoFirstOfType,
kPseudoLastChild,
kPseudoLastOfType,
kPseudoOnlyChild,
kPseudoOnlyOfType,
kPseudoFirstLine,
kPseudoFirstLetter,
kPseudoNthChild,
kPseudoNthOfType,
kPseudoNthLastChild,
kPseudoNthLastOfType,
kPseudoPart,
kPseudoState,
kPseudoLink,
kPseudoVisited,
kPseudoActive,
kPseudoAfter,
kPseudoAny,
kPseudoIs,
kPseudoWhere,
kPseudoAnyLink,
kPseudoWebkitAnyLink,
kPseudoAutofill,
kPseudoWebKitAutofill,
kPseudoAutofillPreviewed,
kPseudoAutofillSelected,
kPseudoHover,
kPseudoBackdrop,
kPseudoBefore,
kPseudoChecked,
kPseudoCornerPresent,
kPseudoDecrement,
kPseudoDefault,
kPseudoDisabled,
kPseudoDoubleButton,
kPseudoDrag,
kPseudoEmpty,
kPseudoEnabled,
kPseudoEnd,
kPseudoFileSelectorButton,
kPseudoFirstChild,
kPseudoFirstLetter,
kPseudoFirstLine,
kPseudoFirstOfType,
kPseudoFirstPage,
kPseudoFocus,
kPseudoFocusVisible,
kPseudoFocusWithin,
kPseudoActive,
kPseudoChecked,
kPseudoEnabled,
kPseudoFullPageMedia,
kPseudoDefault,
kPseudoDisabled,
kPseudoOptional,
kPseudoPlaceholderShown,
kPseudoRequired,
kPseudoReadOnly,
kPseudoReadWrite,
kPseudoValid,
kPseudoInvalid,
kPseudoHorizontal,
kPseudoHover,
kPseudoIncrement,
kPseudoIndeterminate,
kPseudoTarget,
kPseudoBefore,
kPseudoAfter,
kPseudoInvalid,
kPseudoIs,
kPseudoLang,
kPseudoLastChild,
kPseudoLastOfType,
kPseudoLeftPage,
kPseudoLink,
kPseudoMarker,
kPseudoModal,
kPseudoSelectorFragmentAnchor,
kPseudoBackdrop,
kPseudoLang,
kPseudoNoButton,
kPseudoNot,
kPseudoNthChild,
kPseudoNthLastChild,
kPseudoNthLastOfType,
kPseudoNthOfType,
kPseudoOnlyChild,
kPseudoOnlyOfType,
kPseudoOptional,
kPseudoPart,
kPseudoPlaceholder,
kPseudoFileSelectorButton,
kPseudoPlaceholderShown,
kPseudoReadOnly,
kPseudoReadWrite,
kPseudoRequired,
kPseudoResizer,
kPseudoRightPage,
kPseudoRoot,
kPseudoScope,
kPseudoScrollbar,
Expand All @@ -239,21 +240,20 @@ class CORE_EXPORT CSSSelector {
kPseudoScrollbarThumb,
kPseudoScrollbarTrack,
kPseudoScrollbarTrackPiece,
kPseudoWindowInactive,
kPseudoCornerPresent,
kPseudoDecrement,
kPseudoIncrement,
kPseudoHorizontal,
kPseudoVertical,
kPseudoStart,
kPseudoEnd,
kPseudoDoubleButton,
kPseudoSingleButton,
kPseudoNoButton,
kPseudoSelection,
kPseudoLeftPage,
kPseudoRightPage,
kPseudoFirstPage,
kPseudoSelectorFragmentAnchor,
kPseudoSingleButton,
kPseudoStart,
kPseudoState,
kPseudoTarget,
kPseudoUnknown,
kPseudoValid,
kPseudoVertical,
kPseudoVisited,
kPseudoWebKitAutofill,
kPseudoWebkitAnyLink,
kPseudoWhere,
kPseudoWindowInactive,
// TODO(foolip): When the unprefixed Fullscreen API is enabled, merge
// kPseudoFullScreen and kPseudoFullscreen into one. (kPseudoFullscreen is
// controlled by the FullscreenUnprefixed REF, but is otherwise an alias.)
Expand Down Expand Up @@ -284,7 +284,7 @@ class CORE_EXPORT CSSSelector {
kPseudoListBox,
kPseudoMultiSelectFocus,
kPseudoHostHasAppearance,
kPseudoTopLayer,
kPseudoOpen,
kPseudoPopupHidden,
kPseudoSlotted,
kPseudoVideoPersistent,
Expand Down
2 changes: 1 addition & 1 deletion blink/renderer/core/css/parser/css_proto_converter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ const std::string Converter::kPseudoLookupTable[] = {
"no-button",
"only-child",
"only-of-type",
"open",
"optional",
"out-of-range",
"past",
Expand All @@ -115,7 +116,6 @@ const std::string Converter::kPseudoLookupTable[] = {
"single-button",
"start",
"target",
"top-layer",
"valid",
"vertical",
"visited",
Expand Down
Loading

0 comments on commit 6ff660d

Please sign in to comment.