Changeset 230829 in webkit
- Timestamp:
- Apr 19, 2018 6:00:40 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r230828 r230829 1 2018-04-19 Dirk Schulze <krit@webkit.org> 2 3 Introduce SVGGeometryElement interface 4 https://bugs.webkit.org/show_bug.cgi?id=184768 5 6 Reviewed by Antti Koivisto. 7 8 Start implementing SVGGeometryElement interface from SVG2. 9 10 * svg/dom/SVGPolygonElement-baseVal-list-removal-crash.html: pointAtLength requires value now. 11 * svg/dom/path-pointAtLength-expected.txt: 12 * svg/dom/path-pointAtLength.html: Added throw tests for pointAtLength. 13 * svg/dom/svg2-inheritance-expected.txt: Inheritance fixed for SVGPathElement only for now. 14 1 15 2018-04-19 Tadeu Zagallo <tzagallo@apple.com> 2 16 -
trunk/LayoutTests/svg/dom/SVGPolygonElement-baseVal-list-removal-crash.html
r124380 r230829 8 8 var oSVGPolygon = document.createElementNS("http://www.w3.org/2000/svg", "polygon"); 9 9 var oSVGPath = document.createElementNS("http://www.w3.org/2000/svg", "path"); 10 var oSVGPoint1 = oSVGPath.getPointAtLength( );10 var oSVGPoint1 = oSVGPath.getPointAtLength(0); 11 11 oSVGPolygon.points.initialize(oSVGPoint1); 12 12 oSVGPolygon.points.removeItem(-9223372036854775802); -
trunk/LayoutTests/svg/dom/path-pointAtLength-expected.txt
r66979 r230829 8 8 PASS pointAtLengthOfPath('M0,20 L400,20 z M 320,20 L640,20') is '(100, 20)' 9 9 PASS pointAtLengthOfPath('M0,20 L20,40') is '(20, 40)' 10 PASS pathElement.getPointAtLength(Math.NaN) threw exception TypeError: The provided value is non-finite. 11 PASS pathElement.getPointAtLength() threw exception TypeError: Not enough arguments. 12 PASS pathElement.getPointAtLength(Math.Infinity) threw exception TypeError: The provided value is non-finite. 13 PASS pathElement.getPointAtLength('abc') threw exception TypeError: The provided value is non-finite. 10 14 PASS successfullyParsed is true 11 15 -
trunk/LayoutTests/svg/dom/path-pointAtLength.html
r217390 r230829 23 23 shouldBe("pointAtLengthOfPath('M0,20 L400,20 z M 320,20 L640,20')", "'(100, 20)'"); 24 24 shouldBe("pointAtLengthOfPath('M0,20 L20,40')", "'(20, 40)'"); 25 shouldThrow("pathElement.getPointAtLength(Math.NaN)"); 26 shouldThrow("pathElement.getPointAtLength()"); 27 shouldThrow("pathElement.getPointAtLength(Math.Infinity)"); 28 shouldThrow("pathElement.getPointAtLength('abc')"); 25 29 26 30 var successfullyParsed = true; -
trunk/LayoutTests/svg/dom/svg2-inheritance-expected.txt
r179810 r230829 45 45 PASS SVGForeignObjectElement inherits SVGGraphicsElement 46 46 PASS SVGGElement inherits SVGGraphicsElement 47 FAIL SVGGeometryElement is not defined 47 PASS SVGGeometryElement inherits SVGGraphicsElement 48 48 PASS SVGGlyphElement inherits SVGElement 49 49 PASS SVGGlyphRefElement inherits SVGElement … … 69 69 PASS SVGNumber inherits Object 70 70 PASS SVGNumberList inherits Object 71 FAIL SVGPathElement should inherit SVGGeometryElement but got SVGGraphicsElement instead 71 PASS SVGPathElement inherits SVGGeometryElement 72 72 PASS SVGPathSeg inherits Object 73 73 PASS SVGPathSegArcAbs inherits SVGPathSeg -
trunk/Source/WebCore/CMakeLists.txt
r230715 r230829 941 941 svg/SVGForeignObjectElement.idl 942 942 svg/SVGGElement.idl 943 svg/SVGGeometryElement.idl 943 944 svg/SVGGlyphElement.idl 944 945 svg/SVGGlyphRefElement.idl -
trunk/Source/WebCore/ChangeLog
r230828 r230829 1 2018-04-19 Dirk Schulze <krit@webbkit.org> 2 3 Introduce SVGGeometryElement interface 4 https://bugs.webkit.org/show_bug.cgi?id=184768 5 6 Reviewed by Antti Koivisto. 7 8 Start implementing SVGGeometryElement interface from SVG2. 9 https://svgwg.org/svg2-draft/types.html#InterfaceSVGGeometryElement 10 11 Start with SVGPathElement only for now. Also, just inferface gets implemented 12 by this patch. No new functionality like isPointInFill yet. 13 Fix getPointAtLength and make it more restrictive. This follows the spec and 14 all other implementations. 15 16 Added additional test scenarios to existing tests. 17 18 * CMakeLists.txt: 19 * DerivedSources.make: 20 * Sources.txt: 21 * WebCore.xcodeproj/project.pbxproj: 22 * bindings/scripts/CodeGeneratorJS.pm: 23 (GetGnuVTableOffsetForType): 24 * svg/SVGAllInOne.cpp: 25 * svg/SVGGeometryElement.cpp: Added. 26 (WebCore::SVGGeometryElement::SVGGeometryElement): 27 (WebCore::SVGGeometryElement::isSupportedAttribute): 28 (WebCore::SVGGeometryElement::parseAttribute): 29 (WebCore::SVGGeometryElement::svgAttributeChanged): 30 (WebCore::SVGGeometryElement::createElementRenderer): 31 * svg/SVGGeometryElement.h: Added. 32 * svg/SVGGeometryElement.idl: Added. 33 * svg/SVGGradientElement.cpp: 34 * svg/SVGPathElement.cpp: 35 (WebCore::SVGPathElement::SVGPathElement): 36 (WebCore::SVGPathElement::parseAttribute): 37 (WebCore::SVGPathElement::svgAttributeChanged): 38 (WebCore::SVGPathElement::insertedIntoAncestor): 39 (WebCore::SVGPathElement::removedFromAncestor): 40 * svg/SVGPathElement.h: 41 * svg/SVGPathElement.idl: 42 1 43 2018-04-19 Tadeu Zagallo <tzagallo@apple.com> 2 44 -
trunk/Source/WebCore/DerivedSources.make
r230715 r230829 869 869 $(WebCore)/svg/SVGForeignObjectElement.idl \ 870 870 $(WebCore)/svg/SVGGElement.idl \ 871 $(WebCore)/svg/SVGGeometryElement.idl \ 871 872 $(WebCore)/svg/SVGGlyphElement.idl \ 872 873 $(WebCore)/svg/SVGGlyphRefElement.idl \ -
trunk/Source/WebCore/Sources.txt
r230794 r230829 2148 2148 svg/SVGForeignObjectElement.cpp 2149 2149 svg/SVGGElement.cpp 2150 svg/SVGGeometryElement.cpp 2150 2151 svg/SVGGlyphElement.cpp 2151 2152 svg/SVGGlyphRefElement.cpp … … 2922 2923 JSSVGForeignObjectElement.cpp 2923 2924 JSSVGGElement.cpp 2925 JSSVGGeometryElement.cpp 2924 2926 JSSVGGlyphElement.cpp 2925 2927 JSSVGGlyphRefElement.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r230812 r230829 4816 4816 FABE72F91059C1EB00D999DD /* MathMLMathElement.h in Headers */ = {isa = PBXBuildFile; fileRef = FABE72F21059C1EB00D999DD /* MathMLMathElement.h */; }; 4817 4817 FABE72FE1059C21100D999DD /* MathMLNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FABE72FC1059C21100D999DD /* MathMLNames.cpp */; }; 4818 FB273E822086E6C700A54E87 /* SVGGeometryElement.h in Headers */ = {isa = PBXBuildFile; fileRef = FB273E7F2086E6A300A54E87 /* SVGGeometryElement.h */; }; 4819 FB273E852086E74D00A54E87 /* JSSVGGeometryElement.h in Headers */ = {isa = PBXBuildFile; fileRef = FB273E842086E73E00A54E87 /* JSSVGGeometryElement.h */; }; 4818 4820 FB2C15C3165D649D0039C9F8 /* CachedSVGDocumentReference.h in Headers */ = {isa = PBXBuildFile; fileRef = FB2C15C2165D64900039C9F8 /* CachedSVGDocumentReference.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4819 4821 FB3056C2169E5DAC0096A232 /* CSSGroupingRule.h in Headers */ = {isa = PBXBuildFile; fileRef = FB3056C1169E5DAC0096A232 /* CSSGroupingRule.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 14516 14518 FABE72FB1059C21100D999DD /* MathMLElementFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLElementFactory.cpp; sourceTree = "<group>"; }; 14517 14519 FABE72FC1059C21100D999DD /* MathMLNames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLNames.cpp; sourceTree = "<group>"; }; 14520 FB273E7E2086E6A300A54E87 /* SVGGeometryElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGGeometryElement.cpp; sourceTree = "<group>"; }; 14521 FB273E7F2086E6A300A54E87 /* SVGGeometryElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGGeometryElement.h; sourceTree = "<group>"; }; 14522 FB273E802086E6A300A54E87 /* SVGGeometryElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SVGGeometryElement.idl; sourceTree = "<group>"; }; 14523 FB273E832086E73E00A54E87 /* JSSVGGeometryElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGGeometryElement.cpp; sourceTree = SOURCE_ROOT; }; 14524 FB273E842086E73E00A54E87 /* JSSVGGeometryElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSVGGeometryElement.h; sourceTree = SOURCE_ROOT; }; 14518 14525 FB2C15C2165D64900039C9F8 /* CachedSVGDocumentReference.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedSVGDocumentReference.h; sourceTree = "<group>"; }; 14519 14526 FB3056C1169E5DAC0096A232 /* CSSGroupingRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSGroupingRule.h; sourceTree = "<group>"; }; … … 21925 21932 B2FA3CB20AB75A6E000E5AC4 /* JSSVGGElement.cpp */, 21926 21933 B2FA3CB30AB75A6E000E5AC4 /* JSSVGGElement.h */, 21934 FB273E832086E73E00A54E87 /* JSSVGGeometryElement.cpp */, 21935 FB273E842086E73E00A54E87 /* JSSVGGeometryElement.h */, 21927 21936 B27B28210CEF0C0700D39D54 /* JSSVGGlyphElement.cpp */, 21928 21937 B27B28220CEF0C0700D39D54 /* JSSVGGlyphElement.h */, … … 22877 22886 B22278910D00BF200071B782 /* SVGGElement.h */, 22878 22887 B22278920D00BF200071B782 /* SVGGElement.idl */, 22888 FB273E7E2086E6A300A54E87 /* SVGGeometryElement.cpp */, 22889 FB273E7F2086E6A300A54E87 /* SVGGeometryElement.h */, 22890 FB273E802086E6A300A54E87 /* SVGGeometryElement.idl */, 22879 22891 B2A1F2A40CEF0ABF00442F6A /* SVGGlyphElement.cpp */, 22880 22892 B2A1F2A50CEF0ABF00442F6A /* SVGGlyphElement.h */, … … 28740 28752 B2FA3D990AB75A6F000E5AC4 /* JSSVGForeignObjectElement.h in Headers */, 28741 28753 B2FA3D9B0AB75A6F000E5AC4 /* JSSVGGElement.h in Headers */, 28754 FB273E852086E74D00A54E87 /* JSSVGGeometryElement.h in Headers */, 28742 28755 B27B28280CEF0C0700D39D54 /* JSSVGGlyphElement.h in Headers */, 28743 28756 24D9129A13CA971400D21915 /* JSSVGGlyphRefElement.h in Headers */, … … 30141 30154 B2227A240D00BF220071B782 /* SVGForeignObjectElement.h in Headers */, 30142 30155 B2227A270D00BF220071B782 /* SVGGElement.h in Headers */, 30156 FB273E822086E6C700A54E87 /* SVGGeometryElement.h in Headers */, 30143 30157 B2A1F2AE0CEF0ABF00442F6A /* SVGGlyphElement.h in Headers */, 30144 30158 24D912BE13CA9A9700D21915 /* SVGGlyphRefElement.h in Headers */, -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r230789 r230829 3561 3561 || $typename eq "SVGRectElement" 3562 3562 || $typename eq "SVGSVGElement" 3563 || $typename eq "SVGGeometryElement" 3563 3564 || $typename eq "SVGGraphicsElement" 3564 3565 || $typename eq "SVGSwitchElement" -
trunk/Source/WebCore/svg/SVGAllInOne.cpp
r219712 r230829 103 103 #include "SVGForeignObjectElement.cpp" 104 104 #include "SVGGElement.cpp" 105 #include "SVGGeometryElement.cpp" 105 106 #include "SVGGlyphElement.cpp" 106 107 #include "SVGGlyphRefElement.cpp" -
trunk/Source/WebCore/svg/SVGGradientElement.cpp
r229694 r230829 25 25 #include "ElementIterator.h" 26 26 #include "RenderSVGHiddenContainer.h" 27 #include "RenderSVGPath.h"28 27 #include "RenderSVGResourceLinearGradient.h" 29 28 #include "RenderSVGResourceRadialGradient.h" -
trunk/Source/WebCore/svg/SVGPathElement.cpp
r229830 r230829 80 80 REGISTER_LOCAL_ANIMATED_PROPERTY(pathLength) 81 81 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) 82 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGG raphicsElement)82 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGeometryElement) 83 83 END_REGISTER_ANIMATED_PROPERTIES 84 84 85 85 inline SVGPathElement::SVGPathElement(const QualifiedName& tagName, Document& document) 86 : SVGG raphicsElement(tagName, document)86 : SVGGeometryElement(tagName, document) 87 87 , m_pathSegList(PathSegUnalteredRole) 88 88 , m_isAnimValObserved(false) … … 241 241 } 242 242 243 SVGG raphicsElement::parseAttribute(name, value);243 SVGGeometryElement::parseAttribute(name, value); 244 244 SVGExternalResourcesRequired::parseAttribute(name, value); 245 245 } … … 248 248 { 249 249 if (!isSupportedAttribute(attrName)) { 250 SVGG raphicsElement::svgAttributeChanged(attrName);250 SVGGeometryElement::svgAttributeChanged(attrName); 251 251 return; 252 252 } … … 287 287 Node::InsertedIntoAncestorResult SVGPathElement::insertedIntoAncestor(InsertionType insertionType, ContainerNode& parentOfInsertedTree) 288 288 { 289 SVGG raphicsElement::insertedIntoAncestor(insertionType, parentOfInsertedTree);289 SVGGeometryElement::insertedIntoAncestor(insertionType, parentOfInsertedTree); 290 290 invalidateMPathDependencies(); 291 291 return InsertedIntoAncestorResult::Done; … … 294 294 void SVGPathElement::removedFromAncestor(RemovalType removalType, ContainerNode& oldParentOfRemovedTree) 295 295 { 296 SVGG raphicsElement::removedFromAncestor(removalType, oldParentOfRemovedTree);296 SVGGeometryElement::removedFromAncestor(removalType, oldParentOfRemovedTree); 297 297 invalidateMPathDependencies(); 298 298 } -
trunk/Source/WebCore/svg/SVGPathElement.h
r229694 r230829 25 25 #include "SVGAnimatedNumber.h" 26 26 #include "SVGExternalResourcesRequired.h" 27 #include "SVGG raphicsElement.h"27 #include "SVGGeometryElement.h" 28 28 #include "SVGNames.h" 29 29 #include "SVGPathByteStream.h" … … 54 54 class SVGPoint; 55 55 56 class SVGPathElement final : public SVGG raphicsElement, public SVGExternalResourcesRequired {56 class SVGPathElement final : public SVGGeometryElement, public SVGExternalResourcesRequired { 57 57 WTF_MAKE_ISO_ALLOCATED(SVGPathElement); 58 58 public: 59 59 static Ref<SVGPathElement> create(const QualifiedName&, Document&); 60 60 61 float getTotalLength() const ;62 Ref<SVGPoint> getPointAtLength(float distance) const ;61 float getTotalLength() const final; 62 Ref<SVGPoint> getPointAtLength(float distance) const final; 63 63 unsigned getPathSegAtLength(float distance) const; 64 64 -
trunk/Source/WebCore/svg/SVGPathElement.idl
r208705 r230829 25 25 */ 26 26 27 interface SVGPathElement : SVGGraphicsElement { 28 readonly attribute SVGAnimatedNumber pathLength; 29 30 unrestricted float getTotalLength(); 31 [NewObject] SVGPoint getPointAtLength(optional unrestricted float distance = NaN); 27 interface SVGPathElement : SVGGeometryElement { 32 28 unsigned long getPathSegAtLength(optional unrestricted float distance = NaN); 33 29
Note: See TracChangeset
for help on using the changeset viewer.