Make dir=rtl reverse layout direction in horizontal orientation only. Bug 750551, r=dholbert

This commit is contained in:
Simon Montagu 2012-05-07 12:17:41 -07:00
parent 2ac39573ec
commit f6a32bdd95

View File

@ -518,6 +518,7 @@ nsBoxFrame::GetInitialDirection(bool& aIsNormal)
// Now see if we have an attribute. The attribute overrides
// the style system value.
if (IsHorizontal()) {
static nsIContent::AttrValuesArray strings[] =
{&nsGkAtoms::reverse, &nsGkAtoms::ltr, &nsGkAtoms::rtl, nsnull};
PRInt32 index = GetContent()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::dir,
@ -526,6 +527,10 @@ nsBoxFrame::GetInitialDirection(bool& aIsNormal)
bool values[] = {!aIsNormal, true, false};
aIsNormal = values[index];
}
} else if (GetContent()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::dir,
nsGkAtoms::reverse, eCaseMatters)) {
aIsNormal = !aIsNormal;
}
}
/* Returns true if it was set.