Index: Source/core/rendering/RootInlineBox.cpp |
diff --git a/Source/core/rendering/RootInlineBox.cpp b/Source/core/rendering/RootInlineBox.cpp |
index 0c8e831bd53f45de7c826cbe2c4bb726dd1a505e..edeb3e03160fd5834abacdeceda4f94899756cd6 100644 |
--- a/Source/core/rendering/RootInlineBox.cpp |
+++ b/Source/core/rendering/RootInlineBox.cpp |
@@ -797,8 +797,8 @@ void RootInlineBox::ascentAndDescentForBox(InlineBox* box, GlyphOverflowAndFallb |
} |
if (includeFontForBox(box) && !setUsedFont) { |
- int fontAscent = box->renderer()->style(isFirstLineStyle())->fontMetrics().ascent(); |
- int fontDescent = box->renderer()->style(isFirstLineStyle())->fontMetrics().descent(); |
+ int fontAscent = box->renderer()->style(isFirstLineStyle())->fontMetrics().ascent(baselineType()); |
+ int fontDescent = box->renderer()->style(isFirstLineStyle())->fontMetrics().descent(baselineType()); |
setAscentAndDescent(ascent, descent, fontAscent, fontDescent, ascentDescentSet); |
affectsAscent = fontAscent - box->logicalTop() > 0; |
affectsDescent = fontDescent + box->logicalTop() > 0; |
@@ -808,13 +808,13 @@ void RootInlineBox::ascentAndDescentForBox(InlineBox* box, GlyphOverflowAndFallb |
setAscentAndDescent(ascent, descent, glyphOverflow->top, glyphOverflow->bottom, ascentDescentSet); |
affectsAscent = glyphOverflow->top - box->logicalTop() > 0; |
affectsDescent = glyphOverflow->bottom + box->logicalTop() > 0; |
- glyphOverflow->top = min(glyphOverflow->top, max(0, glyphOverflow->top - box->renderer()->style(isFirstLineStyle())->fontMetrics().ascent())); |
- glyphOverflow->bottom = min(glyphOverflow->bottom, max(0, glyphOverflow->bottom - box->renderer()->style(isFirstLineStyle())->fontMetrics().descent())); |
+ glyphOverflow->top = min(glyphOverflow->top, max(0, glyphOverflow->top - box->renderer()->style(isFirstLineStyle())->fontMetrics().ascent(baselineType()))); |
+ glyphOverflow->bottom = min(glyphOverflow->bottom, max(0, glyphOverflow->bottom - box->renderer()->style(isFirstLineStyle())->fontMetrics().descent(baselineType()))); |
} |
if (includeMarginForBox(box)) { |
- LayoutUnit ascentWithMargin = box->renderer()->style(isFirstLineStyle())->fontMetrics().ascent(); |
- LayoutUnit descentWithMargin = box->renderer()->style(isFirstLineStyle())->fontMetrics().descent(); |
+ LayoutUnit ascentWithMargin = box->renderer()->style(isFirstLineStyle())->fontMetrics().ascent(baselineType()); |
+ LayoutUnit descentWithMargin = box->renderer()->style(isFirstLineStyle())->fontMetrics().descent(baselineType()); |
if (box->parent() && !box->renderer()->isText()) { |
ascentWithMargin += box->boxModelObject()->borderBefore() + box->boxModelObject()->paddingBefore() + box->boxModelObject()->marginBefore(); |
descentWithMargin += box->boxModelObject()->borderAfter() + box->boxModelObject()->paddingAfter() + box->boxModelObject()->marginAfter(); |