Fix the way HTML's align attribute works for horizontal alignment of blocks. Use the -moz-center and -moz-right even in strict mode, and apply them to blocks in addition to tables. r=attinasi b=37083, 40038
git-svn-id: svn://10.0.0.236/trunk@74966 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -178,6 +178,8 @@ nsHTMLReflowState::Init(nsIPresContext* aPresContext,
|
||||
(const nsStyleStruct*&)mStyleDisplay);
|
||||
frame->GetStyleData(eStyleStruct_Spacing,
|
||||
(const nsStyleStruct*&)mStyleSpacing);
|
||||
frame->GetStyleData(eStyleStruct_Text,
|
||||
(const nsStyleStruct*&)mStyleText);
|
||||
mFrameType = DetermineFrameType(frame, mStylePosition, mStyleDisplay);
|
||||
InitConstraints(aPresContext, aContainingBlockWidth, aContainingBlockHeight);
|
||||
}
|
||||
@@ -2001,6 +2003,16 @@ nsHTMLReflowState::CalculateBlockSideMargins(nscoord aAvailWidth,
|
||||
const nsHTMLReflowState* prs = (const nsHTMLReflowState*)
|
||||
parentReflowState;
|
||||
if (prs) {
|
||||
|
||||
// First check if there is an HTML alignment that we should honor
|
||||
if ((prs->mStyleText->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_CENTER) ||
|
||||
(prs->mStyleText->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_RIGHT))
|
||||
{
|
||||
isAutoLeftMargin = PR_TRUE;
|
||||
isAutoRightMargin =
|
||||
(prs->mStyleText->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_CENTER);
|
||||
} else
|
||||
// Otherwise apply the CSS rules
|
||||
if (NS_STYLE_DIRECTION_LTR == prs->mStyleDisplay->mDirection) {
|
||||
// The specified value of margin-right is ignored (== forced
|
||||
// to auto)
|
||||
|
||||
Reference in New Issue
Block a user