Commit c6b239ff authored by Fredrik Söderqvist's avatar Fredrik Söderqvist Committed by Commit Bot

Drop ComputedStyle argument to SVGResourcesCache::ClientStyleChanged

This is always the current ComputedStyle for the LayoutObject that is
passed, so just access it via the LayoutObject.

Bug: 1028063
Change-Id: I2579603bdbb86a17fe9663d09d0b88563cb3676c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2455746
Commit-Queue: Stephen Chenney <schenney@chromium.org>
Auto-Submit: Fredrik Söderquist <fs@opera.com>
Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814647}
parent 16f7943a
...@@ -141,7 +141,7 @@ void LayoutSVGBlock::StyleDidChange(StyleDifference diff, ...@@ -141,7 +141,7 @@ void LayoutSVGBlock::StyleDidChange(StyleDifference diff,
LayoutBlock::StyleDidChange(diff, old_style); LayoutBlock::StyleDidChange(diff, old_style);
SVGResources::UpdateClipPathFilterMask(*GetElement(), old_style, StyleRef()); SVGResources::UpdateClipPathFilterMask(*GetElement(), old_style, StyleRef());
SVGResourcesCache::ClientStyleChanged(*this, diff, StyleRef()); SVGResourcesCache::ClientStyleChanged(*this, diff);
} }
void LayoutSVGBlock::MapLocalToAncestor(const LayoutBoxModelObject* ancestor, void LayoutSVGBlock::MapLocalToAncestor(const LayoutBoxModelObject* ancestor,
......
...@@ -141,7 +141,7 @@ void LayoutSVGInline::StyleDidChange(StyleDifference diff, ...@@ -141,7 +141,7 @@ void LayoutSVGInline::StyleDidChange(StyleDifference diff,
SVGResources::UpdateClipPathFilterMask(To<SVGElement>(*GetNode()), old_style, SVGResources::UpdateClipPathFilterMask(To<SVGElement>(*GetNode()), old_style,
StyleRef()); StyleRef());
SVGResources::UpdatePaints(To<SVGElement>(*GetNode()), old_style, StyleRef()); SVGResources::UpdatePaints(To<SVGElement>(*GetNode()), old_style, StyleRef());
SVGResourcesCache::ClientStyleChanged(*this, diff, StyleRef()); SVGResourcesCache::ClientStyleChanged(*this, diff);
} }
void LayoutSVGInline::AddChild(LayoutObject* child, void LayoutSVGInline::AddChild(LayoutObject* child,
......
...@@ -172,7 +172,7 @@ void LayoutSVGModelObject::StyleDidChange(StyleDifference diff, ...@@ -172,7 +172,7 @@ void LayoutSVGModelObject::StyleDidChange(StyleDifference diff,
LayoutObject::StyleDidChange(diff, old_style); LayoutObject::StyleDidChange(diff, old_style);
SVGResources::UpdateClipPathFilterMask(*GetElement(), old_style, StyleRef()); SVGResources::UpdateClipPathFilterMask(*GetElement(), old_style, StyleRef());
SVGResourcesCache::ClientStyleChanged(*this, diff, StyleRef()); SVGResourcesCache::ClientStyleChanged(*this, diff);
} }
void LayoutSVGModelObject::InsertedIntoTree() { void LayoutSVGModelObject::InsertedIntoTree() {
......
...@@ -385,7 +385,7 @@ void LayoutSVGRoot::StyleDidChange(StyleDifference diff, ...@@ -385,7 +385,7 @@ void LayoutSVGRoot::StyleDidChange(StyleDifference diff,
LayoutReplaced::StyleDidChange(diff, old_style); LayoutReplaced::StyleDidChange(diff, old_style);
SVGResources::UpdateClipPathFilterMask(To<SVGSVGElement>(*GetNode()), SVGResources::UpdateClipPathFilterMask(To<SVGSVGElement>(*GetNode()),
old_style, StyleRef()); old_style, StyleRef());
SVGResourcesCache::ClientStyleChanged(*this, diff, StyleRef()); SVGResourcesCache::ClientStyleChanged(*this, diff);
} }
bool LayoutSVGRoot::IsChildAllowed(LayoutObject* child, bool LayoutSVGRoot::IsChildAllowed(LayoutObject* child,
......
...@@ -100,8 +100,7 @@ static inline bool IsLayoutObjectOfResourceContainer( ...@@ -100,8 +100,7 @@ static inline bool IsLayoutObjectOfResourceContainer(
} }
void SVGResourcesCache::ClientStyleChanged(LayoutObject& layout_object, void SVGResourcesCache::ClientStyleChanged(LayoutObject& layout_object,
StyleDifference diff, StyleDifference diff) {
const ComputedStyle& new_style) {
DCHECK(layout_object.GetNode()); DCHECK(layout_object.GetNode());
DCHECK(layout_object.GetNode()->IsSVGElement()); DCHECK(layout_object.GetNode()->IsSVGElement());
...@@ -119,8 +118,10 @@ void SVGResourcesCache::ClientStyleChanged(LayoutObject& layout_object, ...@@ -119,8 +118,10 @@ void SVGResourcesCache::ClientStyleChanged(LayoutObject& layout_object,
// oldStyle/newStyle to see which resources changed to be able to selectively // oldStyle/newStyle to see which resources changed to be able to selectively
// rebuild individual resources, instead of all of them. // rebuild individual resources, instead of all of them.
SVGResourcesCache& cache = ResourcesCache(layout_object.GetDocument()); SVGResourcesCache& cache = ResourcesCache(layout_object.GetDocument());
if (cache.UpdateResourcesFromLayoutObject(layout_object, new_style)) if (cache.UpdateResourcesFromLayoutObject(layout_object,
layout_object.StyleRef())) {
layout_object.SetNeedsPaintPropertyUpdate(); layout_object.SetNeedsPaintPropertyUpdate();
}
// If this layoutObject is the child of ResourceContainer and it require // If this layoutObject is the child of ResourceContainer and it require
// repainting that changes of CSS properties such as 'visibility', // repainting that changes of CSS properties such as 'visibility',
......
...@@ -53,9 +53,7 @@ class SVGResourcesCache { ...@@ -53,9 +53,7 @@ class SVGResourcesCache {
static void ClientDestroyed(LayoutObject&); static void ClientDestroyed(LayoutObject&);
// Called from all SVG layoutObjects styleDidChange() methods. // Called from all SVG layoutObjects styleDidChange() methods.
static void ClientStyleChanged(LayoutObject&, static void ClientStyleChanged(LayoutObject&, StyleDifference);
StyleDifference,
const ComputedStyle& new_style);
// Called when the target element of a resource referenced by the // Called when the target element of a resource referenced by the
// LayoutObject may have changed. // LayoutObject may have changed.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment