Bug 1121768 - Part 3: Look at all subproperties (not just content-visible ones) in nsCSSExpandedDataBlock methods. r=dbaron

We need to ensure we transfer (or clear) all subproperties of a
shorthand that is only enabled in UA style sheets or in certified apps.
Otherwise, the shorthand will parse correctly and get stored on the
nsCSSExpandedDataBlock but the transfer (or clear) method will skip
all of the subproperties.
This commit is contained in:
Cameron McCormack
2015-01-17 15:55:07 +11:00
parent 213b168902
commit 67d2e24c58
3 changed files with 21 additions and 12 deletions

View File

@@ -588,7 +588,7 @@ nsCSSExpandedDataBlock::ClearProperty(nsCSSProperty aPropID)
{
if (nsCSSProps::IsShorthand(aPropID)) {
CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(p, aPropID,
nsCSSProps::eEnabledForAllContent) {
nsCSSProps::eIgnoreEnabledState) {
ClearLonghandProperty(*p);
}
} else {
@@ -609,6 +609,7 @@ nsCSSExpandedDataBlock::ClearLonghandProperty(nsCSSProperty aPropID)
bool
nsCSSExpandedDataBlock::TransferFromBlock(nsCSSExpandedDataBlock& aFromBlock,
nsCSSProperty aPropID,
nsCSSProps::EnabledState aEnabledState,
bool aIsImportant,
bool aOverrideImportant,
bool aMustCallValueAppended,
@@ -626,8 +627,7 @@ nsCSSExpandedDataBlock::TransferFromBlock(nsCSSExpandedDataBlock& aFromBlock,
// properties available in these contexts also have all of their
// subproperties available in these contexts.
bool changed = false;
CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(p, aPropID,
nsCSSProps::eEnabledForAllContent) {
CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(p, aPropID, aEnabledState) {
changed |= DoTransferFromBlock(aFromBlock, *p,
aIsImportant, aOverrideImportant,
aMustCallValueAppended, aDeclaration);