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

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

Issue 889563002: Make RenderObject::style() return a const object (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix a crashers (everything is building!) 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/TextAutosizer.cpp
diff --git a/Source/core/rendering/TextAutosizer.cpp b/Source/core/rendering/TextAutosizer.cpp
index f3ebe7f45eb89003dc8e37a9551fbe1aa148e64a..a9a9ca9cad5da4a524c82f6351f4ae820bb87c43 100644
--- a/Source/core/rendering/TextAutosizer.cpp
+++ b/Source/core/rendering/TextAutosizer.cpp
@@ -222,7 +222,7 @@ static bool blockHeightConstrained(const RenderBlock* block)
// FIXME: This code needs to take into account vertical writing modes.
// FIXME: Consider additional heuristics, such as ignoring fixed heights if the content is already overflowing before autosizing kicks in.
for (; block; block = block->containingBlock()) {
- RenderStyle* style = block->style();
+ const RenderStyle* style = block->style();
if (style->overflowY() >= OSCROLL)
return false;
if (style->height().isSpecified() || style->maxHeight().isSpecified() || block->isOutOfFlowPositioned()) {
@@ -566,7 +566,7 @@ void TextAutosizer::resetMultipliers()
{
RenderObject* renderer = m_document->renderView();
while (renderer) {
- if (RenderStyle* style = renderer->style()) {
+ if (const RenderStyle* style = renderer->style()) {
if (style->textAutosizingMultiplier() != 1)
applyMultiplier(renderer, 1, LayoutNeeded);
}
@@ -685,7 +685,7 @@ TextAutosizer::Fingerprint TextAutosizer::computeFingerprint(const RenderObject*
data.m_qualifiedNameHash = QualifiedNameHash::hash(toElement(node)->tagQName());
- if (RenderStyle* style = renderer->style()) {
+ if (const RenderStyle* style = renderer->style()) {
data.m_packedStyleProperties = style->direction();
data.m_packedStyleProperties |= (style->position() << 1);
data.m_packedStyleProperties |= (style->floating() << 4);
@@ -964,7 +964,7 @@ const RenderObject* TextAutosizer::findTextLeaf(const RenderObject* parent, size
void TextAutosizer::applyMultiplier(RenderObject* renderer, float multiplier, RelayoutBehavior relayoutBehavior)
{
ASSERT(renderer && renderer->style());
- RenderStyle* currentStyle = renderer->style();
+ RenderStyle* currentStyle = renderer->deprecatedMutableStyle();
rune 2015/01/29 23:16:32 You need a mutable style here for storing a RefPtr
Julien - ping for review 2015/02/10 07:33:19 Indeed.
if (currentStyle->textAutosizingMultiplier() == multiplier)
return;

Powered by Google App Engine
This is Rietveld 408576698