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

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

Issue 351033003: Simplify use of styleOrFirstLineStyle (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@rename-style-bool-to-0
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/RenderBlock.cpp ('k') | no next file » | 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 1df37ff6bacd66a4243b7c22aeb8c523b4d0b032..85acdb99d62ed2f27f723516aa4a9d6a2ea81ff6 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()->styleOrFirstLineStyle(true);
- RenderStyle* childStyle = styleOrFirstLineStyle(true);
+ parentStyle = parent()->firstLineStyle();
+ RenderStyle* childStyle = firstLineStyle();
alwaysCreateLineBoxes = !parentStyle->font().fontMetrics().hasIdenticalAscentDescentAndLineGap(childStyle->font().fontMetrics())
|| childStyle->verticalAlign() != BASELINE
|| parentStyle->lineHeight() != childStyle->lineHeight();
@@ -1280,13 +1280,7 @@ InlineFlowBox* RenderInline::createAndAppendInlineFlowBox()
LayoutUnit RenderInline::lineHeight(bool firstLine, LineDirectionMode /*direction*/, LinePositionMode /*linePositionMode*/) const
{
- if (firstLine && document().styleEngine()->usesFirstLineRules()) {
- RenderStyle* s = styleOrFirstLineStyle(firstLine);
- if (s != style())
- return s->computedLineHeight();
- }
-
- return style()->computedLineHeight();
+ return styleOrFirstLineStyle(firstLine)->computedLineHeight();
}
int RenderInline::baselinePosition(FontBaseline baselineType, bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
« no previous file with comments | « Source/core/rendering/RenderBlock.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698