From 449b22d059b5b3a0d150cd00589bbd71eadeaf76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 22 Oct 2018 15:14:42 +0000 Subject: [PATCH] Bug 1500885 - mTextAlignTrue / mTextAlingLastTrue are write-only. r=mats They were added in bug 929991, but there's no text-align: true anymore. Differential Revision: https://phabricator.services.mozilla.com/D9371 --HG-- extra : moz-landing-system : lando --- layout/generic/nsLineLayout.cpp | 4 +--- layout/style/nsComputedDOMStyle.cpp | 26 ++++---------------------- layout/style/nsComputedDOMStyle.h | 4 ---- layout/style/nsStyleStruct.cpp | 6 ------ layout/style/nsStyleStruct.h | 2 -- 5 files changed, 5 insertions(+), 37 deletions(-) diff --git a/layout/generic/nsLineLayout.cpp b/layout/generic/nsLineLayout.cpp index 120efa386ee5..aea8b67b7d3f 100644 --- a/layout/generic/nsLineLayout.cpp +++ b/layout/generic/nsLineLayout.cpp @@ -3218,9 +3218,7 @@ nsLineLayout::TextAlignLine(nsLineBox* aLine, // nscoord dx = 0; uint8_t textAlign = mStyleText->mTextAlign; - bool textAlignTrue = mStyleText->mTextAlignTrue; if (aIsLastLine) { - textAlignTrue = mStyleText->mTextAlignLastTrue; if (mStyleText->mTextAlignLast == NS_STYLE_TEXT_ALIGN_AUTO) { if (textAlign == NS_STYLE_TEXT_ALIGN_JUSTIFY) { textAlign = NS_STYLE_TEXT_ALIGN_START; @@ -3231,7 +3229,7 @@ nsLineLayout::TextAlignLine(nsLineBox* aLine, } bool isSVG = nsSVGUtils::IsInSVGTextSubtree(mBlockReflowInput->mFrame); - bool doTextAlign = remainingISize > 0 || textAlignTrue; + bool doTextAlign = remainingISize > 0; int32_t additionalGaps = 0; if (!isSVG && (mHasRuby || (doTextAlign && diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp index 323978ea6b4c..0fbd9267765f 100644 --- a/layout/style/nsComputedDOMStyle.cpp +++ b/layout/style/nsComputedDOMStyle.cpp @@ -2708,31 +2708,13 @@ nsComputedDOMStyle::DoGetVerticalAlign() return val.forget(); } -already_AddRefed -nsComputedDOMStyle::CreateTextAlignValue(uint8_t aAlign, bool aAlignTrue, - const KTableEntry aTable[]) -{ - RefPtr val = new nsROCSSPrimitiveValue; - val->SetIdent(nsCSSProps::ValueToKeywordEnum(aAlign, aTable)); - if (!aAlignTrue) { - return val.forget(); - } - - RefPtr first = new nsROCSSPrimitiveValue; - first->SetIdent(eCSSKeyword_unsafe); - - RefPtr valueList = GetROCSSValueList(false); - valueList->AppendCSSValue(first.forget()); - valueList->AppendCSSValue(val.forget()); - return valueList.forget(); -} - already_AddRefed nsComputedDOMStyle::DoGetTextAlign() { - const nsStyleText* style = StyleText(); - return CreateTextAlignValue(style->mTextAlign, style->mTextAlignTrue, - nsCSSProps::kTextAlignKTable); + RefPtr val = new nsROCSSPrimitiveValue; + val->SetIdent(nsCSSProps::ValueToKeywordEnum( + StyleText()->mTextAlign, nsCSSProps::kTextAlignKTable)); + return val.forget(); } already_AddRefed diff --git a/layout/style/nsComputedDOMStyle.h b/layout/style/nsComputedDOMStyle.h index 57a13d43b88b..bd17d720ade7 100644 --- a/layout/style/nsComputedDOMStyle.h +++ b/layout/style/nsComputedDOMStyle.h @@ -149,10 +149,6 @@ private: nsMargin GetAdjustedValuesForBoxSizing(); - // Helper method for DoGetTextAlign[Last]. - already_AddRefed CreateTextAlignValue(uint8_t aAlign, - bool aAlignTrue, - const KTableEntry aTable[]); // This indicates error by leaving mComputedStyle null. void UpdateCurrentStyleSources(bool aNeedsLayoutFlush); void ClearCurrentStyleSources(); diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index c3d0046afce8..82a912d8abf0 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -4313,8 +4313,6 @@ AreShadowArraysEqual(nsCSSShadowArray* lhs, nsStyleText::nsStyleText(const nsPresContext* aContext) : mTextAlign(NS_STYLE_TEXT_ALIGN_START) , mTextAlignLast(NS_STYLE_TEXT_ALIGN_AUTO) - , mTextAlignTrue(false) - , mTextAlignLastTrue(false) , mTextJustify(StyleTextJustify::Auto) , mTextTransform(NS_STYLE_TEXT_TRANSFORM_NONE) , mWhiteSpace(StyleWhiteSpace::Normal) @@ -4350,8 +4348,6 @@ nsStyleText::nsStyleText(const nsPresContext* aContext) nsStyleText::nsStyleText(const nsStyleText& aSource) : mTextAlign(aSource.mTextAlign) , mTextAlignLast(aSource.mTextAlignLast) - , mTextAlignTrue(false) - , mTextAlignLastTrue(false) , mTextJustify(aSource.mTextJustify) , mTextTransform(aSource.mTextTransform) , mWhiteSpace(aSource.mWhiteSpace) @@ -4402,8 +4398,6 @@ nsStyleText::CalcDifference(const nsStyleText& aNewData) const if ((mTextAlign != aNewData.mTextAlign) || (mTextAlignLast != aNewData.mTextAlignLast) || - (mTextAlignTrue != aNewData.mTextAlignTrue) || - (mTextAlignLastTrue != aNewData.mTextAlignLastTrue) || (mTextTransform != aNewData.mTextTransform) || (mWhiteSpace != aNewData.mWhiteSpace) || (mWordBreak != aNewData.mWordBreak) || diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h index 52463ae9834f..26212e3ec2b2 100644 --- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h @@ -1640,8 +1640,6 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleText uint8_t mTextAlign; // NS_STYLE_TEXT_ALIGN_* uint8_t mTextAlignLast; // NS_STYLE_TEXT_ALIGN_* - bool mTextAlignTrue : 1; - bool mTextAlignLastTrue : 1; mozilla::StyleTextJustify mTextJustify; uint8_t mTextTransform; // NS_STYLE_TEXT_TRANSFORM_* mozilla::StyleWhiteSpace mWhiteSpace;