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

Unified Diff: Source/core/layout/LayoutObject.cpp

Issue 889563002: Make RenderObject::style() return a const object (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated patch after splitting Created 5 years, 10 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/layout/LayoutObject.cpp
diff --git a/Source/core/layout/LayoutObject.cpp b/Source/core/layout/LayoutObject.cpp
index a2eff977c44b9d034295421467284874e5985a7f..cd4e255fe2479e510d25a00a9f9d28bb88044391 100644
--- a/Source/core/layout/LayoutObject.cpp
+++ b/Source/core/layout/LayoutObject.cpp
@@ -2620,11 +2620,11 @@ static PassRefPtr<LayoutStyle> firstLineStyleForCachedUncachedType(StyleCacheSta
}
} else if (!rendererForFirstLineStyle->isAnonymous() && rendererForFirstLineStyle->isRenderInline()
&& !rendererForFirstLineStyle->node()->isFirstLetterPseudoElement()) {
- LayoutStyle* parentStyle = rendererForFirstLineStyle->parent()->firstLineStyle();
+ const LayoutStyle* parentStyle = rendererForFirstLineStyle->parent()->firstLineStyle();
if (parentStyle != rendererForFirstLineStyle->parent()->style()) {
if (type == Cached) {
// A first-line style is in effect. Cache a first-line style for ourselves.
- rendererForFirstLineStyle->style()->setHasPseudoStyle(FIRST_LINE_INHERITED);
+ rendererForFirstLineStyle->mutableStyle()->setHasPseudoStyle(FIRST_LINE_INHERITED);
return rendererForFirstLineStyle->getCachedPseudoStyle(FIRST_LINE_INHERITED, parentStyle);
}
return rendererForFirstLineStyle->getUncachedPseudoStyle(PseudoStyleRequest(FIRST_LINE_INHERITED), parentStyle, style);
@@ -2653,7 +2653,7 @@ LayoutStyle* LayoutObject::cachedFirstLineStyle() const
return m_style.get();
}
-LayoutStyle* LayoutObject::getCachedPseudoStyle(PseudoId pseudo, LayoutStyle* parentStyle) const
+LayoutStyle* LayoutObject::getCachedPseudoStyle(PseudoId pseudo, const LayoutStyle* parentStyle) const
{
if (pseudo < FIRST_INTERNAL_PSEUDOID && !style()->hasPseudoStyle(pseudo))
return 0;
@@ -2664,11 +2664,11 @@ LayoutStyle* LayoutObject::getCachedPseudoStyle(PseudoId pseudo, LayoutStyle* pa
RefPtr<LayoutStyle> result = getUncachedPseudoStyle(PseudoStyleRequest(pseudo), parentStyle);
if (result)
- return style()->addCachedPseudoStyle(result.release());
+ return mutableStyle()->addCachedPseudoStyle(result.release());
return 0;
}
-PassRefPtr<LayoutStyle> LayoutObject::getUncachedPseudoStyle(const PseudoStyleRequest& pseudoStyleRequest, LayoutStyle* parentStyle, LayoutStyle* ownStyle) const
+PassRefPtr<LayoutStyle> LayoutObject::getUncachedPseudoStyle(const PseudoStyleRequest& pseudoStyleRequest, const LayoutStyle* parentStyle, const LayoutStyle* ownStyle) const
{
if (pseudoStyleRequest.pseudoId < FIRST_INTERNAL_PSEUDOID && !ownStyle && !style()->hasPseudoStyle(pseudoStyleRequest.pseudoId))
return nullptr;
@@ -2713,7 +2713,7 @@ PassRefPtr<LayoutStyle> LayoutObject::getUncachedPseudoStyleFromParentOrShadowHo
void LayoutObject::getTextDecorations(unsigned decorations, AppliedTextDecoration& underline, AppliedTextDecoration& overline, AppliedTextDecoration& linethrough, bool quirksMode, bool firstlineStyle)
{
LayoutObject* curr = this;
- LayoutStyle* styleToUse = 0;
+ const LayoutStyle* styleToUse = 0;
unsigned currDecs = TextDecorationNone;
Color resultColor;
TextDecorationStyle resultStyle;

Powered by Google App Engine
This is Rietveld 408576698