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

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

Issue 889563002: Make RenderObject::style() return a const object (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Blind fix for Mac. Created 5 years, 11 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
Index: Source/core/rendering/RenderText.cpp
diff --git a/Source/core/rendering/RenderText.cpp b/Source/core/rendering/RenderText.cpp
index 7a80283427814932a529ad7cbfbb4096192223da..27fe7bc9ad40dfd9371406b4077e548828340649 100644
--- a/Source/core/rendering/RenderText.cpp
+++ b/Source/core/rendering/RenderText.cpp
@@ -200,7 +200,7 @@ void RenderText::styleDidChange(StyleDifference diff, const RenderStyle* oldStyl
m_knownToHaveNoOverflowAndNoFallbackFonts = false;
}
- RenderStyle* newStyle = style();
+ const RenderStyle* newStyle = style();
ETextTransform oldTransform = oldStyle ? oldStyle->textTransform() : TTNONE;
ETextSecurity oldSecurity = oldStyle ? oldStyle->textSecurity() : TSNONE;
if (oldTransform != newStyle->textTransform() || oldSecurity != newStyle->textSecurity())
@@ -668,7 +668,7 @@ LayoutRect RenderText::localCaretRect(InlineBox* inlineBox, int caretOffset, Lay
*extraWidthToEndOfLine = (box->root().logicalWidth() + rootLeft) - (left + 1);
RenderBlock* cb = containingBlock();
- RenderStyle* cbStyle = cb->style();
+ const RenderStyle* cbStyle = cb->style();
float leftEdge;
float rightEdge;
@@ -727,7 +727,7 @@ ALWAYS_INLINE float RenderText::widthFromCache(const Font& f, int start, int len
bool isSpace;
ASSERT(m_text);
StringImpl& text = *m_text.impl();
- RenderStyle* renderStyle = style();
+ const RenderStyle* renderStyle = style();
for (int i = start; i < start + len; i++) {
char c = text[i];
// If glyph is not present in primary font then we cannot calculate width based on primary
@@ -893,7 +893,7 @@ void RenderText::computePreferredLogicalWidths(float leadWidth)
static inline float hyphenWidth(RenderText* renderer, const Font& font, TextDirection direction)
{
- RenderStyle* style = renderer->style();
+ const RenderStyle* style = renderer->style();
return font.width(constructTextRun(renderer, font, style->hyphenString().string(), style, direction));
}
@@ -918,7 +918,7 @@ void RenderText::computePreferredLogicalWidths(float leadWidth, HashSet<const Si
m_hasBreakableEnd = false;
m_hasEndWhiteSpace = false;
- RenderStyle* styleToUse = style();
+ const RenderStyle* styleToUse = style();
const Font& f = styleToUse->font(); // FIXME: This ignores first-line.
float wordSpacing = styleToUse->wordSpacing();
int len = textLength();

Powered by Google App Engine
This is Rietveld 408576698