зеркало из https://github.com/mozilla/gecko-dev.git
Fix crash and incorrect calculation of percentage line-height by computing relative to self's font-size rather than parent's font size. r=pierre sr=hyatt b=111405
This commit is contained in:
Родитель
ee30eb36ed
Коммит
ed2b034b08
|
@ -2196,9 +2196,9 @@ nsRuleNode::ComputeTextData(nsStyleStruct* aStartStruct, const nsCSSStruct& aDat
|
|||
// line-height: normal, number, length, percent, inherit
|
||||
if (eCSSUnit_Percent == textData.mLineHeight.GetUnit()) {
|
||||
aInherited = PR_TRUE;
|
||||
const nsStyleFont* parentFont = NS_STATIC_CAST(const nsStyleFont*,
|
||||
parentContext->GetStyleData(eStyleStruct_Font));
|
||||
text->mLineHeight.SetCoordValue((nscoord)((float)(parentFont->mSize) *
|
||||
const nsStyleFont* font = NS_STATIC_CAST(const nsStyleFont*,
|
||||
aContext->GetStyleData(eStyleStruct_Font));
|
||||
text->mLineHeight.SetCoordValue((nscoord)((float)(font->mSize) *
|
||||
textData.mLineHeight.GetPercentValue()));
|
||||
} else
|
||||
SetCoord(textData.mLineHeight, text->mLineHeight, parentText->mLineHeight,
|
||||
|
|
|
@ -2196,9 +2196,9 @@ nsRuleNode::ComputeTextData(nsStyleStruct* aStartStruct, const nsCSSStruct& aDat
|
|||
// line-height: normal, number, length, percent, inherit
|
||||
if (eCSSUnit_Percent == textData.mLineHeight.GetUnit()) {
|
||||
aInherited = PR_TRUE;
|
||||
const nsStyleFont* parentFont = NS_STATIC_CAST(const nsStyleFont*,
|
||||
parentContext->GetStyleData(eStyleStruct_Font));
|
||||
text->mLineHeight.SetCoordValue((nscoord)((float)(parentFont->mSize) *
|
||||
const nsStyleFont* font = NS_STATIC_CAST(const nsStyleFont*,
|
||||
aContext->GetStyleData(eStyleStruct_Font));
|
||||
text->mLineHeight.SetCoordValue((nscoord)((float)(font->mSize) *
|
||||
textData.mLineHeight.GetPercentValue()));
|
||||
} else
|
||||
SetCoord(textData.mLineHeight, text->mLineHeight, parentText->mLineHeight,
|
||||
|
|
Загрузка…
Ссылка в новой задаче