Make all SVG shape interfaces inherit from SVGGeometryElement
authorkrit@webkit.org <krit@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 May 2018 15:22:55 +0000 (15:22 +0000)
committerkrit@webkit.org <krit@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 May 2018 15:22:55 +0000 (15:22 +0000)
commitedd122be15b003388e44b036cbac276006ce3372
tree065db717104b16984e92ce3f43b9d42b5fd2c8a8
parente3712e508970651d87859042362929cd00e30ae1
Make all SVG shape interfaces inherit from SVGGeometryElement
https://bugs.webkit.org/show_bug.cgi?id=185600

Reviewed by Antti Koivisto.

Source/WebCore:

Make all SVG shape interfaces inherit from SVGGeometryElement
as defined by SVG2:

https://svgwg.org/svg2-draft/shapes.html#DOMInterfaces

Tests: svg/dom/SVGGeometry-circle.xhtml
       svg/dom/SVGGeometry-ellipse.xhtml
       svg/dom/SVGGeometry-line.xhtml
       svg/dom/SVGGeometry-polygon.xhtml
       svg/dom/SVGGeometry-polyline.xhtml
       svg/dom/SVGGeometry-rect.xhtml

* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::getTotalLength const): Added shape
        independent implementation for all methods defined
        by SVGGeometryElement interface. Calculations are
        based on the Path object created and referenced by
        RenderSVGShape.
(WebCore::RenderSVGShape::getPointAtLength const):
* rendering/svg/RenderSVGShape.h:
* svg/SVGCircleElement.cpp:
        Repeating pattern: Change inheritance from
        SVGGraphicsElement to SVGGeometryElement.
(WebCore::SVGCircleElement::SVGCircleElement):
* svg/SVGCircleElement.h:
* svg/SVGCircleElement.idl:
* svg/SVGEllipseElement.cpp:
(WebCore::SVGEllipseElement::SVGEllipseElement):
* svg/SVGEllipseElement.h:
* svg/SVGEllipseElement.idl:
* svg/SVGGeometryElement.cpp:
(WebCore::SVGGeometryElement::getTotalLength const):
(WebCore::SVGGeometryElement::getPointAtLength const):
* svg/SVGGeometryElement.h:
* svg/SVGLineElement.cpp:
(WebCore::SVGLineElement::SVGLineElement):
* svg/SVGLineElement.h:
* svg/SVGLineElement.idl:
* svg/SVGPolyElement.cpp:
(WebCore::SVGPolyElement::SVGPolyElement):
* svg/SVGPolyElement.h:
* svg/SVGPolygonElement.idl:
* svg/SVGPolylineElement.idl:
* svg/SVGRectElement.cpp:
(WebCore::SVGRectElement::SVGRectElement):
* svg/SVGRectElement.h:
* svg/SVGRectElement.idl:

LayoutTests:

Update test for inheritance of SVG shape interfaces (more passes).
Add individual tests for SVGGeometryElement interfaces for each
SVG shape. There already are more detailed tests for the methods
and the SVGPathElement interface.

* svg/dom/SVGGeometry-circle-expected.txt: Added.
* svg/dom/SVGGeometry-circle.xhtml: Added.
* svg/dom/SVGGeometry-ellipse-expected.txt: Added.
* svg/dom/SVGGeometry-ellipse.xhtml: Added.
* svg/dom/SVGGeometry-line-expected.txt: Added.
* svg/dom/SVGGeometry-line.xhtml: Added.
* svg/dom/SVGGeometry-polygon-expected.txt: Added.
* svg/dom/SVGGeometry-polygon.xhtml: Added.
* svg/dom/SVGGeometry-polyline-expected.txt: Added.
* svg/dom/SVGGeometry-polyline.xhtml: Added.
* svg/dom/SVGGeometry-rect-expected.txt: Added.
* svg/dom/SVGGeometry-rect.xhtml: Added.
* svg/dom/svg2-inheritance-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231955 268f45cc-cd09-0410-ab3c-d52691b4dbfc
37 files changed:
LayoutTests/ChangeLog
LayoutTests/svg/dom/SVGGeometry-circle-expected.txt [new file with mode: 0644]
LayoutTests/svg/dom/SVGGeometry-circle.xhtml [new file with mode: 0644]
LayoutTests/svg/dom/SVGGeometry-ellipse-expected.txt [new file with mode: 0644]
LayoutTests/svg/dom/SVGGeometry-ellipse.xhtml [new file with mode: 0644]
LayoutTests/svg/dom/SVGGeometry-isPointInFill-expected.txt
LayoutTests/svg/dom/SVGGeometry-isPointInFill.xhtml
LayoutTests/svg/dom/SVGGeometry-line-expected.txt [new file with mode: 0644]
LayoutTests/svg/dom/SVGGeometry-line.xhtml [new file with mode: 0644]
LayoutTests/svg/dom/SVGGeometry-polygon-expected.txt [new file with mode: 0644]
LayoutTests/svg/dom/SVGGeometry-polygon.xhtml [new file with mode: 0644]
LayoutTests/svg/dom/SVGGeometry-polyline-expected.txt [new file with mode: 0644]
LayoutTests/svg/dom/SVGGeometry-polyline.xhtml [new file with mode: 0644]
LayoutTests/svg/dom/SVGGeometry-rect-expected.txt [new file with mode: 0644]
LayoutTests/svg/dom/SVGGeometry-rect.xhtml [new file with mode: 0644]
LayoutTests/svg/dom/svg2-inheritance-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/rendering/svg/RenderSVGShape.cpp
Source/WebCore/rendering/svg/RenderSVGShape.h
Source/WebCore/svg/SVGCircleElement.cpp
Source/WebCore/svg/SVGCircleElement.h
Source/WebCore/svg/SVGCircleElement.idl
Source/WebCore/svg/SVGEllipseElement.cpp
Source/WebCore/svg/SVGEllipseElement.h
Source/WebCore/svg/SVGEllipseElement.idl
Source/WebCore/svg/SVGGeometryElement.cpp
Source/WebCore/svg/SVGGeometryElement.h
Source/WebCore/svg/SVGLineElement.cpp
Source/WebCore/svg/SVGLineElement.h
Source/WebCore/svg/SVGLineElement.idl
Source/WebCore/svg/SVGPolyElement.cpp
Source/WebCore/svg/SVGPolyElement.h
Source/WebCore/svg/SVGPolygonElement.idl
Source/WebCore/svg/SVGPolylineElement.idl
Source/WebCore/svg/SVGRectElement.cpp
Source/WebCore/svg/SVGRectElement.h
Source/WebCore/svg/SVGRectElement.idl