Commit 1c4e2be8 authored by Fredrik Söderqvist's avatar Fredrik Söderqvist Committed by Chromium LUCI CQ

Drop SVGPoint::SetValueAsString

It's never called (there are no attributes of this type). When point
syntax is used in attributes (for example for point lists or
<animateMotion>) they open-code the parsing.

Change-Id: I9c28a3c6a7c5d3b51d2d2df87d6de86b33e63bbb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2643285
Auto-Submit: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Stephen Chenney <schenney@chromium.org>
Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#846103}
parent 5c27d8a3
......@@ -30,10 +30,8 @@
#include "third_party/blink/renderer/core/svg/svg_point.h"
#include "third_party/blink/renderer/core/svg/svg_parser_utilities.h"
#include "third_party/blink/renderer/platform/heap/heap.h"
#include "third_party/blink/renderer/platform/transforms/affine_transform.h"
#include "third_party/blink/renderer/platform/wtf/text/character_visitor.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
......@@ -53,23 +51,6 @@ SVGPropertyBase* SVGPoint::CloneForAnimation(const String& value) const {
return nullptr;
}
template <typename CharType>
SVGParsingError SVGPoint::Parse(const CharType* ptr, const CharType* end) {
float x = 0;
float y = 0;
if (!ParseNumber(ptr, end, x) ||
!ParseNumber(ptr, end, y, kDisallowWhitespace))
return SVGParseStatus::kExpectedNumber;
if (SkipOptionalSVGSpaces(ptr, end)) {
// Nothing should come after the second number.
return SVGParseStatus::kTrailingGarbage;
}
value_ = FloatPoint(x, y);
return SVGParseStatus::kNoError;
}
FloatPoint SVGPoint::MatrixTransform(const AffineTransform& transform) const {
double new_x, new_y;
transform.Map(static_cast<double>(X()), static_cast<double>(Y()), new_x,
......@@ -77,16 +58,6 @@ FloatPoint SVGPoint::MatrixTransform(const AffineTransform& transform) const {
return FloatPoint::NarrowPrecision(new_x, new_y);
}
SVGParsingError SVGPoint::SetValueAsString(const String& string) {
if (string.IsEmpty()) {
value_ = FloatPoint(0.0f, 0.0f);
return SVGParseStatus::kNoError;
}
return WTF::VisitCharacters(string, [&](const auto* chars, unsigned length) {
return Parse(chars, chars + length);
});
}
String SVGPoint::ValueAsString() const {
StringBuilder builder;
builder.AppendNumber(X());
......
......@@ -32,7 +32,6 @@
#define THIRD_PARTY_BLINK_RENDERER_CORE_SVG_SVG_POINT_H_
#include "third_party/blink/renderer/core/svg/properties/svg_listable_property.h"
#include "third_party/blink/renderer/core/svg/svg_parsing_error.h"
#include "third_party/blink/renderer/platform/geometry/float_point.h"
#include "third_party/blink/renderer/platform/wtf/casting.h"
......@@ -62,7 +61,6 @@ class SVGPoint final : public SVGListablePropertyBase {
FloatPoint MatrixTransform(const AffineTransform&) const;
String ValueAsString() const override;
SVGParsingError SetValueAsString(const String&);
void Add(const SVGPropertyBase*, const SVGElement*) override;
void CalculateAnimatedValue(
......@@ -80,9 +78,6 @@ class SVGPoint final : public SVGListablePropertyBase {
AnimatedPropertyType GetType() const override { return ClassType(); }
private:
template <typename CharType>
SVGParsingError Parse(const CharType* ptr, const CharType* end);
FloatPoint value_;
};
......
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