mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-02 22:08:40 +09:00
Support CSS shadow parts
This commit is contained in:
parent
667a753448
commit
a852c0a86a
10 changed files with 1882 additions and 29 deletions
|
|
@ -6690,6 +6690,8 @@ CSSParserImpl::ParsePseudoSelector(int32_t& aDataMask,
|
|||
if (hybridPseudoElementType == CSSPseudoElementType::slotted) {
|
||||
pseudoClassType = CSSPseudoClassType::slotted;
|
||||
aFlags |= SelectorParsingFlags::eDisallowCombinators;
|
||||
} else if (hybridPseudoElementType == CSSPseudoElementType::part) {
|
||||
pseudoClassType = CSSPseudoClassType::part;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -6842,6 +6844,28 @@ CSSParserImpl::ParsePseudoSelector(int32_t& aDataMask,
|
|||
UngetToken();
|
||||
return eSelectorParsingStatus_Error;
|
||||
}
|
||||
else if (hybridPseudoElementType != CSSPseudoElementType::NotPseudo) {
|
||||
aSelector.SetHybridPseudoType(hybridPseudoElementType);
|
||||
// Ensure hybrid pseudo-elements are rejected if they're not allowed.
|
||||
if (disallowPseudoElements) {
|
||||
UngetToken();
|
||||
return eSelectorParsingStatus_Error;
|
||||
}
|
||||
|
||||
if (nsCSSPseudoClasses::HasStringArg(pseudoClassType)) {
|
||||
parsingStatus =
|
||||
ParsePseudoClassWithIdentArg(aSelector, pseudoClassType);
|
||||
}
|
||||
else if (nsCSSPseudoClasses::HasSelectorListArg(pseudoClassType)) {
|
||||
parsingStatus = ParsePseudoClassWithSelectorListArg(aSelector,
|
||||
pseudoClassType,
|
||||
flags);
|
||||
}
|
||||
else {
|
||||
MOZ_ASSERT(false, "unexpected hybrid pseudo-element");
|
||||
parsingStatus = eSelectorParsingStatus_Error;
|
||||
}
|
||||
}
|
||||
else if (nsCSSPseudoClasses::HasStringArg(pseudoClassType)) {
|
||||
parsingStatus =
|
||||
ParsePseudoClassWithIdentArg(aSelector, pseudoClassType);
|
||||
|
|
@ -6853,14 +6877,6 @@ CSSParserImpl::ParsePseudoSelector(int32_t& aDataMask,
|
|||
else {
|
||||
MOZ_ASSERT(nsCSSPseudoClasses::HasSelectorListArg(pseudoClassType),
|
||||
"unexpected pseudo with function token");
|
||||
if (hybridPseudoElementType != CSSPseudoElementType::NotPseudo) {
|
||||
aSelector.SetHybridPseudoType(hybridPseudoElementType);
|
||||
// Ensure hybrid pseudo-elements are rejected if they're not allowed.
|
||||
if (disallowPseudoElements) {
|
||||
UngetToken();
|
||||
return eSelectorParsingStatus_Error;
|
||||
}
|
||||
}
|
||||
parsingStatus = ParsePseudoClassWithSelectorListArg(aSelector,
|
||||
pseudoClassType,
|
||||
flags);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue