mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-18 14:56:07 +00:00
Don't return bogus overflow values when we can't compute a real overflow
value. Bug 319381, r+sr=dbaron
This commit is contained in:
parent
2eb385564d
commit
4ea8b34c7f
@ -2646,22 +2646,27 @@ nsresult
|
||||
nsComputedDOMStyle::GetOverflow(nsIFrame *aFrame,
|
||||
nsIDOMCSSValue** aValue)
|
||||
{
|
||||
nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
|
||||
NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
const nsStyleDisplay* display = nsnull;
|
||||
GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display, aFrame);
|
||||
|
||||
if (display && display->mOverflowX == display->mOverflowY) {
|
||||
if (display->mOverflowX != NS_STYLE_OVERFLOW_AUTO) {
|
||||
const nsAFlatCString& overflow =
|
||||
nsCSSProps::ValueToKeyword(display->mOverflowX,
|
||||
nsCSSProps::kOverflowKTable);
|
||||
val->SetIdent(overflow);
|
||||
} else {
|
||||
val->SetIdent(nsLayoutAtoms::_auto);
|
||||
}
|
||||
} // XXX else what?
|
||||
if (!display || display->mOverflowX != display->mOverflowY) {
|
||||
// No value to return. We can't express this combination of
|
||||
// values as a shorthand.
|
||||
*aValue = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
|
||||
NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
if (display->mOverflowX != NS_STYLE_OVERFLOW_AUTO) {
|
||||
const nsAFlatCString& overflow =
|
||||
nsCSSProps::ValueToKeyword(display->mOverflowX,
|
||||
nsCSSProps::kOverflowKTable);
|
||||
val->SetIdent(overflow);
|
||||
} else {
|
||||
val->SetIdent(nsLayoutAtoms::_auto);
|
||||
}
|
||||
|
||||
return CallQueryInterface(val, aValue);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user