Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1719)

Unified Diff: Source/core/rendering/RenderInline.cpp

Issue 355843002: Rename style(bool) to styleOrFirstLineStyle(bool) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/RenderDeprecatedFlexibleBox.cpp ('k') | Source/core/rendering/RenderObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderInline.cpp
diff --git a/Source/core/rendering/RenderInline.cpp b/Source/core/rendering/RenderInline.cpp
index 6fba9640d7c062d5f77310715731a72ce9a785fe..1df37ff6bacd66a4243b7c22aeb8c523b4d0b032 100644
--- a/Source/core/rendering/RenderInline.cpp
+++ b/Source/core/rendering/RenderInline.cpp
@@ -216,8 +216,8 @@ void RenderInline::updateAlwaysCreateLineBoxes(bool fullLayout)
if (!alwaysCreateLineBoxes && checkFonts && document().styleEngine()->usesFirstLineRules()) {
// Have to check the first line style as well.
- parentStyle = parent()->style(true);
- RenderStyle* childStyle = style(true);
+ parentStyle = parent()->styleOrFirstLineStyle(true);
+ RenderStyle* childStyle = styleOrFirstLineStyle(true);
alwaysCreateLineBoxes = !parentStyle->font().fontMetrics().hasIdenticalAscentDescentAndLineGap(childStyle->font().fontMetrics())
|| childStyle->verticalAlign() != BASELINE
|| parentStyle->lineHeight() != childStyle->lineHeight();
@@ -556,8 +556,8 @@ void RenderInline::generateCulledLineBoxRects(GeneratorContext& yield, const Ren
RenderBox* currBox = toRenderBox(curr);
if (currBox->inlineBoxWrapper()) {
RootInlineBox& rootBox = currBox->inlineBoxWrapper()->root();
- int logicalTop = rootBox.logicalTop() + (rootBox.renderer().style(rootBox.isFirstLineStyle())->font().fontMetrics().ascent() - container->style(rootBox.isFirstLineStyle())->font().fontMetrics().ascent());
- int logicalHeight = container->style(rootBox.isFirstLineStyle())->font().fontMetrics().height();
+ int logicalTop = rootBox.logicalTop() + (rootBox.renderer().styleOrFirstLineStyle(rootBox.isFirstLineStyle())->font().fontMetrics().ascent() - container->styleOrFirstLineStyle(rootBox.isFirstLineStyle())->font().fontMetrics().ascent());
+ int logicalHeight = container->styleOrFirstLineStyle(rootBox.isFirstLineStyle())->font().fontMetrics().height();
if (isHorizontal)
yield(FloatRect(currBox->inlineBoxWrapper()->x() - currBox->marginLeft(), logicalTop, (currBox->width() + currBox->marginWidth()).toFloat(), logicalHeight));
else
@@ -571,8 +571,8 @@ void RenderInline::generateCulledLineBoxRects(GeneratorContext& yield, const Ren
else {
for (InlineFlowBox* childLine = currInline->firstLineBox(); childLine; childLine = childLine->nextLineBox()) {
RootInlineBox& rootBox = childLine->root();
- int logicalTop = rootBox.logicalTop() + (rootBox.renderer().style(rootBox.isFirstLineStyle())->font().fontMetrics().ascent() - container->style(rootBox.isFirstLineStyle())->font().fontMetrics().ascent());
- int logicalHeight = container->style(rootBox.isFirstLineStyle())->font().fontMetrics().height();
+ int logicalTop = rootBox.logicalTop() + (rootBox.renderer().styleOrFirstLineStyle(rootBox.isFirstLineStyle())->font().fontMetrics().ascent() - container->styleOrFirstLineStyle(rootBox.isFirstLineStyle())->font().fontMetrics().ascent());
+ int logicalHeight = container->styleOrFirstLineStyle(rootBox.isFirstLineStyle())->font().fontMetrics().height();
if (isHorizontal)
yield(FloatRect(childLine->x() - childLine->marginLogicalLeft(),
logicalTop,
@@ -589,8 +589,8 @@ void RenderInline::generateCulledLineBoxRects(GeneratorContext& yield, const Ren
RenderText* currText = toRenderText(curr);
for (InlineTextBox* childText = currText->firstTextBox(); childText; childText = childText->nextTextBox()) {
RootInlineBox& rootBox = childText->root();
- int logicalTop = rootBox.logicalTop() + (rootBox.renderer().style(rootBox.isFirstLineStyle())->font().fontMetrics().ascent() - container->style(rootBox.isFirstLineStyle())->font().fontMetrics().ascent());
- int logicalHeight = container->style(rootBox.isFirstLineStyle())->font().fontMetrics().height();
+ int logicalTop = rootBox.logicalTop() + (rootBox.renderer().styleOrFirstLineStyle(rootBox.isFirstLineStyle())->font().fontMetrics().ascent() - container->styleOrFirstLineStyle(rootBox.isFirstLineStyle())->font().fontMetrics().ascent());
+ int logicalHeight = container->styleOrFirstLineStyle(rootBox.isFirstLineStyle())->font().fontMetrics().height();
if (isHorizontal)
yield(FloatRect(childText->x(), logicalTop, childText->logicalWidth(), logicalHeight));
else
@@ -1281,7 +1281,7 @@ InlineFlowBox* RenderInline::createAndAppendInlineFlowBox()
LayoutUnit RenderInline::lineHeight(bool firstLine, LineDirectionMode /*direction*/, LinePositionMode /*linePositionMode*/) const
{
if (firstLine && document().styleEngine()->usesFirstLineRules()) {
- RenderStyle* s = style(firstLine);
+ RenderStyle* s = styleOrFirstLineStyle(firstLine);
if (s != style())
return s->computedLineHeight();
}
@@ -1292,7 +1292,7 @@ LayoutUnit RenderInline::lineHeight(bool firstLine, LineDirectionMode /*directio
int RenderInline::baselinePosition(FontBaseline baselineType, bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
{
ASSERT(linePositionMode == PositionOnContainingLine);
- const FontMetrics& fontMetrics = style(firstLine)->fontMetrics();
+ const FontMetrics& fontMetrics = styleOrFirstLineStyle(firstLine)->fontMetrics();
return fontMetrics.ascent(baselineType) + (lineHeight(firstLine, direction, linePositionMode) - fontMetrics.height()) / 2;
}
« no previous file with comments | « Source/core/rendering/RenderDeprecatedFlexibleBox.cpp ('k') | Source/core/rendering/RenderObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698