diff --git a/layout/style/nsCSSProps.cpp b/layout/style/nsCSSProps.cpp index 75a81aba00..3b4eeac49f 100644 --- a/layout/style/nsCSSProps.cpp +++ b/layout/style/nsCSSProps.cpp @@ -3181,6 +3181,13 @@ static const nsCSSPropertyID gSizeLogicalGroupTable[] = { eCSSProperty_UNKNOWN }; + +static const nsCSSPropertyID gOverflowLogicalGroupTable[] = { + eCSSProperty_overflow_y, + eCSSProperty_overflow_x, + eCSSProperty_UNKNOWN +}; + const nsCSSPropertyID* const nsCSSProps::kLogicalGroupTable[eCSSPropertyLogicalGroup_COUNT] = { #define CSS_PROP_LOGICAL_GROUP_SHORTHAND(id_) g##id_##SubpropTable, diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp index 357df17662..38b61379dc 100644 --- a/layout/style/nsComputedDOMStyle.cpp +++ b/layout/style/nsComputedDOMStyle.cpp @@ -4750,15 +4750,26 @@ nsComputedDOMStyle::DoGetOverflow() { const nsStyleDisplay* display = StyleDisplay(); - if (display->mOverflowX != display->mOverflowY) { - // No value to return. We can't express this combination of - // values as a shorthand. - return nullptr; + if (display->mOverflowX == display->mOverflowY) { + RefPtr val = new nsROCSSPrimitiveValue; + val->SetIdent(nsCSSProps::ValueToKeywordEnum(display->mOverflowX, + nsCSSProps::kOverflowKTable)); + return val.forget(); } RefPtr val = new nsROCSSPrimitiveValue; - val->SetIdent(nsCSSProps::ValueToKeywordEnum(display->mOverflowX, - nsCSSProps::kOverflowKTable)); + nsAutoString result; + + nsCSSKeyword xKeyword = nsCSSProps::ValueToKeywordEnum(display->mOverflowX, + nsCSSProps::kOverflowKTable); + nsCSSKeyword yKeyword = nsCSSProps::ValueToKeywordEnum(display->mOverflowY, + nsCSSProps::kOverflowKTable); + + result.AppendASCII(nsCSSKeywords::GetStringValue(xKeyword).get()); + result.Append(char16_t(' ')); + result.AppendASCII(nsCSSKeywords::GetStringValue(yKeyword).get()); + + val->SetString(result); return val.forget(); }