Bug 731287 - don't use GetComputedStyle for background-color in HTML table layout guess, r=tbsaunde

This commit is contained in:
Alexander Surkov 2012-03-04 11:29:25 +09:00
parent ff961d36b5
commit 52a06e3ac6

View File

@ -1497,21 +1497,16 @@ nsHTMLTableAccessible::IsProbablyForLayout(bool *aIsProbablyForLayout)
// Check for styled background color across rows (alternating background
// color is a common feature for data tables).
PRUint32 childCount = GetChildCount();
nsAutoString rowColor, prevRowColor;
nscolor rowColor, prevRowColor;
for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
nsAccessible* child = GetChildAt(childIdx);
if (child->Role() == roles::ROW) {
nsCOMPtr<nsIDOMCSSStyleDeclaration> styleDecl =
nsCoreUtils::GetComputedStyleDeclaration(EmptyString(),
child->GetContent());
if (styleDecl) {
prevRowColor = rowColor;
styleDecl->GetPropertyValue(NS_LITERAL_STRING("background-color"),
rowColor);
if (childIdx > 0 && !prevRowColor.Equals(rowColor)) {
RETURN_LAYOUT_ANSWER(false, "2 styles of row background color, non-bordered");
}
}
prevRowColor = rowColor;
nsIFrame* rowFrame = child->GetFrame();
rowColor = rowFrame->GetStyleBackground()->mBackgroundColor;
if (childIdx > 0 && prevRowColor != rowColor)
RETURN_LAYOUT_ANSWER(false, "2 styles of row background color, non-bordered");
}
}