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

Unified Diff: third_party/WebKit/Source/core/svg/SVGGeometryElement.cpp

Issue 2413753004: Move getTotalLength and getPointAtLength methods from SVGPathElement to SVGGeometryElement. (Closed)
Patch Set: Align with review comments Created 4 years, 2 months 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
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..993675de9cf557c2e3ecbdf056578fe7ce6e8438 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();
+
+ if (!layoutObject())
+ return 0;
+ return asPath().length();
+}
+
+SVGPointTearOff* SVGGeometryElement::getPointAtLength(float length) {
+ document().updateStyleAndLayoutIgnorePendingStylesheets();
+
+ FloatPoint point;
+ if (layoutObject())
+ point = asPath().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);
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGGeometryElement.h ('k') | third_party/WebKit/Source/core/svg/SVGGeometryElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698