Bug 1225018 part 1 - Trigger reflow on some text emphasis changes for line height calculation. r=dbaron

--HG--
extra : source : 96f505fe488a4345906f362beab47db5af94e894
This commit is contained in:
Xidorn Quan 2015-12-04 11:58:59 +11:00
Родитель a816a8a87e
Коммит e0157f6d78
1 изменённых файлов: 13 добавлений и 2 удалений

Просмотреть файл

@ -3632,14 +3632,21 @@ nsChangeHint nsStyleText::CalcDifference(const nsStyleText& aOther) const
(mTabSize != aOther.mTabSize)) (mTabSize != aOther.mTabSize))
return NS_STYLE_HINT_REFLOW; return NS_STYLE_HINT_REFLOW;
if (HasTextEmphasis() != aOther.HasTextEmphasis() ||
(HasTextEmphasis() &&
mTextEmphasisPosition != aOther.mTextEmphasisPosition)) {
// Text emphasis position change could affect line height calculation.
return nsChangeHint_AllReflowHints |
nsChangeHint_RepaintFrame;
}
if (!AreShadowArraysEqual(mTextShadow, aOther.mTextShadow)) { if (!AreShadowArraysEqual(mTextShadow, aOther.mTextShadow)) {
return nsChangeHint_UpdateSubtreeOverflow | return nsChangeHint_UpdateSubtreeOverflow |
nsChangeHint_SchedulePaint | nsChangeHint_SchedulePaint |
nsChangeHint_RepaintFrame; nsChangeHint_RepaintFrame;
} }
if (mTextEmphasisPosition != aOther.mTextEmphasisPosition || if (mTextEmphasisStyle != aOther.mTextEmphasisStyle ||
mTextEmphasisStyle != aOther.mTextEmphasisStyle ||
mTextEmphasisStyleString != aOther.mTextEmphasisStyleString) { mTextEmphasisStyleString != aOther.mTextEmphasisStyleString) {
return nsChangeHint_UpdateOverflow | return nsChangeHint_UpdateOverflow |
nsChangeHint_SchedulePaint | nsChangeHint_SchedulePaint |
@ -3657,6 +3664,10 @@ nsChangeHint nsStyleText::CalcDifference(const nsStyleText& aOther) const
nsChangeHint_RepaintFrame; nsChangeHint_RepaintFrame;
} }
if (mTextEmphasisPosition != aOther.mTextEmphasisPosition) {
return nsChangeHint_NeutralChange;
}
return NS_STYLE_HINT_NONE; return NS_STYLE_HINT_NONE;
} }