mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-23 04:43:07 +09:00
Issue #2045 - Part 8: Remap revert keyword values to a higher cascade level
This commit is contained in:
parent
166e98d2b9
commit
a47f44e93d
3 changed files with 45 additions and 24 deletions
|
|
@ -174,7 +174,8 @@ MapSinglePropertyInto(nsCSSPropertyID aTargetProp,
|
|||
// then records any resulting ImageValue objects in the
|
||||
// CSSVariableImageTable, to give them the appropriate lifetime.
|
||||
MOZ_ASSERT(aTargetValue->GetUnit() == eCSSUnit_TokenStream ||
|
||||
aTargetValue->GetUnit() == eCSSUnit_Null,
|
||||
aTargetValue->GetUnit() == eCSSUnit_Null ||
|
||||
aTargetValue->GetUnit() == eCSSUnit_Revert,
|
||||
"aTargetValue must only be a token stream (when re-parsing "
|
||||
"properties with variable references) or null");
|
||||
|
||||
|
|
@ -316,19 +317,26 @@ nsCSSCompressedDataBlock::MapRuleInfoInto(nsRuleData *aRuleData) const
|
|||
EnsurePhysicalProperty(iProp, aRuleData);
|
||||
}
|
||||
nsCSSValue* target = aRuleData->ValueFor(iProp);
|
||||
if (target->GetUnit() == eCSSUnit_Null) {
|
||||
const nsCSSValue *val = ValueAtIndex(i);
|
||||
// In order for variable resolution to have the right information
|
||||
// about the stylesheet level of a value, that level needs to be
|
||||
// stored on the token stream. We can't do that at creation time
|
||||
// because the CSS parser (which creates the object) has no idea
|
||||
// about the stylesheet level, so we do it here instead, where
|
||||
// the rule walking will have just updated aRuleData.
|
||||
if (val->GetUnit() == eCSSUnit_TokenStream) {
|
||||
val->GetTokenStreamValue()->mLevel = aRuleData->mLevel;
|
||||
if (target->GetUnit() == eCSSUnit_Revert) {
|
||||
if (aRuleData->mLevel >= target->GetCascadeOriginValue()) {
|
||||
continue;
|
||||
}
|
||||
MapSinglePropertyInto(iProp, val, target, aRuleData);
|
||||
} else if (target->GetUnit() != eCSSUnit_Null) {
|
||||
continue;
|
||||
}
|
||||
const nsCSSValue* val = ValueAtIndex(i);
|
||||
// In order for variable resolution to have the right information
|
||||
// about the stylesheet level of a value, that level needs to be
|
||||
// stored on the token stream. We can't do that at creation time
|
||||
// because the CSS parser (which creates the object) has no idea
|
||||
// about the stylesheet level, so we do it here instead, where
|
||||
// the rule walking will have just updated aRuleData.
|
||||
if (val->GetUnit() == eCSSUnit_TokenStream) {
|
||||
val->GetTokenStreamValue()->mLevel = aRuleData->mLevel;
|
||||
} else if (val->GetUnit() == eCSSUnit_Revert) {
|
||||
aRuleData->mConditions.SetUncacheable();
|
||||
}
|
||||
MapSinglePropertyInto(iProp, val, target, aRuleData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue