Bug 1286337 - Part 1. Correct default value of mask-origin.
MozReview-Commit-ID: G8qfOLEHsj3
--- a/layout/style/Declaration.cpp
+++ b/layout/style/Declaration.cpp
@@ -325,18 +325,21 @@ Declaration::GetImageLayerValue(
size->mYValue.AppendToString(aTable[nsStyleImageLayers::size], aValue,
aSerialization);
}
MOZ_ASSERT(clip->mValue.GetUnit() == eCSSUnit_Enumerated &&
origin->mValue.GetUnit() == eCSSUnit_Enumerated,
"should not have inherit/initial within list");
+ int32_t originDefaultValue =
+ (aTable == nsStyleImageLayers::kBackgroundLayerTable)
+ ? NS_STYLE_IMAGELAYER_ORIGIN_PADDING : NS_STYLE_IMAGELAYER_ORIGIN_BORDER;
if (clip->mValue.GetIntValue() != NS_STYLE_IMAGELAYER_CLIP_BORDER ||
- origin->mValue.GetIntValue() != NS_STYLE_IMAGELAYER_ORIGIN_PADDING) {
+ origin->mValue.GetIntValue() != originDefaultValue) {
#ifdef DEBUG
for (size_t i = 0; nsCSSProps::kImageLayerOriginKTable[i].mValue != -1; i++) {
// For each keyword & value in kOriginKTable, ensure that
// kBackgroundKTable has a matching entry at the same position.
MOZ_ASSERT(nsCSSProps::kImageLayerOriginKTable[i].mKeyword ==
nsCSSProps::kBackgroundClipKTable[i].mKeyword);
MOZ_ASSERT(nsCSSProps::kImageLayerOriginKTable[i].mValue ==
nsCSSProps::kBackgroundClipKTable[i].mValue);