зеркало из https://github.com/mozilla/gecko-dev.git
Implement the same block-alignment behavior for align=left (which matters only for RTL) that we do for center and right. b=64510 r+sr=roc a=asa
This commit is contained in:
Родитель
feb322d9ef
Коммит
f00b4902e7
|
@ -2428,7 +2428,7 @@ static const nsAttrValue::EnumTable kVAlignTable[] = {
|
|||
};
|
||||
|
||||
static const nsAttrValue::EnumTable kDivAlignTable[] = {
|
||||
{ "left", NS_STYLE_TEXT_ALIGN_LEFT },
|
||||
{ "left", NS_STYLE_TEXT_ALIGN_MOZ_LEFT },
|
||||
{ "right", NS_STYLE_TEXT_ALIGN_MOZ_RIGHT },
|
||||
{ "center", NS_STYLE_TEXT_ALIGN_MOZ_CENTER },
|
||||
{ "middle", NS_STYLE_TEXT_ALIGN_MOZ_CENTER },
|
||||
|
@ -2509,7 +2509,7 @@ nsGenericHTMLElement::ParseTableHAlignValue(const nsAString& aString,
|
|||
|
||||
// These tables are used for TD,TH,TR, etc (but not TABLE)
|
||||
static const nsAttrValue::EnumTable kTableCellHAlignTable[] = {
|
||||
{ "left", NS_STYLE_TEXT_ALIGN_LEFT },
|
||||
{ "left", NS_STYLE_TEXT_ALIGN_MOZ_LEFT },
|
||||
{ "right", NS_STYLE_TEXT_ALIGN_MOZ_RIGHT },
|
||||
{ "center", NS_STYLE_TEXT_ALIGN_MOZ_CENTER },
|
||||
{ "char", NS_STYLE_TEXT_ALIGN_CHAR },
|
||||
|
@ -2518,7 +2518,7 @@ static const nsAttrValue::EnumTable kTableCellHAlignTable[] = {
|
|||
};
|
||||
|
||||
static const nsAttrValue::EnumTable kCompatTableCellHAlignTable[] = {
|
||||
{ "left", NS_STYLE_TEXT_ALIGN_LEFT },
|
||||
{ "left", NS_STYLE_TEXT_ALIGN_MOZ_LEFT },
|
||||
{ "right", NS_STYLE_TEXT_ALIGN_MOZ_RIGHT },
|
||||
{ "center", NS_STYLE_TEXT_ALIGN_MOZ_CENTER },
|
||||
{ "char", NS_STYLE_TEXT_ALIGN_CHAR },
|
||||
|
|
|
@ -526,6 +526,7 @@
|
|||
#define NS_STYLE_TEXT_ALIGN_CHAR 5 //align based on a certain character, for table cell
|
||||
#define NS_STYLE_TEXT_ALIGN_MOZ_CENTER 6
|
||||
#define NS_STYLE_TEXT_ALIGN_MOZ_RIGHT 7
|
||||
#define NS_STYLE_TEXT_ALIGN_MOZ_LEFT 8
|
||||
|
||||
// See nsStyleText, nsStyleFont
|
||||
#define NS_STYLE_TEXT_DECORATION_NONE 0
|
||||
|
|
|
@ -268,7 +268,7 @@ nsBlockReflowContext::AlignBlockHorizontally(nscoord aWidth,
|
|||
aAlign.mXOffset += remainingSpace;
|
||||
} else if (styleText->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_CENTER) {
|
||||
aAlign.mXOffset += remainingSpace / 2;
|
||||
} else {
|
||||
} else if (styleText->mTextAlign != NS_STYLE_TEXT_ALIGN_MOZ_LEFT) {
|
||||
// If we don't have a special text-align value indicating
|
||||
// HTML alignment, then use the CSS rules.
|
||||
|
||||
|
|
|
@ -2165,11 +2165,13 @@ nsHTMLReflowState::CalculateBlockSideMargins(nscoord aAvailWidth,
|
|||
// First check if there is an HTML alignment that we should honor
|
||||
const nsHTMLReflowState* prs = parentReflowState;
|
||||
if (prs &&
|
||||
(prs->mStyleText->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_CENTER ||
|
||||
(prs->mStyleText->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_LEFT ||
|
||||
prs->mStyleText->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_CENTER ||
|
||||
prs->mStyleText->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_RIGHT)) {
|
||||
isAutoLeftMargin = PR_TRUE;
|
||||
isAutoLeftMargin =
|
||||
prs->mStyleText->mTextAlign != NS_STYLE_TEXT_ALIGN_MOZ_LEFT;
|
||||
isAutoRightMargin =
|
||||
prs->mStyleText->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_CENTER;
|
||||
prs->mStyleText->mTextAlign != NS_STYLE_TEXT_ALIGN_MOZ_RIGHT;
|
||||
}
|
||||
// Otherwise apply the CSS rules, and ignore one margin by forcing
|
||||
// it to 'auto', depending on 'direction'.
|
||||
|
|
|
@ -2830,6 +2830,7 @@ nsLineLayout::HorizontalAlignFrames(nsRect& aLineBounds,
|
|||
break;
|
||||
|
||||
case NS_STYLE_TEXT_ALIGN_LEFT:
|
||||
case NS_STYLE_TEXT_ALIGN_MOZ_LEFT:
|
||||
break;
|
||||
|
||||
case NS_STYLE_TEXT_ALIGN_JUSTIFY:
|
||||
|
|
|
@ -126,6 +126,7 @@ CSS_KEY(-moz-japanese-informal, _moz_japanese_informal)
|
|||
CSS_KEY(-moz-kannada, _moz_kannada)
|
||||
CSS_KEY(-moz-khmer, _moz_khmer)
|
||||
CSS_KEY(-moz-lao, _moz_lao)
|
||||
CSS_KEY(-moz-left, _moz_left)
|
||||
CSS_KEY(-moz-list, _moz_list)
|
||||
CSS_KEY(-moz-mac-accentdarkestshadow, _moz_mac_accentdarkestshadow)
|
||||
CSS_KEY(-moz-mac-accentdarkshadow, _moz_mac_accentdarkshadow)
|
||||
|
|
|
@ -829,6 +829,7 @@ const PRInt32 nsCSSProps::kTextAlignKTable[] = {
|
|||
eCSSKeyword_justify, NS_STYLE_TEXT_ALIGN_JUSTIFY,
|
||||
eCSSKeyword__moz_center, NS_STYLE_TEXT_ALIGN_MOZ_CENTER,
|
||||
eCSSKeyword__moz_right, NS_STYLE_TEXT_ALIGN_MOZ_RIGHT,
|
||||
eCSSKeyword__moz_left, NS_STYLE_TEXT_ALIGN_MOZ_LEFT,
|
||||
eCSSKeyword_start, NS_STYLE_TEXT_ALIGN_DEFAULT,
|
||||
eCSSKeyword_UNKNOWN,-1
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче