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

Unified Diff: Source/core/rendering/InlineTextBox.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/InlineFlowBox.cpp ('k') | Source/core/rendering/RenderBR.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/InlineTextBox.cpp
diff --git a/Source/core/rendering/InlineTextBox.cpp b/Source/core/rendering/InlineTextBox.cpp
index 5bf59ce01c682b78c6ee0b46257a3f9379f52c22..85465b1c825142b98e6850344ed6596c43bcb85e 100644
--- a/Source/core/rendering/InlineTextBox.cpp
+++ b/Source/core/rendering/InlineTextBox.cpp
@@ -206,7 +206,7 @@ LayoutRect InlineTextBox::localSelectionRect(int startPos, int endPos)
LayoutUnit selTop = selectionTop();
LayoutUnit selHeight = selectionHeight();
- RenderStyle* styleToUse = textRenderer().style(isFirstLineStyle());
+ RenderStyle* styleToUse = textRenderer().styleOrFirstLineStyle(isFirstLineStyle());
const Font& font = styleToUse->font();
StringBuilder charactersWithHyphen;
@@ -521,7 +521,7 @@ void InlineTextBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset,
GraphicsContext* context = paintInfo.context;
RenderObject& rendererToUse = renderer();
- RenderStyle* styleToUse = rendererToUse.style(isFirstLineStyle());
+ RenderStyle* styleToUse = rendererToUse.styleOrFirstLineStyle(isFirstLineStyle());
adjustedPaintOffset.move(0, styleToUse->isHorizontalWritingMode() ? 0 : -logicalHeight());
@@ -1130,7 +1130,7 @@ void InlineTextBox::paintDecoration(GraphicsContext* context, const FloatPoint&
bool linesAreOpaque = !isPrinting && (!(deco & TextDecorationUnderline) || underline.color.alpha() == 255) && (!(deco & TextDecorationOverline) || overline.color.alpha() == 255) && (!(deco & TextDecorationLineThrough) || linethrough.color.alpha() == 255);
- RenderStyle* styleToUse = renderer().style(isFirstLineStyle());
+ RenderStyle* styleToUse = renderer().styleOrFirstLineStyle(isFirstLineStyle());
int baseline = styleToUse->fontMetrics().ascent();
size_t shadowCount = shadowList ? shadowList->shadows().size() : 0;
@@ -1265,7 +1265,7 @@ void InlineTextBox::paintDocumentMarker(GraphicsContext* pt, const FloatPoint& b
// So, we generally place the underline at the bottom of the text, but in larger fonts that's not so good so
// we pin to two pixels under the baseline.
int lineThickness = misspellingLineThickness;
- int baseline = renderer().style(isFirstLineStyle())->fontMetrics().ascent();
+ int baseline = renderer().styleOrFirstLineStyle(isFirstLineStyle())->fontMetrics().ascent();
int descent = logicalHeight() - baseline;
int underlineOffset;
if (descent <= (2 + lineThickness)) {
@@ -1399,7 +1399,7 @@ void InlineTextBox::paintCompositionUnderline(GraphicsContext* ctx, const FloatP
// All other marked text underlines are 1px thick.
// If there's not enough space the underline will touch or overlap characters.
int lineThickness = 1;
- int baseline = renderer().style(isFirstLineStyle())->fontMetrics().ascent();
+ int baseline = renderer().styleOrFirstLineStyle(isFirstLineStyle())->fontMetrics().ascent();
if (underline.thick && logicalHeight() - baseline >= 2)
lineThickness = 2;
@@ -1445,7 +1445,7 @@ int InlineTextBox::offsetForPosition(float lineOffset, bool includePartialGlyphs
FontCachePurgePreventer fontCachePurgePreventer;
RenderText& text = toRenderText(renderer());
- RenderStyle* style = text.style(isFirstLineStyle());
+ RenderStyle* style = text.styleOrFirstLineStyle(isFirstLineStyle());
const Font& font = style->font();
return font.offsetForPosition(constructTextRun(style, font), lineOffset - logicalLeft(), includePartialGlyphs);
}
@@ -1461,7 +1461,7 @@ float InlineTextBox::positionForOffset(int offset) const
FontCachePurgePreventer fontCachePurgePreventer;
RenderText& text = toRenderText(renderer());
- RenderStyle* styleToUse = text.style(isFirstLineStyle());
+ RenderStyle* styleToUse = text.styleOrFirstLineStyle(isFirstLineStyle());
ASSERT(styleToUse);
const Font& font = styleToUse->font();
int from = !isLeftToRightDirection() ? offset - m_start : 0;
@@ -1498,7 +1498,7 @@ void InlineTextBox::characterWidths(Vector<float>& widths) const
{
FontCachePurgePreventer fontCachePurgePreventer;
- RenderStyle* styleToUse = textRenderer().style(isFirstLineStyle());
+ RenderStyle* styleToUse = textRenderer().styleOrFirstLineStyle(isFirstLineStyle());
const Font& font = styleToUse->font();
TextRun textRun = constructTextRun(styleToUse, font);
« no previous file with comments | « Source/core/rendering/InlineFlowBox.cpp ('k') | Source/core/rendering/RenderBR.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698