summaryrefslogtreecommitdiff
path: root/layout
diff options
context:
space:
mode:
authorFranklinDM <mrmineshafter17@gmail.com>2023-03-10 19:09:22 +0800
committerFranklinDM <mrmineshafter17@gmail.com>2023-03-10 19:14:26 +0800
commit18c6aa0252602789d50c7eef94b2356e44d8e468 (patch)
tree1bf68ec37ef8b64dc5472dba1e41ac16e6fe4c0f /layout
parent40c9c92116ffbf26995c0186beef792f9f814bba (diff)
downloaduxp-18c6aa0252602789d50c7eef94b2356e44d8e468.tar.gz
Issue #2137 - Part 4: Fix namespace regression
Diffstat (limited to 'layout')
-rw-r--r--layout/style/nsCSSParser.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp
index 1c41e80156..8c4f16f24d 100644
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -114,11 +114,12 @@ MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(GridTrackListFlags)
* Additional information about a selector being parsed.
*/
enum class SelectorParsingFlags {
- eNone = 0,
- eIsNegated = 1 << 0,
- eIsForgiving = 1 << 1,
- eDisallowCombinators = 1 << 2,
- eDisallowPseudoElements = 1 << 3
+ eNone = 0,
+ eIsNegated = 1 << 0,
+ eIsForgiving = 1 << 1,
+ eDisallowCombinators = 1 << 2,
+ eDisallowPseudoElements = 1 << 3,
+ eInheritNamespace = 1 << 4
};
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(SelectorParsingFlags)
@@ -5792,7 +5793,9 @@ CSSParserImpl::ParseTypeOrUniversalSelector(int32_t& aDataMask,
}
}
else {
- SetDefaultNamespaceOnSelector(aSelector);
+ if (!(aFlags & SelectorParsingFlags::eInheritNamespace)) {
+ SetDefaultNamespaceOnSelector(aSelector);
+ }
}
if (aFlags & SelectorParsingFlags::eIsNegated) {
@@ -6617,6 +6620,8 @@ CSSParserImpl::ParsePseudoClassWithSelectorListArg(nsCSSSelector& aSelector,
aFlags |= SelectorParsingFlags::eIsForgiving;
} else if (isSingleSelector || aType == CSSPseudoClassType::mozAny) {
aFlags |= SelectorParsingFlags::eDisallowCombinators;
+ } else if (aType == CSSPseudoClassType::negation) {
+ aFlags |= SelectorParsingFlags::eInheritNamespace;
}
aFlags |= SelectorParsingFlags::eDisallowPseudoElements;