Index: Source/core/rendering/RootInlineBox.cpp |
diff --git a/Source/core/rendering/RootInlineBox.cpp b/Source/core/rendering/RootInlineBox.cpp |
index 102c616e374b7a415891b726106197b7c918a6d7..b7aee498fed90be6f4f671f362b4882159f9bd37 100644 |
--- a/Source/core/rendering/RootInlineBox.cpp |
+++ b/Source/core/rendering/RootInlineBox.cpp |
@@ -621,7 +621,7 @@ void RootInlineBox::ascentAndDescentForBox(InlineBox* box, GlyphOverflowAndFallb |
// Replaced boxes will return 0 for the line-height if line-box-contain says they are |
// not to be included. |
if (box->renderer().isReplaced()) { |
- if (renderer().style(isFirstLineStyle())->lineBoxContain() & LineBoxContainReplaced) { |
+ if (renderer().styleOrFirstLineStyle(isFirstLineStyle())->lineBoxContain() & LineBoxContainReplaced) { |
ascent = box->baselinePosition(baselineType()); |
descent = box->lineHeight() - ascent; |
@@ -646,8 +646,8 @@ void RootInlineBox::ascentAndDescentForBox(InlineBox* box, GlyphOverflowAndFallb |
bool setUsedFont = false; |
bool setUsedFontWithLeading = false; |
- if (usedFonts && !usedFonts->isEmpty() && (includeFont || (box->renderer().style(isFirstLineStyle())->lineHeight().isNegative() && includeLeading))) { |
- usedFonts->append(box->renderer().style(isFirstLineStyle())->font().primaryFont()); |
+ if (usedFonts && !usedFonts->isEmpty() && (includeFont || (box->renderer().styleOrFirstLineStyle(isFirstLineStyle())->lineHeight().isNegative() && includeLeading))) { |
+ usedFonts->append(box->renderer().styleOrFirstLineStyle(isFirstLineStyle())->font().primaryFont()); |
for (size_t i = 0; i < usedFonts->size(); ++i) { |
const FontMetrics& fontMetrics = usedFonts->at(i)->fontMetrics(); |
int usedFontAscent = fontMetrics.ascent(baselineType()); |
@@ -685,8 +685,8 @@ void RootInlineBox::ascentAndDescentForBox(InlineBox* box, GlyphOverflowAndFallb |
} |
if (includeFontForBox(box) && !setUsedFont) { |
- int fontAscent = box->renderer().style(isFirstLineStyle())->fontMetrics().ascent(baselineType()); |
- int fontDescent = box->renderer().style(isFirstLineStyle())->fontMetrics().descent(baselineType()); |
+ int fontAscent = box->renderer().styleOrFirstLineStyle(isFirstLineStyle())->fontMetrics().ascent(baselineType()); |
+ int fontDescent = box->renderer().styleOrFirstLineStyle(isFirstLineStyle())->fontMetrics().descent(baselineType()); |
setAscentAndDescent(ascent, descent, fontAscent, fontDescent, ascentDescentSet); |
affectsAscent = fontAscent - box->logicalTop() > 0; |
affectsDescent = fontDescent + box->logicalTop() > 0; |
@@ -696,13 +696,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 = std::min(glyphOverflow->top, std::max(0, glyphOverflow->top - box->renderer().style(isFirstLineStyle())->fontMetrics().ascent(baselineType()))); |
- glyphOverflow->bottom = std::min(glyphOverflow->bottom, std::max(0, glyphOverflow->bottom - box->renderer().style(isFirstLineStyle())->fontMetrics().descent(baselineType()))); |
+ glyphOverflow->top = std::min(glyphOverflow->top, std::max(0, glyphOverflow->top - box->renderer().styleOrFirstLineStyle(isFirstLineStyle())->fontMetrics().ascent(baselineType()))); |
+ glyphOverflow->bottom = std::min(glyphOverflow->bottom, std::max(0, glyphOverflow->bottom - box->renderer().styleOrFirstLineStyle(isFirstLineStyle())->fontMetrics().descent(baselineType()))); |
} |
if (includeMarginForBox(box)) { |
- LayoutUnit ascentWithMargin = box->renderer().style(isFirstLineStyle())->fontMetrics().ascent(baselineType()); |
- LayoutUnit descentWithMargin = box->renderer().style(isFirstLineStyle())->fontMetrics().descent(baselineType()); |
+ LayoutUnit ascentWithMargin = box->renderer().styleOrFirstLineStyle(isFirstLineStyle())->fontMetrics().ascent(baselineType()); |
+ LayoutUnit descentWithMargin = box->renderer().styleOrFirstLineStyle(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(); |
@@ -748,7 +748,7 @@ LayoutUnit RootInlineBox::verticalPositionForBox(InlineBox* box, VerticalPositio |
verticalPosition = box->parent()->logicalTop(); |
if (verticalAlign != BASELINE) { |
- const Font& font = parent->style(firstLine)->font(); |
+ const Font& font = parent->styleOrFirstLineStyle(firstLine)->font(); |
const FontMetrics& fontMetrics = font.fontMetrics(); |
int fontSize = font.fontDescription().computedPixelSize(); |