Chromium Code Reviews| Index: third_party/WebKit/Source/core/svg/SVGGeometryElement.cpp |
| diff --git a/third_party/WebKit/Source/core/svg/SVGGeometryElement.cpp b/third_party/WebKit/Source/core/svg/SVGGeometryElement.cpp |
| index b407cd3430fa89e4aca61633346ad55de39867f7..3d3912c534f8a30e95a53523492c910cc2286c2d 100644 |
| --- a/third_party/WebKit/Source/core/svg/SVGGeometryElement.cpp |
| +++ b/third_party/WebKit/Source/core/svg/SVGGeometryElement.cpp |
| @@ -87,6 +87,24 @@ void SVGGeometryElement::toClipPath(Path& path) const { |
| path.setWindRule(layoutObject()->style()->svgStyle().clipRule()); |
| } |
| +float SVGGeometryElement::getTotalLength() { |
| + document().updateStyleAndLayoutIgnorePendingStylesheets(); |
| + Path path; |
| + if (layoutObject()) |
|
fs
2016/10/24 10:48:53
Presumably an empty path yields a length of 0, so
Shanmuga Pandi
2016/10/26 09:52:12
Done.
|
| + path = asPath(); |
| + return path.length(); |
| +} |
| + |
| +SVGPointTearOff* SVGGeometryElement::getPointAtLength(float length) { |
| + document().updateStyleAndLayoutIgnorePendingStylesheets(); |
| + Path path; |
| + if (layoutObject()) |
|
fs
2016/10/24 10:48:53
Somewhat similar to above, I think this could be w
Shanmuga Pandi
2016/10/26 09:52:12
Done.
|
| + path = asPath(); |
| + FloatPoint point = path.pointAtLength(length); |
| + return SVGPointTearOff::create(SVGPoint::create(point), 0, |
| + PropertyIsNotAnimVal); |
| +} |
| + |
| LayoutObject* SVGGeometryElement::createLayoutObject(const ComputedStyle&) { |
| // By default, any subclass is expected to do path-based drawing. |
| return new LayoutSVGPath(this); |