WebKit Bugzilla
Attachment 340288 Details for
Bug 185600
: Make all SVG shape interfaces inherit from SVGGeometryElement
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185600-20180514061739.patch (text/plain), 50.75 KB, created by
Dirk Schulze
on 2018-05-13 21:17:41 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Dirk Schulze
Created:
2018-05-13 21:17:41 PDT
Size:
50.75 KB
patch
obsolete
>Subversion Revision: 231739 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index cf540aec2a73503bea3bb0d3d9ba349723b88337..456b586dea9929a401d2a0a23c301749fecae13f 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,47 @@ >+2018-05-13 Dirk Schulze <dschulze@chromium.org> >+ >+ Make all SVG shape interfaces inherit from SVGGeometryElement >+ https://bugs.webkit.org/show_bug.cgi?id=185600 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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): >+ (WebCore::RenderSVGShape::getPointAtLength const): >+ * rendering/svg/RenderSVGShape.h: >+ * svg/SVGCircleElement.cpp: >+ (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: >+ > 2018-05-13 Dirk Schulze <krit@webkit.org> > > Implement SVGGeometryElement's isPointInFill and isPointInStroke >diff --git a/Source/WebCore/rendering/svg/RenderSVGShape.cpp b/Source/WebCore/rendering/svg/RenderSVGShape.cpp >index bf0653d60551abd4cede68bf0c99ce5516a67e72..09f91e942c44710df4a1869427d4f60cfbf9748e 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGShape.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGShape.cpp >@@ -345,6 +345,23 @@ bool RenderSVGShape::isPointInStroke(const FloatPoint& point) > return shapeDependentStrokeContains(point, LocalCoordinateSpace); > } > >+float RenderSVGShape::getTotalLength() const >+{ >+ if (m_path) >+ return m_path->length(); >+ >+ return 0; >+} >+ >+void RenderSVGShape::getPointAtLength(FloatPoint& point, float distance) const >+{ >+ if (!m_path) >+ return; >+ >+ bool isValid; >+ point = m_path->pointAtLength(distance, isValid); >+} >+ > bool RenderSVGShape::nodeAtFloatPoint(const HitTestRequest& request, HitTestResult& result, const FloatPoint& pointInParent, HitTestAction hitTestAction) > { > // We only draw in the forground phase, so we only hit-test then. >diff --git a/Source/WebCore/rendering/svg/RenderSVGShape.h b/Source/WebCore/rendering/svg/RenderSVGShape.h >index d8c2e56aeb2ab2b6b24a062aab2c731106211131..4f0a78f58f1d5a1c4c250720b8e3ad2a3c0b7ac0 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGShape.h >+++ b/Source/WebCore/rendering/svg/RenderSVGShape.h >@@ -65,6 +65,9 @@ public: > bool isPointInFill(const FloatPoint&); > bool isPointInStroke(const FloatPoint&); > >+ float getTotalLength() const; >+ void getPointAtLength(FloatPoint&, float distance) const; >+ > bool hasPath() const { return m_path.get(); } > Path& path() const > { >diff --git a/Source/WebCore/svg/SVGCircleElement.cpp b/Source/WebCore/svg/SVGCircleElement.cpp >index 53ed2029e6e93cfa6ebb35f2f2be5fa0edfd36eb..2928653690fb4f937982a572ae3601ffa22e3a5b 100644 >--- a/Source/WebCore/svg/SVGCircleElement.cpp >+++ b/Source/WebCore/svg/SVGCircleElement.cpp >@@ -44,11 +44,11 @@ BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGCircleElement) > REGISTER_LOCAL_ANIMATED_PROPERTY(cy) > REGISTER_LOCAL_ANIMATED_PROPERTY(r) > REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) >- REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement) >+ REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGeometryElement) > END_REGISTER_ANIMATED_PROPERTIES > > inline SVGCircleElement::SVGCircleElement(const QualifiedName& tagName, Document& document) >- : SVGGraphicsElement(tagName, document) >+ : SVGGeometryElement(tagName, document) > , m_cx(LengthModeWidth) > , m_cy(LengthModeHeight) > , m_r(LengthModeOther) >diff --git a/Source/WebCore/svg/SVGCircleElement.h b/Source/WebCore/svg/SVGCircleElement.h >index 99a2779ec113e694e225efe7d7b7d53026e5fe79..ac3bbb152a171806bdfdfb28b7252de066684c02 100644 >--- a/Source/WebCore/svg/SVGCircleElement.h >+++ b/Source/WebCore/svg/SVGCircleElement.h >@@ -23,11 +23,11 @@ > #include "SVGAnimatedBoolean.h" > #include "SVGAnimatedLength.h" > #include "SVGExternalResourcesRequired.h" >-#include "SVGGraphicsElement.h" >+#include "SVGGeometryElement.h" > > namespace WebCore { > >-class SVGCircleElement final : public SVGGraphicsElement, public SVGExternalResourcesRequired { >+class SVGCircleElement final : public SVGGeometryElement, public SVGExternalResourcesRequired { > WTF_MAKE_ISO_ALLOCATED(SVGCircleElement); > public: > static Ref<SVGCircleElement> create(const QualifiedName&, Document&); >diff --git a/Source/WebCore/svg/SVGCircleElement.idl b/Source/WebCore/svg/SVGCircleElement.idl >index 26e9ef6da4891e3788817aaa4c184addcd66d4e8..54e1ab4f0f12a7344a600250c514c228b14ac83a 100644 >--- a/Source/WebCore/svg/SVGCircleElement.idl >+++ b/Source/WebCore/svg/SVGCircleElement.idl >@@ -24,7 +24,7 @@ > * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > */ > >-interface SVGCircleElement : SVGGraphicsElement { >+interface SVGCircleElement : SVGGeometryElement { > readonly attribute SVGAnimatedLength cx; > readonly attribute SVGAnimatedLength cy; > readonly attribute SVGAnimatedLength r; >diff --git a/Source/WebCore/svg/SVGEllipseElement.cpp b/Source/WebCore/svg/SVGEllipseElement.cpp >index fbcb475b3a5e65ce261f5799babfa583edad9401..96a6774535ee30e86be6b698cb488e093c7b54ff 100644 >--- a/Source/WebCore/svg/SVGEllipseElement.cpp >+++ b/Source/WebCore/svg/SVGEllipseElement.cpp >@@ -46,11 +46,11 @@ BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGEllipseElement) > REGISTER_LOCAL_ANIMATED_PROPERTY(rx) > REGISTER_LOCAL_ANIMATED_PROPERTY(ry) > REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) >- REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement) >+ REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGeometryElement) > END_REGISTER_ANIMATED_PROPERTIES > > inline SVGEllipseElement::SVGEllipseElement(const QualifiedName& tagName, Document& document) >- : SVGGraphicsElement(tagName, document) >+ : SVGGeometryElement(tagName, document) > , m_cx(LengthModeWidth) > , m_cy(LengthModeHeight) > , m_rx(LengthModeWidth) >diff --git a/Source/WebCore/svg/SVGEllipseElement.h b/Source/WebCore/svg/SVGEllipseElement.h >index 55cc580c10228df9c7bb83012028fac7d98d35b2..2570327ffd6d57f5c01cf86aa4bad0faa970f3c7 100644 >--- a/Source/WebCore/svg/SVGEllipseElement.h >+++ b/Source/WebCore/svg/SVGEllipseElement.h >@@ -23,11 +23,11 @@ > #include "SVGAnimatedBoolean.h" > #include "SVGAnimatedLength.h" > #include "SVGExternalResourcesRequired.h" >-#include "SVGGraphicsElement.h" >+#include "SVGGeometryElement.h" > > namespace WebCore { > >-class SVGEllipseElement final : public SVGGraphicsElement, public SVGExternalResourcesRequired { >+class SVGEllipseElement final : public SVGGeometryElement, public SVGExternalResourcesRequired { > WTF_MAKE_ISO_ALLOCATED(SVGEllipseElement); > public: > static Ref<SVGEllipseElement> create(const QualifiedName&, Document&); >diff --git a/Source/WebCore/svg/SVGEllipseElement.idl b/Source/WebCore/svg/SVGEllipseElement.idl >index 16a5988ea52e0a8d0e4af6673516ea6477b1fba2..7d09a65c58cce29c0df653782682e950acbc38d9 100644 >--- a/Source/WebCore/svg/SVGEllipseElement.idl >+++ b/Source/WebCore/svg/SVGEllipseElement.idl >@@ -23,7 +23,7 @@ > * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > */ > >-interface SVGEllipseElement : SVGGraphicsElement { >+interface SVGEllipseElement : SVGGeometryElement { > readonly attribute SVGAnimatedLength cx; > readonly attribute SVGAnimatedLength cy; > readonly attribute SVGAnimatedLength rx; >diff --git a/Source/WebCore/svg/SVGGeometryElement.cpp b/Source/WebCore/svg/SVGGeometryElement.cpp >index 1afb57e27a000cf0ee76944422e6cb924926ec3f..86a4544cd19c818adafdea4af37bb71aead4fe75 100644 >--- a/Source/WebCore/svg/SVGGeometryElement.cpp >+++ b/Source/WebCore/svg/SVGGeometryElement.cpp >@@ -52,6 +52,30 @@ SVGGeometryElement::SVGGeometryElement(const QualifiedName& tagName, Document& d > registerAnimatedPropertiesForSVGGeometryElement(); > } > >+float SVGGeometryElement::getTotalLength() const >+{ >+ document().updateLayoutIgnorePendingStylesheets(); >+ >+ auto* renderer = downcast<RenderSVGShape>(this->renderer()); >+ if (!renderer) >+ return 0; >+ >+ return renderer->getTotalLength(); >+} >+ >+Ref<SVGPoint> SVGGeometryElement::getPointAtLength(float distance) const >+{ >+ FloatPoint point { }; >+ >+ document().updateLayoutIgnorePendingStylesheets(); >+ >+ auto* renderer = downcast<RenderSVGShape>(this->renderer()); >+ if (renderer) >+ renderer->getPointAtLength(point, distance); >+ >+ return SVGPoint::create(point); >+} >+ > bool SVGGeometryElement::isPointInFill(DOMPointInit&& pointInit) > { > document().updateLayoutIgnorePendingStylesheets(); >diff --git a/Source/WebCore/svg/SVGGeometryElement.h b/Source/WebCore/svg/SVGGeometryElement.h >index fff026239653d9578ce0de3076354a96037de5d9..92d86458c5455b3942d279abb7786b13d41d2eca 100644 >--- a/Source/WebCore/svg/SVGGeometryElement.h >+++ b/Source/WebCore/svg/SVGGeometryElement.h >@@ -37,8 +37,8 @@ class SVGGeometryElement : public SVGGraphicsElement { > WTF_MAKE_ISO_ALLOCATED(SVGGeometryElement); > public: > >- virtual float getTotalLength() const = 0; >- virtual Ref<SVGPoint> getPointAtLength(float distance) const = 0; >+ virtual float getTotalLength() const; >+ virtual Ref<SVGPoint> getPointAtLength(float distance) const; > > bool isPointInFill(DOMPointInit&&); > bool isPointInStroke(DOMPointInit&&); >diff --git a/Source/WebCore/svg/SVGLineElement.cpp b/Source/WebCore/svg/SVGLineElement.cpp >index 406fabc81de7d9793908445df02659a978a7271a..34815df16325a8dcc3e2bccfa14317a52d95180c 100644 >--- a/Source/WebCore/svg/SVGLineElement.cpp >+++ b/Source/WebCore/svg/SVGLineElement.cpp >@@ -46,11 +46,11 @@ BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGLineElement) > REGISTER_LOCAL_ANIMATED_PROPERTY(x2) > REGISTER_LOCAL_ANIMATED_PROPERTY(y2) > REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) >- REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement) >+ REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGeometryElement) > END_REGISTER_ANIMATED_PROPERTIES > > inline SVGLineElement::SVGLineElement(const QualifiedName& tagName, Document& document) >- : SVGGraphicsElement(tagName, document) >+ : SVGGeometryElement(tagName, document) > , m_x1(LengthModeWidth) > , m_y1(LengthModeHeight) > , m_x2(LengthModeWidth) >diff --git a/Source/WebCore/svg/SVGLineElement.h b/Source/WebCore/svg/SVGLineElement.h >index f490b5080b43a6a8798350c89f6c37c760e46c08..609b6d93d04c71a982693c4a4d6ad2cde1b31940 100644 >--- a/Source/WebCore/svg/SVGLineElement.h >+++ b/Source/WebCore/svg/SVGLineElement.h >@@ -23,11 +23,11 @@ > #include "SVGAnimatedBoolean.h" > #include "SVGAnimatedLength.h" > #include "SVGExternalResourcesRequired.h" >-#include "SVGGraphicsElement.h" >+#include "SVGGeometryElement.h" > > namespace WebCore { > >-class SVGLineElement final : public SVGGraphicsElement, public SVGExternalResourcesRequired { >+class SVGLineElement final : public SVGGeometryElement, public SVGExternalResourcesRequired { > WTF_MAKE_ISO_ALLOCATED(SVGLineElement); > public: > static Ref<SVGLineElement> create(const QualifiedName&, Document&); >diff --git a/Source/WebCore/svg/SVGLineElement.idl b/Source/WebCore/svg/SVGLineElement.idl >index 6c8de66ec880cc2db84bdd4b4be302127c2ca4fb..8d0845130fd422db4c06b8fa992d17d3a3d1c8c6 100644 >--- a/Source/WebCore/svg/SVGLineElement.idl >+++ b/Source/WebCore/svg/SVGLineElement.idl >@@ -23,7 +23,7 @@ > * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > */ > >-interface SVGLineElement : SVGGraphicsElement { >+interface SVGLineElement : SVGGeometryElement { > readonly attribute SVGAnimatedLength x1; > readonly attribute SVGAnimatedLength y1; > readonly attribute SVGAnimatedLength x2; >diff --git a/Source/WebCore/svg/SVGPolyElement.cpp b/Source/WebCore/svg/SVGPolyElement.cpp >index 91decbfc5e9367e940b5b623846ce6fc85be43c3..628d3cd21609176d361a528715ec2572a9960282 100644 >--- a/Source/WebCore/svg/SVGPolyElement.cpp >+++ b/Source/WebCore/svg/SVGPolyElement.cpp >@@ -57,11 +57,11 @@ DEFINE_ANIMATED_BOOLEAN(SVGPolyElement, SVGNames::externalResourcesRequiredAttr, > BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGPolyElement) > REGISTER_LOCAL_ANIMATED_PROPERTY(points) > REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) >- REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement) >+ REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGeometryElement) > END_REGISTER_ANIMATED_PROPERTIES > > SVGPolyElement::SVGPolyElement(const QualifiedName& tagName, Document& document) >- : SVGGraphicsElement(tagName, document) >+ : SVGGeometryElement(tagName, document) > { > registerAnimatedPropertiesForSVGPolyElement(); > } >diff --git a/Source/WebCore/svg/SVGPolyElement.h b/Source/WebCore/svg/SVGPolyElement.h >index 6b6b95de9158411c9317d79c62560b5b10328d98..df760e0b080dc161da3197b4b9296874f794c6b9 100644 >--- a/Source/WebCore/svg/SVGPolyElement.h >+++ b/Source/WebCore/svg/SVGPolyElement.h >@@ -22,13 +22,13 @@ > > #include "SVGAnimatedBoolean.h" > #include "SVGExternalResourcesRequired.h" >-#include "SVGGraphicsElement.h" >+#include "SVGGeometryElement.h" > #include "SVGNames.h" > #include "SVGPointListValues.h" > > namespace WebCore { > >-class SVGPolyElement : public SVGGraphicsElement, public SVGExternalResourcesRequired { >+class SVGPolyElement : public SVGGeometryElement, public SVGExternalResourcesRequired { > WTF_MAKE_ISO_ALLOCATED(SVGPolyElement); > public: > Ref<SVGPointList> points(); >diff --git a/Source/WebCore/svg/SVGPolygonElement.idl b/Source/WebCore/svg/SVGPolygonElement.idl >index 815836501231fc42eb5ae1fab0adf3d908891c8b..e31b92be0df71c5fdb1c71e2cd394e8811a4bbe8 100644 >--- a/Source/WebCore/svg/SVGPolygonElement.idl >+++ b/Source/WebCore/svg/SVGPolygonElement.idl >@@ -23,7 +23,7 @@ > * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > */ > >-interface SVGPolygonElement : SVGGraphicsElement { >+interface SVGPolygonElement : SVGGeometryElement { > readonly attribute SVGPointList points; > readonly attribute SVGPointList animatedPoints; > }; >diff --git a/Source/WebCore/svg/SVGPolylineElement.idl b/Source/WebCore/svg/SVGPolylineElement.idl >index 986454b3b2006a19540c62b5a8d146eac31cc92c..ae4d5672117536d13aa59d282aed779229c2162a 100644 >--- a/Source/WebCore/svg/SVGPolylineElement.idl >+++ b/Source/WebCore/svg/SVGPolylineElement.idl >@@ -23,7 +23,7 @@ > * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > */ > >-interface SVGPolylineElement : SVGGraphicsElement { >+interface SVGPolylineElement : SVGGeometryElement { > readonly attribute SVGPointList points; > readonly attribute SVGPointList animatedPoints; > }; >diff --git a/Source/WebCore/svg/SVGRectElement.cpp b/Source/WebCore/svg/SVGRectElement.cpp >index 188dcf3fd49e40927f2d8b4047107c589cee9938..a05f2abb5c7d7a972cf23404142795176ec1861c 100644 >--- a/Source/WebCore/svg/SVGRectElement.cpp >+++ b/Source/WebCore/svg/SVGRectElement.cpp >@@ -50,11 +50,11 @@ BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGRectElement) > REGISTER_LOCAL_ANIMATED_PROPERTY(rx) > REGISTER_LOCAL_ANIMATED_PROPERTY(ry) > REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) >- REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement) >+ REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGeometryElement) > END_REGISTER_ANIMATED_PROPERTIES > > inline SVGRectElement::SVGRectElement(const QualifiedName& tagName, Document& document) >- : SVGGraphicsElement(tagName, document) >+ : SVGGeometryElement(tagName, document) > , m_x(LengthModeWidth) > , m_y(LengthModeHeight) > , m_width(LengthModeWidth) >diff --git a/Source/WebCore/svg/SVGRectElement.h b/Source/WebCore/svg/SVGRectElement.h >index b468830fd564d7d3818f41fa1a311e6a90c2f105..d2408643f04ea7ab78efe6b067e40d33a49c2be4 100644 >--- a/Source/WebCore/svg/SVGRectElement.h >+++ b/Source/WebCore/svg/SVGRectElement.h >@@ -23,12 +23,12 @@ > #include "SVGAnimatedBoolean.h" > #include "SVGAnimatedLength.h" > #include "SVGExternalResourcesRequired.h" >-#include "SVGGraphicsElement.h" >+#include "SVGGeometryElement.h" > #include "SVGNames.h" > > namespace WebCore { > >-class SVGRectElement final : public SVGGraphicsElement, public SVGExternalResourcesRequired { >+class SVGRectElement final : public SVGGeometryElement, public SVGExternalResourcesRequired { > WTF_MAKE_ISO_ALLOCATED(SVGRectElement); > public: > static Ref<SVGRectElement> create(const QualifiedName&, Document&); >diff --git a/Source/WebCore/svg/SVGRectElement.idl b/Source/WebCore/svg/SVGRectElement.idl >index 0239e80c073a0f9715503b0f08529d7444bb0957..ecfcee69fcfdea1c507a35dc382c435e4deba1af 100644 >--- a/Source/WebCore/svg/SVGRectElement.idl >+++ b/Source/WebCore/svg/SVGRectElement.idl >@@ -24,7 +24,7 @@ > * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > */ > >-interface SVGRectElement : SVGGraphicsElement { >+interface SVGRectElement : SVGGeometryElement { > readonly attribute SVGAnimatedLength x; > readonly attribute SVGAnimatedLength y; > readonly attribute SVGAnimatedLength width; >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 98916bf282cdd5ff48a73f299deb42df867902e5..53cbfc851dbb9c2b89e5bbfc3639d851f76c6af1 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,24 @@ >+2018-05-13 Dirk Schulze <dschulze@chromium.org> >+ >+ Make all SVG shape interfaces inherit from SVGGeometryElement >+ https://bugs.webkit.org/show_bug.cgi?id=185600 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * 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: >+ > 2018-05-13 Dirk Schulze <krit@webkit.org> > > Implement SVGGeometryElement's isPointInFill and isPointInStroke >diff --git a/LayoutTests/svg/dom/SVGGeometry-circle-expected.txt b/LayoutTests/svg/dom/SVGGeometry-circle-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..0e76adac7926bed7662c10a3751c14ff91f5b5bc >--- /dev/null >+++ b/LayoutTests/svg/dom/SVGGeometry-circle-expected.txt >@@ -0,0 +1,49 @@ >+Test SVGGeometryElement APIs for circle. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+ >+Test isPointInFill() >+PASS c1.isPointInFill({}) is false >+PASS c1.isPointInFill({x: 50, y: 50}) is true >+PASS c1.isPointInFill({x: 0, y: 50}) is true >+PASS c1.isPointInFill({x: 100, y: 50}) is true >+PASS c1.isPointInFill({x: 50, y: 0}) is true >+PASS c1.isPointInFill({x: 50, y: 100}) is true >+PASS c1.isPointInFill({x: -1, y: 50}) is false >+PASS c1.isPointInFill({x: 101, y: 50}) is false >+PASS c1.isPointInFill({x: 50, y: -1}) is false >+PASS c1.isPointInFill({x: 50, y: 101}) is false >+PASS c1.isPointInFill({x: 90, y: 90}) is false >+PASS c1.isPointInFill({x: 10, y: 10}) is false >+PASS c1.isPointInFill({x: 90, y: 10}) is false >+PASS c1.isPointInFill({x: 10, y: 90}) is false >+ >+Test isPointInStroke() >+PASS c1.isPointInStroke({}) is false >+PASS c1.isPointInStroke({x: 50, y: 50}) is false >+PASS c1.isPointInStroke({x: 100, y: 51}) is false >+PASS c1.isPointInStroke({x: 100, y: 49}) is true >+PASS c1.isPointInStroke({x: 0, y: 50}) is true >+PASS c1.isPointInStroke({x: 52, y: 100}) is true >+PASS c1.isPointInStroke({x: 48, y: 100}) is false >+ >+Test getTotalLength() >+PASS c1.getTotalLength() is within 0.1 of 314.1592653589793 >+ >+Test getPointAtLength() >+PASS c1.getPointAtLength(0).x is within 0.1 of 100 >+PASS c1.getPointAtLength(0).y is within 0.1 of 50 >+PASS c1.getPointAtLength(Math.PI * 100 / 4).x is within 0.1 of 50 >+PASS c1.getPointAtLength(Math.PI * 100 / 4).y is within 0.1 of 100 >+PASS c1.getPointAtLength(Math.PI * 100 / 2).x is within 0.1 of 0 >+PASS c1.getPointAtLength(Math.PI * 100 / 2).y is within 0.1 of 50 >+PASS c1.getPointAtLength(Math.PI * 100 / 8).x is within 1 of 85.35 >+PASS c1.getPointAtLength(Math.PI * 100 / 8).y is within 1 of 85.35 >+PASS c1.getPointAtLength(Math.PI * 100 * 2).x is within 0.1 of 100 >+PASS c1.getPointAtLength(Math.PI * 100 * 2).y is within 0.1 of 50 >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/svg/dom/SVGGeometry-circle.xhtml b/LayoutTests/svg/dom/SVGGeometry-circle.xhtml >new file mode 100644 >index 0000000000000000000000000000000000000000..7641911350e74bf2321aa7b3b7c858cabf517d45 >--- /dev/null >+++ b/LayoutTests/svg/dom/SVGGeometry-circle.xhtml >@@ -0,0 +1,70 @@ >+<html xmlns="http://www.w3.org/1999/xhtml"> >+<head> >+<script src="../../resources/js-test-pre.js"></script> >+</head> >+<body onload="run()"> >+<svg id="svg" xmlns="http://www.w3.org/2000/svg" width="200" height="200"> >+ <circle id="c1" cx="50" cy="50" r="50" fill="none" stroke="black" stroke-width="20" stroke-dashoffset="20" stroke-dasharray="20 20"/> >+</svg> >+<p id="description"></p> >+<div id="console"></div> >+<script type="text/javascript"> >+<![CDATA[ >+window.enablePixelTesting = false; >+window.jsTestIsAsync = true; >+var c1 = document.getElementById("c1"); >+ >+function run() { >+ description("Test SVGGeometryElement APIs for circle."); >+ >+ debug(""); >+ debug("Test isPointInFill()"); >+ shouldBe("c1.isPointInFill({})", "false"); >+ shouldBe("c1.isPointInFill({x: 50, y: 50})", "true"); >+ shouldBe("c1.isPointInFill({x: 0, y: 50})", "true"); >+ shouldBe("c1.isPointInFill({x: 100, y: 50})", "true"); >+ shouldBe("c1.isPointInFill({x: 50, y: 0})", "true"); >+ shouldBe("c1.isPointInFill({x: 50, y: 100})", "true"); >+ shouldBe("c1.isPointInFill({x: -1, y: 50})", "false"); >+ shouldBe("c1.isPointInFill({x: 101, y: 50})", "false"); >+ shouldBe("c1.isPointInFill({x: 50, y: -1})", "false"); >+ shouldBe("c1.isPointInFill({x: 50, y: 101})", "false"); >+ shouldBe("c1.isPointInFill({x: 90, y: 90})", "false"); >+ shouldBe("c1.isPointInFill({x: 10, y: 10})", "false"); >+ shouldBe("c1.isPointInFill({x: 90, y: 10})", "false"); >+ shouldBe("c1.isPointInFill({x: 10, y: 90})", "false"); >+ >+ debug(""); >+ debug("Test isPointInStroke()"); >+ shouldBe("c1.isPointInStroke({})", "false"); >+ shouldBe("c1.isPointInStroke({x: 50, y: 50})", "false"); >+ shouldBe("c1.isPointInStroke({x: 100, y: 51})", "false"); >+ shouldBe("c1.isPointInStroke({x: 100, y: 49})", "true"); >+ shouldBe("c1.isPointInStroke({x: 0, y: 50})", "true"); >+ shouldBe("c1.isPointInStroke({x: 52, y: 100})", "true"); >+ shouldBe("c1.isPointInStroke({x: 48, y: 100})", "false"); >+ >+ debug(""); >+ debug("Test getTotalLength()"); >+ shouldBeCloseTo("c1.getTotalLength()", Math.PI * 100, 0.1); >+ >+ debug(""); >+ debug("Test getPointAtLength()"); >+ shouldBeCloseTo("c1.getPointAtLength(0).x", 100, 0.1); >+ shouldBeCloseTo("c1.getPointAtLength(0).y", 50, 0.1); >+ shouldBeCloseTo("c1.getPointAtLength(Math.PI * 100 / 4).x", 50, 0.1); >+ shouldBeCloseTo("c1.getPointAtLength(Math.PI * 100 / 4).y", 100, 0.1); >+ shouldBeCloseTo("c1.getPointAtLength(Math.PI * 100 / 2).x", 0, 0.1); >+ shouldBeCloseTo("c1.getPointAtLength(Math.PI * 100 / 2).y", 50, 0.1); >+ shouldBeCloseTo("c1.getPointAtLength(Math.PI * 100 / 8).x", 85.35, 1); >+ shouldBeCloseTo("c1.getPointAtLength(Math.PI * 100 / 8).y", 85.35, 1); >+ shouldBeCloseTo("c1.getPointAtLength(Math.PI * 100 * 2).x", 100, 0.1); >+ shouldBeCloseTo("c1.getPointAtLength(Math.PI * 100 * 2).y", 50, 0.1); >+ >+ finishJSTest(); >+} >+]]> >+</script> >+<script src="../../resources/js-test-post.js"></script> >+</body> >+</html> >diff --git a/LayoutTests/svg/dom/SVGGeometry-ellipse-expected.txt b/LayoutTests/svg/dom/SVGGeometry-ellipse-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..c6a49616391b41c19d20c5011aa1d35d1f0f69a7 >--- /dev/null >+++ b/LayoutTests/svg/dom/SVGGeometry-ellipse-expected.txt >@@ -0,0 +1,50 @@ >+Test SVGGeometryElement APIs for ellipse. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+ >+Test isPointInFill() >+PASS e1.isPointInFill({}) is false >+PASS e1.isPointInFill({x: 75, y: 50}) is true >+PASS e1.isPointInFill({x: 0, y: 50}) is true >+PASS e1.isPointInFill({x: 150, y: 50}) is true >+PASS e1.isPointInFill({x: 75, y: 0}) is true >+PASS e1.isPointInFill({x: 75, y: 100}) is true >+PASS e1.isPointInFill({x: -1, y: 50}) is false >+PASS e1.isPointInFill({x: 151, y: 50}) is false >+PASS e1.isPointInFill({x: 75, y: -1}) is false >+PASS e1.isPointInFill({x: 75, y: 101}) is false >+PASS e1.isPointInFill({x: 140, y: 90}) is false >+PASS e1.isPointInFill({x: 10, y: 10}) is false >+PASS e1.isPointInFill({x: 140, y: 10}) is false >+PASS e1.isPointInFill({x: 10, y: 90}) is false >+ >+Test isPointInStroke() >+PASS e1.isPointInStroke({}) is false >+PASS e1.isPointInStroke({x: 75, y: 50}) is false >+PASS e1.isPointInStroke({x: 150, y: 51}) is false >+PASS e1.isPointInStroke({x: 150, y: 49}) is true >+PASS e1.isPointInStroke({x: 0, y: 52}) is true >+PASS e1.isPointInStroke({x: 0, y: 48}) is false >+PASS e1.isPointInStroke({x: 77, y: 100}) is false >+PASS e1.isPointInStroke({x: 73, y: 100}) is true >+ >+Test getTotalLength() >+PASS e1.getTotalLength() is within 5 of 392.6990816987241 >+ >+Test getPointAtLength() >+PASS e1.getPointAtLength(0).x is within 0.1 of 150 >+PASS e1.getPointAtLength(0).y is within 0.1 of 50 >+PASS e1.getPointAtLength(Math.PI * (75 + 50) / 4).x is within 3 of 75 >+PASS e1.getPointAtLength(Math.PI * (75 + 50) / 4).y is within 3 of 100 >+PASS e1.getPointAtLength(Math.PI * (75 + 50) / 2).x is within 3 of 0 >+PASS e1.getPointAtLength(Math.PI * (75 + 50) / 2).y is within 3 of 50 >+PASS e1.getPointAtLength(Math.PI * (75 + 50) / 8).x is within 3 of 123 >+PASS e1.getPointAtLength(Math.PI * (75 + 50) / 8).y is within 3 of 88 >+PASS e1.getPointAtLength(Math.PI * (75 + 50) * 2).x is within 3 of 150 >+PASS e1.getPointAtLength(Math.PI * (75 + 50) * 2).y is within 3 of 50 >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/svg/dom/SVGGeometry-ellipse.xhtml b/LayoutTests/svg/dom/SVGGeometry-ellipse.xhtml >new file mode 100644 >index 0000000000000000000000000000000000000000..19abec5b1a542cfba8624d85f98c19db997e1cc8 >--- /dev/null >+++ b/LayoutTests/svg/dom/SVGGeometry-ellipse.xhtml >@@ -0,0 +1,71 @@ >+<html xmlns="http://www.w3.org/1999/xhtml"> >+<head> >+<script src="../../resources/js-test-pre.js"></script> >+</head> >+<body onload="run()"> >+<svg id="svg" xmlns="http://www.w3.org/2000/svg" width="200" height="200"> >+ <ellipse id="e1" cx="75" cy="50" rx="75" ry="50" fill="none" stroke="black" stroke-width="20" stroke-dashoffset="20" stroke-dasharray="20 20"/> >+</svg> >+<p id="description"></p> >+<div id="console"></div> >+<script type="text/javascript"> >+<![CDATA[ >+window.enablePixelTesting = false; >+window.jsTestIsAsync = true; >+var e1 = document.getElementById("e1"); >+ >+function run() { >+ description("Test SVGGeometryElement APIs for ellipse."); >+ >+ debug(""); >+ debug("Test isPointInFill()"); >+ shouldBe("e1.isPointInFill({})", "false"); >+ shouldBe("e1.isPointInFill({x: 75, y: 50})", "true"); >+ shouldBe("e1.isPointInFill({x: 0, y: 50})", "true"); >+ shouldBe("e1.isPointInFill({x: 150, y: 50})", "true"); >+ shouldBe("e1.isPointInFill({x: 75, y: 0})", "true"); >+ shouldBe("e1.isPointInFill({x: 75, y: 100})", "true"); >+ shouldBe("e1.isPointInFill({x: -1, y: 50})", "false"); >+ shouldBe("e1.isPointInFill({x: 151, y: 50})", "false"); >+ shouldBe("e1.isPointInFill({x: 75, y: -1})", "false"); >+ shouldBe("e1.isPointInFill({x: 75, y: 101})", "false"); >+ shouldBe("e1.isPointInFill({x: 140, y: 90})", "false"); >+ shouldBe("e1.isPointInFill({x: 10, y: 10})", "false"); >+ shouldBe("e1.isPointInFill({x: 140, y: 10})", "false"); >+ shouldBe("e1.isPointInFill({x: 10, y: 90})", "false"); >+ >+ debug(""); >+ debug("Test isPointInStroke()"); >+ shouldBe("e1.isPointInStroke({})", "false"); >+ shouldBe("e1.isPointInStroke({x: 75, y: 50})", "false"); >+ shouldBe("e1.isPointInStroke({x: 150, y: 51})", "false"); >+ shouldBe("e1.isPointInStroke({x: 150, y: 49})", "true"); >+ shouldBe("e1.isPointInStroke({x: 0, y: 52})", "true"); >+ shouldBe("e1.isPointInStroke({x: 0, y: 48})", "false"); >+ shouldBe("e1.isPointInStroke({x: 77, y: 100})", "false"); >+ shouldBe("e1.isPointInStroke({x: 73, y: 100})", "true"); >+ >+ debug(""); >+ debug("Test getTotalLength()"); >+ shouldBeCloseTo("e1.getTotalLength()", Math.PI * (75 + 50), 5); >+ >+ debug(""); >+ debug("Test getPointAtLength()"); >+ shouldBeCloseTo("e1.getPointAtLength(0).x", 150, 0.1); >+ shouldBeCloseTo("e1.getPointAtLength(0).y", 50, 0.1); >+ shouldBeCloseTo("e1.getPointAtLength(Math.PI * (75 + 50) / 4).x", 75, 3); >+ shouldBeCloseTo("e1.getPointAtLength(Math.PI * (75 + 50) / 4).y", 100, 3); >+ shouldBeCloseTo("e1.getPointAtLength(Math.PI * (75 + 50) / 2).x", 0, 3); >+ shouldBeCloseTo("e1.getPointAtLength(Math.PI * (75 + 50) / 2).y", 50, 3); >+ shouldBeCloseTo("e1.getPointAtLength(Math.PI * (75 + 50) / 8).x", 123, 3); >+ shouldBeCloseTo("e1.getPointAtLength(Math.PI * (75 + 50) / 8).y", 88, 3); >+ shouldBeCloseTo("e1.getPointAtLength(Math.PI * (75 + 50) * 2).x", 150, 3); >+ shouldBeCloseTo("e1.getPointAtLength(Math.PI * (75 + 50) * 2).y", 50, 3); >+ >+ finishJSTest(); >+} >+]]> >+</script> >+<script src="../../resources/js-test-post.js"></script> >+</body> >+</html> >diff --git a/LayoutTests/svg/dom/SVGGeometry-line-expected.txt b/LayoutTests/svg/dom/SVGGeometry-line-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..bba4a22e2cbf704e01128fff03c2214cdadabfb9 >--- /dev/null >+++ b/LayoutTests/svg/dom/SVGGeometry-line-expected.txt >@@ -0,0 +1,37 @@ >+Test SVGGeometryElement APIs for line. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+ >+Test isPointInFill() >+PASS l1.isPointInFill({}) is false >+PASS l1.isPointInFill({x: 0, y: 50}) is true >+PASS l1.isPointInFill({x: 50, y: 50}) is true >+PASS l1.isPointInFill({x: 100, y: 50}) is true >+PASS l1.isPointInFill({x: 50, y: 49}) is false >+PASS l1.isPointInFill({x: 50, y: 51}) is false >+ >+Test isPointInStroke() >+PASS l1.isPointInStroke({x: 19, y: 50}) is false >+PASS l1.isPointInStroke({x: 20, y: 50}) is true >+PASS l1.isPointInStroke({x: 39, y: 50}) is true >+PASS l1.isPointInStroke({x: 40, y: 50}) is true >+PASS l1.isPointInStroke({x: 41, y: 50}) is false >+ >+Test getTotalLength() >+PASS l1.getTotalLength() is within 1 of 100 >+ >+Test getPointAtLength() >+PASS l1.getPointAtLength(0).x is within 0.1 of 0 >+PASS l1.getPointAtLength(0).y is within 0.1 of 50 >+PASS l1.getPointAtLength(50).x is within 0.1 of 50 >+PASS l1.getPointAtLength(50).y is within 0.1 of 50 >+PASS l1.getPointAtLength(100).x is within 0.1 of 100 >+PASS l1.getPointAtLength(100).y is within 0.1 of 50 >+PASS l1.getPointAtLength(150).x is within 0.1 of 100 >+PASS l1.getPointAtLength(150).y is within 0.1 of 50 >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/svg/dom/SVGGeometry-line.xhtml b/LayoutTests/svg/dom/SVGGeometry-line.xhtml >new file mode 100644 >index 0000000000000000000000000000000000000000..d8dd88e8f22b242ca191691fbc1603fc4f3ef7c5 >--- /dev/null >+++ b/LayoutTests/svg/dom/SVGGeometry-line.xhtml >@@ -0,0 +1,58 @@ >+<html xmlns="http://www.w3.org/1999/xhtml"> >+<head> >+<script src="../../resources/js-test-pre.js"></script> >+</head> >+<body onload="run()"> >+<svg id="svg" xmlns="http://www.w3.org/2000/svg" width="200" height="200"> >+ <line id="l1" x1="0" y1="50" x2="100" y2="50" fill="none" stroke="black" stroke-width="20" stroke-dashoffset="20" stroke-dasharray="20 20"/> >+</svg> >+<p id="description"></p> >+<div id="console"></div> >+<script type="text/javascript"> >+<![CDATA[ >+window.enablePixelTesting = false; >+window.jsTestIsAsync = true; >+var l1 = document.getElementById("l1"); >+ >+function run() { >+ description("Test SVGGeometryElement APIs for line."); >+ >+ debug(""); >+ debug("Test isPointInFill()"); >+ shouldBe("l1.isPointInFill({})", "false"); >+ shouldBe("l1.isPointInFill({x: 0, y: 50})", "true"); >+ shouldBe("l1.isPointInFill({x: 50, y: 50})", "true"); >+ shouldBe("l1.isPointInFill({x: 100, y: 50})", "true"); >+ shouldBe("l1.isPointInFill({x: 50, y: 49})", "false"); >+ shouldBe("l1.isPointInFill({x: 50, y: 51})", "false"); >+ >+ debug(""); >+ debug("Test isPointInStroke()"); >+ shouldBe("l1.isPointInStroke({x: 19, y: 50})", "false"); >+ shouldBe("l1.isPointInStroke({x: 20, y: 50})", "true"); >+ shouldBe("l1.isPointInStroke({x: 39, y: 50})", "true"); >+ shouldBe("l1.isPointInStroke({x: 40, y: 50})", "true"); >+ shouldBe("l1.isPointInStroke({x: 41, y: 50})", "false"); >+ >+ debug(""); >+ debug("Test getTotalLength()"); >+ shouldBeCloseTo("l1.getTotalLength()", 100, 1); >+ >+ debug(""); >+ debug("Test getPointAtLength()"); >+ shouldBeCloseTo("l1.getPointAtLength(0).x", 0, 0.1); >+ shouldBeCloseTo("l1.getPointAtLength(0).y", 50, 0.1); >+ shouldBeCloseTo("l1.getPointAtLength(50).x", 50, 0.1); >+ shouldBeCloseTo("l1.getPointAtLength(50).y", 50, 0.1); >+ shouldBeCloseTo("l1.getPointAtLength(100).x", 100, 0.1); >+ shouldBeCloseTo("l1.getPointAtLength(100).y", 50, 0.1); >+ shouldBeCloseTo("l1.getPointAtLength(150).x", 100, 0.1); >+ shouldBeCloseTo("l1.getPointAtLength(150).y", 50, 0.1); >+ >+ finishJSTest(); >+} >+]]> >+</script> >+<script src="../../resources/js-test-post.js"></script> >+</body> >+</html> >diff --git a/LayoutTests/svg/dom/SVGGeometry-polygon-expected.txt b/LayoutTests/svg/dom/SVGGeometry-polygon-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..8ddf86abc062d955935da1f274988d0f502ade80 >--- /dev/null >+++ b/LayoutTests/svg/dom/SVGGeometry-polygon-expected.txt >@@ -0,0 +1,41 @@ >+Test SVGGeometryElement APIs for polygon. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+ >+Test isPointInFill() >+PASS p1.isPointInFill({}) is true >+PASS p1.isPointInFill({x: 100, y: 0}) is true >+PASS p1.isPointInFill({x: 152, y: 0}) is false >+PASS p1.isPointInFill({x: 150, y: 50}) is true >+PASS p1.isPointInFill({x: 150, y: 100}) is true >+PASS p1.isPointInFill({x: 150, y: 101}) is false >+PASS p1.isPointInFill({x: 100, y: 100}) is true >+PASS p1.isPointInFill({x: 75, y: 50}) is true >+ >+Test isPointInStroke() >+PASS p1.isPointInStroke({x: 0, y: 0}) is false >+PASS p1.isPointInStroke({x: 20, y: 0}) is true >+PASS p1.isPointInStroke({x: 150, y: 0}) is true >+PASS p1.isPointInStroke({x: 150, y: 35}) is true >+PASS p1.isPointInStroke({x: 75, y: 50}) is false >+ >+Test getTotalLength() >+PASS p1.getTotalLength() is within 1 of 500 >+ >+Test getPointAtLength() >+PASS p1.getPointAtLength(0).x is within 0.1 of 0 >+PASS p1.getPointAtLength(0).y is within 0.1 of 0 >+PASS p1.getPointAtLength(150).x is within 0.1 of 150 >+PASS p1.getPointAtLength(150).y is within 0.1 of 0 >+PASS p1.getPointAtLength(200).x is within 0.1 of 150 >+PASS p1.getPointAtLength(200).y is within 0.1 of 50 >+PASS p1.getPointAtLength(300).x is within 0.1 of 100 >+PASS p1.getPointAtLength(300).y is within 0.1 of 100 >+PASS p1.getPointAtLength(450).x is within 0.1 of 0 >+PASS p1.getPointAtLength(450).y is within 0.1 of 50 >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/svg/dom/SVGGeometry-polygon.xhtml b/LayoutTests/svg/dom/SVGGeometry-polygon.xhtml >new file mode 100644 >index 0000000000000000000000000000000000000000..6c9f059e08997a6ec94010e77bcd91d998dcff21 >--- /dev/null >+++ b/LayoutTests/svg/dom/SVGGeometry-polygon.xhtml >@@ -0,0 +1,62 @@ >+<html xmlns="http://www.w3.org/1999/xhtml"> >+<head> >+<script src="../../resources/js-test-pre.js"></script> >+</head> >+<body onload="run()"> >+<svg id="svg" xmlns="http://www.w3.org/2000/svg" width="200" height="200"> >+ <polygon id="p1" points="0,0 150,0 150,100 0,100" fill="none" stroke="black" stroke-width="20" stroke-dashoffset="20" stroke-dasharray="20 20"/> >+</svg> >+<p id="description"></p> >+<div id="console"></div> >+<script type="text/javascript"> >+<![CDATA[ >+window.enablePixelTesting = false; >+window.jsTestIsAsync = true; >+var p1 = document.getElementById("p1"); >+ >+function run() { >+ description("Test SVGGeometryElement APIs for polygon."); >+ >+ debug(""); >+ debug("Test isPointInFill()"); >+ shouldBe("p1.isPointInFill({})", "true"); >+ shouldBe("p1.isPointInFill({x: 100, y: 0})", "true"); >+ shouldBe("p1.isPointInFill({x: 152, y: 0})", "false"); >+ shouldBe("p1.isPointInFill({x: 150, y: 50})", "true"); >+ shouldBe("p1.isPointInFill({x: 150, y: 100})", "true"); >+ shouldBe("p1.isPointInFill({x: 150, y: 101})", "false"); >+ shouldBe("p1.isPointInFill({x: 100, y: 100})", "true"); >+ shouldBe("p1.isPointInFill({x: 75, y: 50})", "true"); >+ >+ debug(""); >+ debug("Test isPointInStroke()"); >+ shouldBe("p1.isPointInStroke({x: 0, y: 0})", "false"); >+ shouldBe("p1.isPointInStroke({x: 20, y: 0})", "true"); >+ shouldBe("p1.isPointInStroke({x: 150, y: 0})", "true"); >+ shouldBe("p1.isPointInStroke({x: 150, y: 35})", "true"); >+ shouldBe("p1.isPointInStroke({x: 75, y: 50})", "false"); >+ >+ debug(""); >+ debug("Test getTotalLength()"); >+ shouldBeCloseTo("p1.getTotalLength()", 500, 1); >+ >+ debug(""); >+ debug("Test getPointAtLength()"); >+ shouldBeCloseTo("p1.getPointAtLength(0).x", 0, 0.1); >+ shouldBeCloseTo("p1.getPointAtLength(0).y", 0, 0.1); >+ shouldBeCloseTo("p1.getPointAtLength(150).x", 150, 0.1); >+ shouldBeCloseTo("p1.getPointAtLength(150).y", 0, 0.1); >+ shouldBeCloseTo("p1.getPointAtLength(200).x", 150, 0.1); >+ shouldBeCloseTo("p1.getPointAtLength(200).y", 50, 0.1); >+ shouldBeCloseTo("p1.getPointAtLength(300).x", 100, 0.1); >+ shouldBeCloseTo("p1.getPointAtLength(300).y", 100, 0.1); >+ shouldBeCloseTo("p1.getPointAtLength(450).x", 0, 0.1); >+ shouldBeCloseTo("p1.getPointAtLength(450).y", 50, 0.1); >+ >+ finishJSTest(); >+} >+]]> >+</script> >+<script src="../../resources/js-test-post.js"></script> >+</body> >+</html> >diff --git a/LayoutTests/svg/dom/SVGGeometry-polyline-expected.txt b/LayoutTests/svg/dom/SVGGeometry-polyline-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..9e6bd505d59ec817d928dc18ea6160f67139a4ba >--- /dev/null >+++ b/LayoutTests/svg/dom/SVGGeometry-polyline-expected.txt >@@ -0,0 +1,41 @@ >+Test SVGGeometryElement APIs for polyline. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+ >+Test isPointInFill() >+PASS p1.isPointInFill({}) is true >+PASS p1.isPointInFill({x: 100, y: 0}) is true >+PASS p1.isPointInFill({x: 152, y: 0}) is false >+PASS p1.isPointInFill({x: 150, y: 50}) is true >+PASS p1.isPointInFill({x: 150, y: 100}) is true >+PASS p1.isPointInFill({x: 150, y: 101}) is false >+PASS p1.isPointInFill({x: 100, y: 100}) is true >+PASS p1.isPointInFill({x: 75, y: 50}) is true >+ >+Test isPointInStroke() >+PASS p1.isPointInStroke({x: 0, y: 0}) is false >+PASS p1.isPointInStroke({x: 20, y: 0}) is true >+PASS p1.isPointInStroke({x: 150, y: 0}) is true >+PASS p1.isPointInStroke({x: 150, y: 35}) is true >+PASS p1.isPointInStroke({x: 75, y: 50}) is false >+ >+Test getTotalLength() >+PASS p1.getTotalLength() is within 1 of 400 >+ >+Test getPointAtLength() >+PASS p1.getPointAtLength(0).x is within 0.1 of 0 >+PASS p1.getPointAtLength(0).y is within 0.1 of 0 >+PASS p1.getPointAtLength(150).x is within 0.1 of 150 >+PASS p1.getPointAtLength(150).y is within 0.1 of 0 >+PASS p1.getPointAtLength(200).x is within 0.1 of 150 >+PASS p1.getPointAtLength(200).y is within 0.1 of 50 >+PASS p1.getPointAtLength(300).x is within 0.1 of 100 >+PASS p1.getPointAtLength(300).y is within 0.1 of 100 >+PASS p1.getPointAtLength(450).x is within 0.1 of 0 >+PASS p1.getPointAtLength(450).y is within 0.1 of 100 >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/svg/dom/SVGGeometry-polyline.xhtml b/LayoutTests/svg/dom/SVGGeometry-polyline.xhtml >new file mode 100644 >index 0000000000000000000000000000000000000000..6549f1848f3de4c397c930aabd22cb98cbcd1efa >--- /dev/null >+++ b/LayoutTests/svg/dom/SVGGeometry-polyline.xhtml >@@ -0,0 +1,62 @@ >+<html xmlns="http://www.w3.org/1999/xhtml"> >+<head> >+<script src="../../resources/js-test-pre.js"></script> >+</head> >+<body onload="run()"> >+<svg id="svg" xmlns="http://www.w3.org/2000/svg" width="200" height="200"> >+ <polyline id="p1" points="0,0 150,0 150,100 0,100" fill="none" stroke="black" stroke-width="20" stroke-dashoffset="20" stroke-dasharray="20 20"/> >+</svg> >+<p id="description"></p> >+<div id="console"></div> >+<script type="text/javascript"> >+<![CDATA[ >+window.enablePixelTesting = false; >+window.jsTestIsAsync = true; >+var p1 = document.getElementById("p1"); >+ >+function run() { >+ description("Test SVGGeometryElement APIs for polyline."); >+ >+ debug(""); >+ debug("Test isPointInFill()"); >+ shouldBe("p1.isPointInFill({})", "true"); >+ shouldBe("p1.isPointInFill({x: 100, y: 0})", "true"); >+ shouldBe("p1.isPointInFill({x: 152, y: 0})", "false"); >+ shouldBe("p1.isPointInFill({x: 150, y: 50})", "true"); >+ shouldBe("p1.isPointInFill({x: 150, y: 100})", "true"); >+ shouldBe("p1.isPointInFill({x: 150, y: 101})", "false"); >+ shouldBe("p1.isPointInFill({x: 100, y: 100})", "true"); >+ shouldBe("p1.isPointInFill({x: 75, y: 50})", "true"); >+ >+ debug(""); >+ debug("Test isPointInStroke()"); >+ shouldBe("p1.isPointInStroke({x: 0, y: 0})", "false"); >+ shouldBe("p1.isPointInStroke({x: 20, y: 0})", "true"); >+ shouldBe("p1.isPointInStroke({x: 150, y: 0})", "true"); >+ shouldBe("p1.isPointInStroke({x: 150, y: 35})", "true"); >+ shouldBe("p1.isPointInStroke({x: 75, y: 50})", "false"); >+ >+ debug(""); >+ debug("Test getTotalLength()"); >+ shouldBeCloseTo("p1.getTotalLength()", 400, 1); >+ >+ debug(""); >+ debug("Test getPointAtLength()"); >+ shouldBeCloseTo("p1.getPointAtLength(0).x", 0, 0.1); >+ shouldBeCloseTo("p1.getPointAtLength(0).y", 0, 0.1); >+ shouldBeCloseTo("p1.getPointAtLength(150).x", 150, 0.1); >+ shouldBeCloseTo("p1.getPointAtLength(150).y", 0, 0.1); >+ shouldBeCloseTo("p1.getPointAtLength(200).x", 150, 0.1); >+ shouldBeCloseTo("p1.getPointAtLength(200).y", 50, 0.1); >+ shouldBeCloseTo("p1.getPointAtLength(300).x", 100, 0.1); >+ shouldBeCloseTo("p1.getPointAtLength(300).y", 100, 0.1); >+ shouldBeCloseTo("p1.getPointAtLength(450).x", 0, 0.1); >+ shouldBeCloseTo("p1.getPointAtLength(450).y", 100, 0.1); >+ >+ finishJSTest(); >+} >+]]> >+</script> >+<script src="../../resources/js-test-post.js"></script> >+</body> >+</html> >diff --git a/LayoutTests/svg/dom/SVGGeometry-rect-expected.txt b/LayoutTests/svg/dom/SVGGeometry-rect-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..c2b32609436b739eef1d1028a420582d625f266c >--- /dev/null >+++ b/LayoutTests/svg/dom/SVGGeometry-rect-expected.txt >@@ -0,0 +1,50 @@ >+Test SVGGeometryElement APIs for rect. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+ >+Test isPointInFill() >+PASS r1.isPointInFill({}) is false >+PASS r1.isPointInFill({x: 48, y: 0}) is false >+PASS r1.isPointInFill({x: 52, y: 0}) is true >+PASS r1.isPointInFill({x: 98, y: 0}) is true >+PASS r1.isPointInFill({x: 102, y: 0}) is false >+PASS r1.isPointInFill({x: 150, y: 38}) is false >+PASS r1.isPointInFill({x: 150, y: 42}) is true >+PASS r1.isPointInFill({x: 150, y: 58}) is true >+PASS r1.isPointInFill({x: 150, y: 62}) is false >+PASS r1.isPointInFill({x: 48, y: 100}) is false >+PASS r1.isPointInFill({x: 52, y: 100}) is true >+PASS r1.isPointInFill({x: 98, y: 100}) is true >+PASS r1.isPointInFill({x: 102, y: 100}) is false >+PASS r1.isPointInFill({x: 0, y: 38}) is false >+PASS r1.isPointInFill({x: 0, y: 42}) is true >+PASS r1.isPointInFill({x: 0, y: 58}) is true >+PASS r1.isPointInFill({x: 0, y: 62}) is false >+PASS r1.isPointInFill({x: 75, y: 50}) is true >+ >+Test isPointInStroke() >+PASS r1.isPointInStroke({x: 52, y: 0}) is false >+PASS r1.isPointInStroke({x: 72, y: 0}) is true >+PASS r1.isPointInStroke({x: 92, y: 0}) is false >+PASS r1.isPointInStroke({x: 112, y: 10}) is true >+ >+Test getTotalLength() >+PASS r1.getTotalLength() is within 1 of 424 >+ >+Test getPointAtLength() >+PASS r1.getPointAtLength(0).x is within 1 of 50 >+PASS r1.getPointAtLength(0).y is within 1 of 0 >+PASS r1.getPointAtLength(25).x is within 1 of 75 >+PASS r1.getPointAtLength(25).y is within 1 of 0 >+PASS r1.getPointAtLength(200).x is within 3 of 112 >+PASS r1.getPointAtLength(200).y is within 3 of 100 >+PASS r1.getPointAtLength(300).x is within 3 of 14 >+PASS r1.getPointAtLength(300).y is within 3 of 88 >+PASS r1.getPointAtLength(400).x is within 3 of 27 >+PASS r1.getPointAtLength(400).y is within 3 of 5 >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/svg/dom/SVGGeometry-rect.xhtml b/LayoutTests/svg/dom/SVGGeometry-rect.xhtml >new file mode 100644 >index 0000000000000000000000000000000000000000..f83f9a2e51d7aa60dca1a280bb47d7ae8b71ddfc >--- /dev/null >+++ b/LayoutTests/svg/dom/SVGGeometry-rect.xhtml >@@ -0,0 +1,71 @@ >+<html xmlns="http://www.w3.org/1999/xhtml"> >+<head> >+<script src="../../resources/js-test-pre.js"></script> >+</head> >+<body onload="run()"> >+<svg id="svg" xmlns="http://www.w3.org/2000/svg" width="200" height="200"> >+ <rect id="r1" rx="50" ry="40" width="150" height="100" fill="none" stroke="black" stroke-width="20" stroke-dashoffset="20" stroke-dasharray="20 20"/> >+</svg> >+<p id="description"></p> >+<div id="console"></div> >+<script type="text/javascript"> >+<![CDATA[ >+window.enablePixelTesting = false; >+window.jsTestIsAsync = true; >+var r1 = document.getElementById("r1"); >+ >+function run() { >+ description("Test SVGGeometryElement APIs for rect."); >+ >+ debug(""); >+ debug("Test isPointInFill()"); >+ shouldBe("r1.isPointInFill({})", "false"); >+ shouldBe("r1.isPointInFill({x: 48, y: 0})", "false"); >+ shouldBe("r1.isPointInFill({x: 52, y: 0})", "true"); >+ shouldBe("r1.isPointInFill({x: 98, y: 0})", "true"); >+ shouldBe("r1.isPointInFill({x: 102, y: 0})", "false"); >+ shouldBe("r1.isPointInFill({x: 150, y: 38})", "false"); >+ shouldBe("r1.isPointInFill({x: 150, y: 42})", "true"); >+ shouldBe("r1.isPointInFill({x: 150, y: 58})", "true"); >+ shouldBe("r1.isPointInFill({x: 150, y: 62})", "false"); >+ shouldBe("r1.isPointInFill({x: 48, y: 100})", "false"); >+ shouldBe("r1.isPointInFill({x: 52, y: 100})", "true"); >+ shouldBe("r1.isPointInFill({x: 98, y: 100})", "true"); >+ shouldBe("r1.isPointInFill({x: 102, y: 100})", "false"); >+ shouldBe("r1.isPointInFill({x: 0, y: 38})", "false"); >+ shouldBe("r1.isPointInFill({x: 0, y: 42})", "true"); >+ shouldBe("r1.isPointInFill({x: 0, y: 58})", "true"); >+ shouldBe("r1.isPointInFill({x: 0, y: 62})", "false"); >+ shouldBe("r1.isPointInFill({x: 75, y: 50})", "true"); >+ >+ debug(""); >+ debug("Test isPointInStroke()"); >+ shouldBe("r1.isPointInStroke({x: 52, y: 0})", "false"); >+ shouldBe("r1.isPointInStroke({x: 72, y: 0})", "true"); >+ shouldBe("r1.isPointInStroke({x: 92, y: 0})", "false"); >+ shouldBe("r1.isPointInStroke({x: 112, y: 10})", "true"); >+ >+ debug(""); >+ debug("Test getTotalLength()"); >+ shouldBeCloseTo("r1.getTotalLength()", 424, 1); >+ >+ debug(""); >+ debug("Test getPointAtLength()"); >+ shouldBeCloseTo("r1.getPointAtLength(0).x", 50, 1); >+ shouldBeCloseTo("r1.getPointAtLength(0).y", 0, 1); >+ shouldBeCloseTo("r1.getPointAtLength(25).x", 75, 1); >+ shouldBeCloseTo("r1.getPointAtLength(25).y", 0, 1); >+ shouldBeCloseTo("r1.getPointAtLength(200).x", 112, 3); >+ shouldBeCloseTo("r1.getPointAtLength(200).y", 100, 3); >+ shouldBeCloseTo("r1.getPointAtLength(300).x", 14, 3); >+ shouldBeCloseTo("r1.getPointAtLength(300).y", 88, 3); >+ shouldBeCloseTo("r1.getPointAtLength(400).x", 27, 3); >+ shouldBeCloseTo("r1.getPointAtLength(400).y", 5, 3); >+ >+ finishJSTest(); >+} >+]]> >+</script> >+<script src="../../resources/js-test-post.js"></script> >+</body> >+</html> >diff --git a/LayoutTests/svg/dom/svg2-inheritance-expected.txt b/LayoutTests/svg/dom/svg2-inheritance-expected.txt >index a41c2ac0005479817027bcd4906d86387b631212..63efaeea3272bac059c241a8f8dc281117122682 100644 >--- a/LayoutTests/svg/dom/svg2-inheritance-expected.txt >+++ b/LayoutTests/svg/dom/svg2-inheritance-expected.txt >@@ -27,7 +27,7 @@ PASS SVGAnimatedString inherits Object > PASS SVGAnimatedTransformList inherits Object > PASS SVGAnimationElement inherits SVGElement > FAIL SVGCSSRule is not defined >-FAIL SVGCircleElement should inherit SVGGeometryElement but got SVGGraphicsElement instead >+PASS SVGCircleElement inherits SVGGeometryElement > FAIL SVGClipPathElement should inherit SVGDefinitionElement but got SVGGraphicsElement instead > FAIL SVGColorProfileElement is not defined > FAIL SVGColorProfileRule is not defined >@@ -35,7 +35,7 @@ PASS SVGCursorElement inherits SVGElement > PASS SVGDefsElement inherits SVGGraphicsElement > PASS SVGDescElement inherits SVGElement > PASS SVGElement inherits Element >-FAIL SVGEllipseElement should inherit SVGGeometryElement but got SVGGraphicsElement instead >+PASS SVGEllipseElement inherits SVGGeometryElement > PASS SVGFontElement inherits SVGElement > PASS SVGFontFaceElement inherits SVGElement > PASS SVGFontFaceFormatElement inherits SVGElement >@@ -53,7 +53,7 @@ PASS SVGHKernElement inherits SVGElement > PASS SVGImageElement inherits SVGGraphicsElement > PASS SVGLength inherits Object > PASS SVGLengthList inherits Object >-FAIL SVGLineElement should inherit SVGGeometryElement but got SVGGraphicsElement instead >+PASS SVGLineElement inherits SVGGeometryElement > PASS SVGLinearGradientElement inherits SVGGradientElement > PASS SVGMPathElement inherits SVGElement > PASS SVGMarkerElement inherits SVGElement >@@ -93,12 +93,12 @@ PASS SVGPathSegMovetoRel inherits SVGPathSeg > PASS SVGPatternElement inherits SVGElement > PASS SVGPoint inherits Object > PASS SVGPointList inherits Object >-FAIL SVGPolygonElement should inherit SVGGeometryElement but got SVGGraphicsElement instead >-FAIL SVGPolylineElement should inherit SVGGeometryElement but got SVGGraphicsElement instead >+PASS SVGPolygonElement inherits SVGGeometryElement >+PASS SVGPolylineElement inherits SVGGeometryElement > PASS SVGPreserveAspectRatio inherits Object > PASS SVGRadialGradientElement inherits SVGGradientElement > PASS SVGRect inherits Object >-FAIL SVGRectElement should inherit SVGGeometryElement but got SVGGraphicsElement instead >+PASS SVGRectElement inherits SVGGeometryElement > PASS SVGSVGElement inherits SVGGraphicsElement > PASS SVGScriptElement inherits SVGElement > PASS SVGSetElement inherits SVGAnimationElement
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185600
:
340288
|
340694