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

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

Issue 57643004: Pass RenderStyle / RenderObject by reference in more places (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on master Created 7 years, 1 month 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/css/resolver/StyleResolver.h ('k') | Source/core/dom/Document.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleResolver.cpp
diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp
index 111d1e5a783c6b9ada4b8ff012e4c6d77c18b74e..3dad66cbc89f66dee815bb20f58dce13add0dfa2 100644
--- a/Source/core/css/resolver/StyleResolver.cpp
+++ b/Source/core/css/resolver/StyleResolver.cpp
@@ -724,7 +724,7 @@ PassRefPtr<RenderStyle> StyleResolver::styleForElement(Element* element, RenderS
return state.takeStyle();
}
-PassRefPtr<RenderStyle> StyleResolver::styleForKeyframe(Element* e, const RenderStyle* elementStyle, const StyleKeyframe* keyframe)
+PassRefPtr<RenderStyle> StyleResolver::styleForKeyframe(Element* e, const RenderStyle& elementStyle, const StyleKeyframe* keyframe)
{
ASSERT(document().frame());
ASSERT(documentSettings());
@@ -740,7 +740,7 @@ PassRefPtr<RenderStyle> StyleResolver::styleForKeyframe(Element* e, const Render
ASSERT(!state.style());
// Create the style
- state.setStyle(RenderStyle::clone(elementStyle));
+ state.setStyle(RenderStyle::clone(&elementStyle));
state.setLineHeightValue(0);
state.fontBuilder().initForStyleResolve(state.document(), state.style(), state.useSVGZoomRules());
@@ -794,7 +794,7 @@ const StyleRuleKeyframes* StyleResolver::matchScopedKeyframesRule(const Element*
return 0;
}
-void StyleResolver::keyframeStylesForAnimation(Element* e, const RenderStyle* elementStyle, KeyframeList& list)
+void StyleResolver::keyframeStylesForAnimation(Element* e, const RenderStyle& elementStyle, KeyframeList& list)
{
ASSERT(!RuntimeEnabledFeatures::webAnimationsCSSEnabled());
list.clear();
@@ -853,7 +853,7 @@ void StyleResolver::keyframeStylesForAnimation(Element* e, const RenderStyle* el
}
}
-void StyleResolver::resolveKeyframes(Element* element, const RenderStyle* style, const AtomicString& name, TimingFunction* defaultTimingFunction, Vector<std::pair<KeyframeAnimationEffect::KeyframeVector, RefPtr<TimingFunction> > >& keyframesAndTimingFunctions)
+void StyleResolver::resolveKeyframes(Element* element, const RenderStyle& style, const AtomicString& name, TimingFunction* defaultTimingFunction, Vector<std::pair<KeyframeAnimationEffect::KeyframeVector, RefPtr<TimingFunction> > >& keyframesAndTimingFunctions)
{
ASSERT(RuntimeEnabledFeatures::webAnimationsCSSEnabled());
const StyleRuleKeyframes* keyframesRule = matchScopedKeyframesRule(element, name.impl());
@@ -882,7 +882,7 @@ void StyleResolver::resolveKeyframes(Element* element, const RenderStyle* style,
// FIXME: This sometimes gets the wrong timing function. See crbug.com/288540.
timingFunction = KeyframeValue::timingFunction(keyframeStyle.get(), name);
} else if (CSSAnimations::isAnimatableProperty(property)) {
- keyframe->setPropertyValue(property, CSSAnimatableValueFactory::create(property, keyframeStyle.get()).get());
+ keyframe->setPropertyValue(property, CSSAnimatableValueFactory::create(property, *keyframeStyle).get());
}
}
keyframes.append(keyframe);
@@ -1503,7 +1503,7 @@ void StyleResolver::applyMatchedProperties(StyleResolverState& state, const Matc
// animatingElement may be null, for example if we're calculating the
// style for a potential pseudo element that has yet to be created.
if (RuntimeEnabledFeatures::webAnimationsEnabled() && animatingElement) {
- state.setAnimationUpdate(CSSAnimations::calculateUpdate(animatingElement, state.style(), this));
+ state.setAnimationUpdate(CSSAnimations::calculateUpdate(animatingElement, *state.style(), this));
if (state.animationUpdate()) {
ASSERT(!applyInheritedOnly);
const AnimationEffect::CompositableValueMap& compositableValuesForAnimations = state.animationUpdate()->compositableValuesForAnimations();
« no previous file with comments | « Source/core/css/resolver/StyleResolver.h ('k') | Source/core/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698