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

Unified Diff: trunk/Source/core/css/resolver/StyleResolver.cpp

Issue 948053002: Revert 190605 "Make RenderObject::style() return a const object" (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: 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
« no previous file with comments | « trunk/Source/core/css/resolver/StyleResolver.h ('k') | trunk/Source/core/css/resolver/StyleResolverState.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/Source/core/css/resolver/StyleResolver.cpp
===================================================================
--- trunk/Source/core/css/resolver/StyleResolver.cpp (revision 190671)
+++ trunk/Source/core/css/resolver/StyleResolver.cpp (working copy)
@@ -527,7 +527,7 @@
document().styleEngine()->fontSelector()->fontLoader()->loadPendingFonts();
}
-PassRefPtr<LayoutStyle> StyleResolver::styleForElement(Element* element, const LayoutStyle* defaultParent, StyleSharingBehavior sharingBehavior,
+PassRefPtr<LayoutStyle> StyleResolver::styleForElement(Element* element, LayoutStyle* defaultParent, StyleSharingBehavior sharingBehavior,
RuleMatchingBehavior matchingBehavior)
{
ASSERT(document().frame());
@@ -584,7 +584,7 @@
// be propagated from shadow host to distributed node.
if (state.distributedToInsertionPoint()) {
if (Element* parent = element->parentElement()) {
- if (LayoutStyle* styleOfShadowHost = parent->mutableLayoutStyle())
+ if (LayoutStyle* styleOfShadowHost = parent->layoutStyle())
state.style()->setUserModify(styleOfShadowHost->userModify());
}
}
@@ -648,7 +648,7 @@
return state.takeStyle();
}
-PassRefPtr<LayoutStyle> StyleResolver::styleForKeyframe(Element& element, const LayoutStyle& elementStyle, const LayoutStyle* parentStyle, const StyleRuleKeyframe* keyframe, const AtomicString& animationName)
+PassRefPtr<LayoutStyle> StyleResolver::styleForKeyframe(Element& element, const LayoutStyle& elementStyle, LayoutStyle* parentStyle, const StyleRuleKeyframe* keyframe, const AtomicString& animationName)
{
ASSERT(document().frame());
ASSERT(document().settings());
@@ -690,7 +690,7 @@
PassRefPtrWillBeRawPtr<AnimatableValue> StyleResolver::createAnimatableValueSnapshot(Element& element, CSSPropertyID property, CSSValue& value)
{
RefPtr<LayoutStyle> style;
- if (const LayoutStyle* elementStyle = element.layoutStyle())
+ if (LayoutStyle* elementStyle = element.layoutStyle())
style = LayoutStyle::clone(*elementStyle);
else
style = LayoutStyle::create();
@@ -733,8 +733,8 @@
if (!parentRenderer->canHaveGeneratedChildren())
return nullptr;
- LayoutStyle* parentStyle = parentRenderer->mutableStyle();
- if (const LayoutStyle* cachedStyle = parentStyle->getCachedPseudoStyle(pseudoId)) {
+ LayoutStyle* parentStyle = parentRenderer->style();
+ if (LayoutStyle* cachedStyle = parentStyle->getCachedPseudoStyle(pseudoId)) {
if (!pseudoElementRendererIsNeeded(cachedStyle))
return nullptr;
return createPseudoElement(&parent, pseudoId);
@@ -758,7 +758,7 @@
return pseudo.release();
}
-bool StyleResolver::pseudoStyleForElementInternal(Element& element, const PseudoStyleRequest& pseudoStyleRequest, const LayoutStyle* parentStyle, StyleResolverState& state)
+bool StyleResolver::pseudoStyleForElementInternal(Element& element, const PseudoStyleRequest& pseudoStyleRequest, LayoutStyle* parentStyle, StyleResolverState& state)
{
ASSERT(document().frame());
ASSERT(document().settings());
@@ -827,7 +827,7 @@
return true;
}
-PassRefPtr<LayoutStyle> StyleResolver::pseudoStyleForElement(Element* element, const PseudoStyleRequest& pseudoStyleRequest, const LayoutStyle* parentStyle)
+PassRefPtr<LayoutStyle> StyleResolver::pseudoStyleForElement(Element* element, const PseudoStyleRequest& pseudoStyleRequest, LayoutStyle* parentStyle)
{
ASSERT(parentStyle);
if (!element)
@@ -916,7 +916,7 @@
Node* parentNode = NodeRenderingTraversal::parent(*textNode);
if (!parentNode || !parentNode->layoutStyle())
return defaultStyleForElement();
- return parentNode->mutableLayoutStyle();
+ return parentNode->layoutStyle();
}
void StyleResolver::updateFont(StyleResolverState& state)
« no previous file with comments | « trunk/Source/core/css/resolver/StyleResolver.h ('k') | trunk/Source/core/css/resolver/StyleResolverState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698