Commit b23891f2 authored by Fredrik Söderquist's avatar Fredrik Söderquist Committed by Commit Bot

Use DataEquivalent(...) when comparing StyleSVGResources

While the underlying SVGResource should be unique (or nullptr - for
invalid cases), the StyleSVGResource wrapper usually isn't. Hence we
need to use DataEquivalent(...) to properly determine equality.

Bug: 769774, 855914
Change-Id: I333bc7a737d0635aabe35e39bb066edbc4282790
Reviewed-on: https://chromium-review.googlesource.com/1118219Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#571099}
parent 59587b94
...@@ -34,7 +34,7 @@ namespace blink { ...@@ -34,7 +34,7 @@ namespace blink {
bool SVGPaint::operator==(const SVGPaint& other) const { bool SVGPaint::operator==(const SVGPaint& other) const {
return type == other.type && color == other.color && return type == other.type && color == other.color &&
resource == other.resource; DataEquivalent(resource, other.resource);
} }
StyleFillData::StyleFillData() StyleFillData::StyleFillData()
...@@ -117,7 +117,7 @@ StyleResourceData::StyleResourceData(const StyleResourceData& other) ...@@ -117,7 +117,7 @@ StyleResourceData::StyleResourceData(const StyleResourceData& other)
: RefCounted<StyleResourceData>(), masker(other.masker) {} : RefCounted<StyleResourceData>(), masker(other.masker) {}
bool StyleResourceData::operator==(const StyleResourceData& other) const { bool StyleResourceData::operator==(const StyleResourceData& other) const {
return masker == other.masker; return DataEquivalent(masker, other.masker);
} }
StyleInheritedResourceData::StyleInheritedResourceData() StyleInheritedResourceData::StyleInheritedResourceData()
...@@ -134,8 +134,9 @@ StyleInheritedResourceData::StyleInheritedResourceData( ...@@ -134,8 +134,9 @@ StyleInheritedResourceData::StyleInheritedResourceData(
bool StyleInheritedResourceData::operator==( bool StyleInheritedResourceData::operator==(
const StyleInheritedResourceData& other) const { const StyleInheritedResourceData& other) const {
return marker_start == other.marker_start && marker_mid == other.marker_mid && return DataEquivalent(marker_start, other.marker_start) &&
marker_end == other.marker_end; DataEquivalent(marker_mid, other.marker_mid) &&
DataEquivalent(marker_end, other.marker_end);
} }
StyleGeometryData::StyleGeometryData() StyleGeometryData::StyleGeometryData()
......
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