Enable 'text-align' values that were derived from HTML align for tables again in Standards mode. b=273857 r=bernd sr=dbaron

git-svn-id: svn://10.0.0.236/trunk@167003 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mats.palmgren%bredband.net
2004-12-23 22:02:54 +00:00
parent 78b828c19f
commit 8941ea78e7

View File

@@ -364,22 +364,6 @@ nsStyleContext::ApplyStyleFixups(nsPresContext* aPresContext)
mBits |= NS_STYLE_HAS_TEXT_DECORATIONS;
}
// Correct tables.
const nsStyleDisplay* disp = GetStyleDisplay();
if (disp->mDisplay == NS_STYLE_DISPLAY_TABLE) {
// -moz-center and -moz-right are used for HTML's alignment
// This is covering the <div align="right"><table>...</table></div> case.
// In this case, we don't want to inherit the text alignment into the table.
const nsStyleText* text = GetStyleText();
if (text->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_CENTER ||
text->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_RIGHT)
{
nsStyleText* uniqueText = (nsStyleText*)GetUniqueStyleData(eStyleStruct_Text);
uniqueText->mTextAlign = NS_STYLE_TEXT_ALIGN_DEFAULT;
}
}
// CSS2.1 section 9.2.4 specifies fixups for the 'display' property of
// the root element. We can't implement them in nsRuleNode because we
// don't want to store all display structs that aren't 'block',
@@ -388,6 +372,7 @@ nsStyleContext::ApplyStyleFixups(nsPresContext* aPresContext)
// here if needed, by changing the style data, so that other code
// doesn't get confused by looking at the style data.
if (!mParent) {
const nsStyleDisplay* disp = GetStyleDisplay();
if (disp->mDisplay != NS_STYLE_DISPLAY_NONE &&
disp->mDisplay != NS_STYLE_DISPLAY_BLOCK &&
disp->mDisplay != NS_STYLE_DISPLAY_TABLE) {