diff --git a/layout/generic/nsBlockReflowContext.cpp b/layout/generic/nsBlockReflowContext.cpp index 1c3ce6eefa2a..4af0bc6ece01 100644 --- a/layout/generic/nsBlockReflowContext.cpp +++ b/layout/generic/nsBlockReflowContext.cpp @@ -205,8 +205,14 @@ nsBlockReflowContext::AlignBlockHorizontally(nscoord aWidth, break; case NS_STYLE_TEXT_ALIGN_MOZ_CENTER: case NS_STYLE_TEXT_ALIGN_CENTER: - aAlign.mXOffset += remainingSpace / 2; - doCSS = PR_FALSE; + { + nsCompatibility mode; + mPresContext->GetCompatibilityMode(&mode); + if (eCompatibility_NavQuirks == mode) { + aAlign.mXOffset += remainingSpace / 2; + doCSS = PR_FALSE; + } + } break; } } diff --git a/layout/html/base/src/nsBlockReflowContext.cpp b/layout/html/base/src/nsBlockReflowContext.cpp index 1c3ce6eefa2a..4af0bc6ece01 100644 --- a/layout/html/base/src/nsBlockReflowContext.cpp +++ b/layout/html/base/src/nsBlockReflowContext.cpp @@ -205,8 +205,14 @@ nsBlockReflowContext::AlignBlockHorizontally(nscoord aWidth, break; case NS_STYLE_TEXT_ALIGN_MOZ_CENTER: case NS_STYLE_TEXT_ALIGN_CENTER: - aAlign.mXOffset += remainingSpace / 2; - doCSS = PR_FALSE; + { + nsCompatibility mode; + mPresContext->GetCompatibilityMode(&mode); + if (eCompatibility_NavQuirks == mode) { + aAlign.mXOffset += remainingSpace / 2; + doCSS = PR_FALSE; + } + } break; } }