Skip to content

Commit

Permalink
Remove the SVG tear off objects for SVGPathSeg, SVGPathSegList and SV…
Browse files Browse the repository at this point in the history
…GAnimatedPathSegList

https://bugs.webkit.org/show_bug.cgi?id=196085

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-03-27
Reviewed by Simon Fraser.

Source/WebCore:

The SVGPathSegList is similar to the other SVGLists, e.g. SVGNUmberList
and SVGPointList except in two things:

1. Its items can be different but they are derived from the same base
   class SVGPathSeg.

2. The SVGPathSeg items are only used for DOM. When drawing or animating
   we have to have an SVGPathByteStream and convert it to a Path. Converting
   an SVGPathByteStream to SVGPathSeg items and vice versa is expensive.
   Building a Path from an SVGPathByteStream is also expensive. So an extra
   care needs to be taken for when these conversions happen.

In addition to handling the SVGPathSeg items, SVGPathSegList will manage
the associated SVGPathByteStream and Path objects. SVGPathSegList will be
lazy in getting updated objects when a change happens. For example, when
the byte stream changes, SVGPathSegList will clear its items and nullify
the Path object. But it will not build any of them until they are explicitly
requested.

Like what was done for other SVG properties when removing their tear off
objects, a new accessor, a new animator and a new animation function will
be added for the SVGAnimatedPathSegList.

All the header files of the concrete classes of SVGPathSeg will be removed
because they are small structures which hold some data items and they provide
setters and getters for these items. Here is the new file structures and
their contents:

-- SVGPathSeg.h still has the class SVGPathSeg which is now a superclass
   of SVGProperty.

-- SVGPathSegValue.h will have the template class SVGPathSegValue which
   holds an std::tuple of packed arguments. It provides setters and getters
   for these arguments. SVGPathSegValue.h will also have specialized
   classed derived from SVGPathSegValue and hold different arguments.

-- SVGPathSegImpl.h will have the final concrete SVGPathSeg classes.

Note SVGPathSeg concrete classes do not need to have a reference to the
the context SVGPathElement. SVGPathSeg will be owned by its SVGPathSegList
which will be owned by the SVGAnimatedPathSegList which will be owned by
the SVGPathElement.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSSVGPathSegCustom.cpp:
* bindings/scripts/CodeGenerator.pm:
(IsSVGPathSegTypeName):
(IsSVGPathSegType):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
* rendering/svg/SVGPathData.cpp:
(WebCore::pathFromPathElement):
* svg/SVGAnimatedPath.cpp: Removed.
* svg/SVGAnimatedPath.h: Removed.
* svg/SVGAnimatedType.h:
(WebCore::SVGAnimatedType::type const):
* svg/SVGAnimatorFactory.h:
(WebCore::SVGAnimatorFactory::create):
* svg/SVGPathByteStream.h:
(WebCore::SVGPathByteStream::SVGPathByteStream):
This constructor is used by SVGAnimationPathSegListFunction to convert
the 'form', 'to' and 'toAtEndOfDuration' strings to SVGPathByteStreams.

(WebCore::SVGPathByteStream::resize): Deleted.
(WebCore::SVGPropertyTraits<SVGPathByteStream>::initialValue): Deleted.
(WebCore::SVGPropertyTraits<SVGPathByteStream>::fromString): Deleted.
(WebCore::SVGPropertyTraits<SVGPathByteStream>::parse): Deleted.
(WebCore::SVGPropertyTraits<SVGPathByteStream>::toString): Deleted.
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::SVGPathElement):
(WebCore::SVGPathElement::parseAttribute):
(WebCore::SVGPathElement::svgAttributeChanged):
(WebCore::SVGPathElement::getTotalLength const):
(WebCore::SVGPathElement::getPointAtLength const):
(WebCore::SVGPathElement::getPathSegAtLength const):
(WebCore::SVGPathElement::createSVGPathSegClosePath): Deleted.
(WebCore::SVGPathElement::createSVGPathSegMovetoAbs): Deleted.
(WebCore::SVGPathElement::createSVGPathSegMovetoRel): Deleted.
(WebCore::SVGPathElement::createSVGPathSegLinetoAbs): Deleted.
(WebCore::SVGPathElement::createSVGPathSegLinetoRel): Deleted.
(WebCore::SVGPathElement::createSVGPathSegCurvetoCubicAbs): Deleted.
(WebCore::SVGPathElement::createSVGPathSegCurvetoCubicRel): Deleted.
(WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticAbs): Deleted.
(WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticRel): Deleted.
(WebCore::SVGPathElement::createSVGPathSegArcAbs): Deleted.
(WebCore::SVGPathElement::createSVGPathSegArcRel): Deleted.
(WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalAbs): Deleted.
(WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalRel): Deleted.
(WebCore::SVGPathElement::createSVGPathSegLinetoVerticalAbs): Deleted.
(WebCore::SVGPathElement::createSVGPathSegLinetoVerticalRel): Deleted.
(WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs): Deleted.
(WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel): Deleted.
(WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs): Deleted.
(WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel): Deleted.
The SVGPathSeg creation functions are moved to the header file.

(WebCore::SVGPathElement::registerAttributes): Deleted.
(WebCore::SVGPathElement::pathByteStream const): Deleted.
(WebCore::SVGPathElement::pathForByteStream const): Deleted.
(WebCore::SVGPathElement::lookupOrCreateDWrapper): Deleted.
(WebCore::SVGPathElement::animatedPropertyWillBeDeleted): Deleted.
(WebCore::SVGPathElement::pathSegList): Deleted.
(WebCore::SVGPathElement::normalizedPathSegList): Deleted.
(WebCore::SVGPathElement::animatedPathSegList): Deleted.
(WebCore::SVGPathElement::animatedNormalizedPathSegList): Deleted.
(WebCore::SVGPathElement::approximateMemoryCost const): Deleted.
(WebCore::SVGPathElement::pathSegListChanged): Deleted.
Managing the SVGPathByteStream and the drawing Path objects will be the
responsibility of SVGPathSegList.

* svg/SVGPathElement.h:
* svg/SVGPathSeg.h:
* svg/SVGPathSegArc.h: Removed.
* svg/SVGPathSegArcAbs.h: Removed.
* svg/SVGPathSegArcRel.h: Removed.
* svg/SVGPathSegClosePath.h: Removed.
* svg/SVGPathSegCurvetoCubic.h: Removed.
* svg/SVGPathSegCurvetoCubicAbs.h: Removed.
* svg/SVGPathSegCurvetoCubicRel.h: Removed.
* svg/SVGPathSegCurvetoCubicSmooth.h: Removed.
* svg/SVGPathSegCurvetoCubicSmoothAbs.h: Removed.
* svg/SVGPathSegCurvetoCubicSmoothRel.h: Removed.
* svg/SVGPathSegCurvetoQuadratic.h: Removed.
* svg/SVGPathSegCurvetoQuadraticAbs.h: Removed.
* svg/SVGPathSegCurvetoQuadraticRel.h: Removed.
* svg/SVGPathSegCurvetoQuadraticSmoothAbs.h: Removed.
* svg/SVGPathSegCurvetoQuadraticSmoothRel.h: Removed.
* svg/SVGPathSegImpl.h: Added.
* svg/SVGPathSegLinetoAbs.h: Removed.
* svg/SVGPathSegLinetoHorizontal.h: Removed.
* svg/SVGPathSegLinetoHorizontalAbs.h: Removed.
* svg/SVGPathSegLinetoHorizontalRel.h: Removed.
* svg/SVGPathSegLinetoRel.h: Removed.
* svg/SVGPathSegLinetoVertical.h: Removed.
* svg/SVGPathSegLinetoVerticalAbs.h: Removed.
* svg/SVGPathSegLinetoVerticalRel.h: Removed.
The definition of these classes are now in SVGPathSegImpl.h.

* svg/SVGPathSegList.cpp: Removed.
* svg/SVGPathSegList.h:
* svg/SVGPathSegListBuilder.cpp:
(WebCore::SVGPathSegListBuilder::SVGPathSegListBuilder):
(WebCore::SVGPathSegListBuilder::moveTo):
(WebCore::SVGPathSegListBuilder::lineTo):
(WebCore::SVGPathSegListBuilder::lineToHorizontal):
(WebCore::SVGPathSegListBuilder::lineToVertical):
(WebCore::SVGPathSegListBuilder::curveToCubic):
(WebCore::SVGPathSegListBuilder::curveToCubicSmooth):
(WebCore::SVGPathSegListBuilder::curveToQuadratic):
(WebCore::SVGPathSegListBuilder::curveToQuadraticSmooth):
(WebCore::SVGPathSegListBuilder::arcTo):
(WebCore::SVGPathSegListBuilder::closePath):
* svg/SVGPathSegListBuilder.h:
The concrete SVGPathSeg classes can now create instances of their classes
without having to go through the SVGPathElement.

* svg/SVGPathSegListSource.cpp:
(WebCore::SVGPathSegListSource::SVGPathSegListSource):
* svg/SVGPathSegListSource.h:
* svg/SVGPathSegListValues.cpp: Removed.
* svg/SVGPathSegListValues.h: Removed.
* svg/SVGPathSegMovetoAbs.h: Removed.
* svg/SVGPathSegMovetoRel.h: Removed.
* svg/SVGPathSegValue.h: Added.
(WebCore::SVGPathSegValue::create):
(WebCore::SVGPathSegValue::clone const):
(WebCore::SVGPathSegValue::SVGPathSegValue):
(WebCore::SVGPathSegValue::argument const):
(WebCore::SVGPathSegValue::setArgument):
(WebCore::SVGPathSegLinetoHorizontal::x const):
(WebCore::SVGPathSegLinetoHorizontal::setX):
(WebCore::SVGPathSegLinetoVertical::y const):
(WebCore::SVGPathSegLinetoVertical::setY):
(WebCore::SVGPathSegSingleCoordinate::x const):
(WebCore::SVGPathSegSingleCoordinate::setX):
(WebCore::SVGPathSegSingleCoordinate::y const):
(WebCore::SVGPathSegSingleCoordinate::setY):
(WebCore::SVGPathSegCurvetoQuadratic::x const):
(WebCore::SVGPathSegCurvetoQuadratic::setX):
(WebCore::SVGPathSegCurvetoQuadratic::y const):
(WebCore::SVGPathSegCurvetoQuadratic::setY):
(WebCore::SVGPathSegCurvetoQuadratic::x1 const):
(WebCore::SVGPathSegCurvetoQuadratic::setX1):
(WebCore::SVGPathSegCurvetoQuadratic::y1 const):
(WebCore::SVGPathSegCurvetoQuadratic::setY1):
(WebCore::SVGPathSegCurvetoCubicSmooth::x const):
(WebCore::SVGPathSegCurvetoCubicSmooth::setX):
(WebCore::SVGPathSegCurvetoCubicSmooth::y const):
(WebCore::SVGPathSegCurvetoCubicSmooth::setY):
(WebCore::SVGPathSegCurvetoCubicSmooth::x2 const):
(WebCore::SVGPathSegCurvetoCubicSmooth::setX2):
(WebCore::SVGPathSegCurvetoCubicSmooth::y2 const):
(WebCore::SVGPathSegCurvetoCubicSmooth::setY2):
(WebCore::SVGPathSegCurvetoCubic::x const):
(WebCore::SVGPathSegCurvetoCubic::setX):
(WebCore::SVGPathSegCurvetoCubic::y const):
(WebCore::SVGPathSegCurvetoCubic::setY):
(WebCore::SVGPathSegCurvetoCubic::x1 const):
(WebCore::SVGPathSegCurvetoCubic::setX1):
(WebCore::SVGPathSegCurvetoCubic::y1 const):
(WebCore::SVGPathSegCurvetoCubic::setY1):
(WebCore::SVGPathSegCurvetoCubic::x2 const):
(WebCore::SVGPathSegCurvetoCubic::setX2):
(WebCore::SVGPathSegCurvetoCubic::y2 const):
(WebCore::SVGPathSegCurvetoCubic::setY2):
(WebCore::SVGPathSegArc::x const):
(WebCore::SVGPathSegArc::setX):
(WebCore::SVGPathSegArc::y const):
(WebCore::SVGPathSegArc::setY):
(WebCore::SVGPathSegArc::r1 const):
(WebCore::SVGPathSegArc::setR1):
(WebCore::SVGPathSegArc::r2 const):
(WebCore::SVGPathSegArc::setR2):
(WebCore::SVGPathSegArc::angle const):
(WebCore::SVGPathSegArc::setAngle):
(WebCore::SVGPathSegArc::largeArcFlag const):
(WebCore::SVGPathSegArc::setLargeArcFlag):
(WebCore::SVGPathSegArc::sweepFlag const):
(WebCore::SVGPathSegArc::setSweepFlag):
* svg/SVGPathSegWithContext.h: Removed.

* svg/SVGPathUtilities.cpp:
(WebCore::buildSVGPathByteStreamFromSVGPathSegList):
(WebCore::buildSVGPathSegListFromByteStream):
(WebCore::buildStringFromByteStream):
(WebCore::buildSVGPathByteStreamFromSVGPathSegListValues): Deleted.
(WebCore::appendSVGPathByteStreamFromSVGPathSeg): Deleted.
(WebCore::buildSVGPathSegListValuesFromByteStream): Deleted.
(WebCore::buildStringFromSVGPathSegListValues): Deleted.
* svg/SVGPathUtilities.h:
Since the class SVGPathSegListValues is removed, all the parsing functions
have now to deal with SVGPathSegList directly.

* svg/SVGPoint.h:
* svg/SVGValue.h:
* svg/properties/SVGAnimatedPathSegListPropertyTearOff.cpp: Removed.
* svg/properties/SVGAnimatedPathSegListPropertyTearOff.h: Removed.
* svg/properties/SVGAnimatedPropertyAccessorImpl.h:
* svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
* svg/properties/SVGAnimatedPropertyImpl.h:
(WebCore::SVGAnimatedPathSegList::create):
(WebCore::SVGAnimatedPathSegList::currentPathByteStream):
(WebCore::SVGAnimatedPathSegList::currentPath):
(WebCore::SVGAnimatedPathSegList::approximateMemoryCost const):
Provides an easy way to access the current SVGPathByteStream and Path
objects from the SVGAnimatedPathSegList.

* svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
(WebCore::SVGAnimationPathSegListFunction::progress):
* svg/properties/SVGPropertyOwnerRegistry.h:
(WebCore::SVGPropertyOwnerRegistry::registerProperty):

LayoutTests:

* svg/dom/SVGPathSegList-appendItem-expected.txt:
* svg/dom/SVGPathSegList-appendItem.xhtml:
* svg/dom/SVGPathSegList-clear-and-initialize-expected.txt:
* svg/dom/SVGPathSegList-clear-and-initialize.xhtml:
* svg/dom/SVGPathSegList-insertItemBefore-expected.txt:
* svg/dom/SVGPathSegList-insertItemBefore.xhtml:
* svg/dom/SVGPathSegList-replaceItem-expected.txt:
* svg/dom/SVGPathSegList-replaceItem.xhtml:
These changes are required because SVGPathSegList will be following the SVG2
specs regarding adding new items to the list.

See https://www.w3.org/TR/SVG/types.html#TermListInterface.

Canonical link: https://commits.webkit.org/210603@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243555 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Said Abou-Hallawa authored and webkit-commit-queue committed Mar 27, 2019
1 parent eecaa27 commit 8a435d3
Show file tree
Hide file tree
Showing 70 changed files with 1,162 additions and 2,774 deletions.
20 changes: 20 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,23 @@
2019-03-27 Said Abou-Hallawa <sabouhallawa@apple.com>

Remove the SVG tear off objects for SVGPathSeg, SVGPathSegList and SVGAnimatedPathSegList
https://bugs.webkit.org/show_bug.cgi?id=196085

Reviewed by Simon Fraser.

* svg/dom/SVGPathSegList-appendItem-expected.txt:
* svg/dom/SVGPathSegList-appendItem.xhtml:
* svg/dom/SVGPathSegList-clear-and-initialize-expected.txt:
* svg/dom/SVGPathSegList-clear-and-initialize.xhtml:
* svg/dom/SVGPathSegList-insertItemBefore-expected.txt:
* svg/dom/SVGPathSegList-insertItemBefore.xhtml:
* svg/dom/SVGPathSegList-replaceItem-expected.txt:
* svg/dom/SVGPathSegList-replaceItem.xhtml:
These changes are required because SVGPathSegList will be following the SVG2
specs regarding adding new items to the list.

See https://www.w3.org/TR/SVG/types.html#TermListInterface.

2019-03-27 Shawn Roberts <sroberts@apple.com>

http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html is a flaky failure
Expand Down
2 changes: 2 additions & 0 deletions LayoutTests/svg/dom/SVGPathSegList-appendItem-expected.txt
Expand Up @@ -36,9 +36,11 @@ PASS path2.pathSegList.getItem(3).x = -path2.pathSegList.getItem(3).x is -100

Swap segment four and five of path2 - now should look like a rectangle
PASS path2.pathSegList.appendItem(path2.pathSegList.getItem(3)).toString() is "[object SVGPathSegLinetoHorizontalRel]"
PASS path2.pathSegList.removeItem(3).toString() is "[object SVGPathSegLinetoHorizontalRel]"

Append second item from path2 to path1 list
PASS path1.pathSegList.appendItem(path2.pathSegList.getItem(1)).toString() is "[object SVGPathSegLinetoAbs]"
PASS path2.pathSegList.removeItem(1).toString() is "[object SVGPathSegLinetoAbs]"

Change last item of path1 list, that came from path2 list, assure it's updating path1
PASS path1.pathSegList.getItem(3).x -= 50 is 0
Expand Down
2 changes: 2 additions & 0 deletions LayoutTests/svg/dom/SVGPathSegList-appendItem.xhtml
Expand Up @@ -57,10 +57,12 @@
debug("")
debug("Swap segment four and five of path2 - now should look like a rectangle");
shouldBeEqualToString("path2.pathSegList.appendItem(path2.pathSegList.getItem(3)).toString()", "[object SVGPathSegLinetoHorizontalRel]");
shouldBeEqualToString("path2.pathSegList.removeItem(3).toString()", "[object SVGPathSegLinetoHorizontalRel]");

debug("");
debug("Append second item from path2 to path1 list");
shouldBeEqualToString("path1.pathSegList.appendItem(path2.pathSegList.getItem(1)).toString()", "[object SVGPathSegLinetoAbs]");
shouldBeEqualToString("path2.pathSegList.removeItem(1).toString()", "[object SVGPathSegLinetoAbs]");

debug("");
debug("Change last item of path1 list, that came from path2 list, assure it's updating path1");
Expand Down
Expand Up @@ -59,6 +59,7 @@ PASS path2.pathSegList.getItem(2).y is 0

Initialize path1 list with first item of path2
PASS path1.pathSegList.initialize(path2.pathSegList.getItem(0)).toString() is "[object SVGPathSegMovetoAbs]"
PASS path2.pathSegList.removeItem(0).toString() is "[object SVGPathSegMovetoAbs]"

Check intermediate list state of path1
PASS path1.pathSegList.numberOfItems is 1
Expand Down
Expand Up @@ -85,6 +85,7 @@
debug("");
debug("Initialize path1 list with first item of path2");
shouldBeEqualToString("path1.pathSegList.initialize(path2.pathSegList.getItem(0)).toString()", "[object SVGPathSegMovetoAbs]");
shouldBeEqualToString("path2.pathSegList.removeItem(0).toString()", "[object SVGPathSegMovetoAbs]");

debug("");
debug("Check intermediate list state of path1");
Expand Down
Expand Up @@ -21,6 +21,7 @@ PASS path1.pathSegList.getItem(3).y is 100

Insert fourth item at position three using insertItemBefore()
PASS path1.pathSegList.insertItemBefore(path1.pathSegList.getItem(3), 2).toString() is "[object SVGPathSegLinetoAbs]"
PASS path1.pathSegList.removeItem(4).toString() is "[object SVGPathSegLinetoAbs]"

Check final 'pathSegList' value of path1
PASS path1.pathSegList.numberOfItems is 4
Expand Down
1 change: 1 addition & 0 deletions LayoutTests/svg/dom/SVGPathSegList-insertItemBefore.xhtml
Expand Up @@ -38,6 +38,7 @@
debug("");
debug("Insert fourth item at position three using insertItemBefore()");
shouldBeEqualToString("path1.pathSegList.insertItemBefore(path1.pathSegList.getItem(3), 2).toString()", "[object SVGPathSegLinetoAbs]");
shouldBeEqualToString("path1.pathSegList.removeItem(4).toString()", "[object SVGPathSegLinetoAbs]");

debug("");
debug("Check final 'pathSegList' value of path1");
Expand Down
2 changes: 2 additions & 0 deletions LayoutTests/svg/dom/SVGPathSegList-replaceItem-expected.txt
Expand Up @@ -39,9 +39,11 @@ PASS path2.pathSegList.getItem(3).x is -100

Replace second item with third item of path1
PASS path1.pathSegList.replaceItem(path1.pathSegList.getItem(2), 1).toString() is "[object SVGPathSegLinetoAbs]"
PASS path1.pathSegList.removeItem(2).toString() is "[object SVGPathSegLinetoAbs]"

Replace third item of path2 with fourth item of path1
PASS path2.pathSegList.replaceItem(path1.pathSegList.getItem(3), 2).toString() is "[object SVGPathSegLinetoVerticalRel]"
PASS path1.pathSegList.removeItem(3).toString() is "[object SVGPathSegLinetoVerticalRel]"

Check final 'pathSegList' value of path1
PASS path1.pathSegList.numberOfItems is 4
Expand Down
2 changes: 2 additions & 0 deletions LayoutTests/svg/dom/SVGPathSegList-replaceItem.xhtml
Expand Up @@ -59,10 +59,12 @@
debug("");
debug("Replace second item with third item of path1");
shouldBeEqualToString("path1.pathSegList.replaceItem(path1.pathSegList.getItem(2), 1).toString()", "[object SVGPathSegLinetoAbs]");
shouldBeEqualToString("path1.pathSegList.removeItem(2).toString()", "[object SVGPathSegLinetoAbs]");

debug("");
debug("Replace third item of path2 with fourth item of path1");
shouldBeEqualToString("path2.pathSegList.replaceItem(path1.pathSegList.getItem(3), 2).toString()", "[object SVGPathSegLinetoVerticalRel]");
shouldBeEqualToString("path1.pathSegList.removeItem(3).toString()", "[object SVGPathSegLinetoVerticalRel]");

debug("");
debug("Check final 'pathSegList' value of path1");
Expand Down
260 changes: 260 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,263 @@
2019-03-27 Said Abou-Hallawa <sabouhallawa@apple.com>

Remove the SVG tear off objects for SVGPathSeg, SVGPathSegList and SVGAnimatedPathSegList
https://bugs.webkit.org/show_bug.cgi?id=196085

Reviewed by Simon Fraser.

The SVGPathSegList is similar to the other SVGLists, e.g. SVGNUmberList
and SVGPointList except in two things:

1. Its items can be different but they are derived from the same base
class SVGPathSeg.

2. The SVGPathSeg items are only used for DOM. When drawing or animating
we have to have an SVGPathByteStream and convert it to a Path. Converting
an SVGPathByteStream to SVGPathSeg items and vice versa is expensive.
Building a Path from an SVGPathByteStream is also expensive. So an extra
care needs to be taken for when these conversions happen.

In addition to handling the SVGPathSeg items, SVGPathSegList will manage
the associated SVGPathByteStream and Path objects. SVGPathSegList will be
lazy in getting updated objects when a change happens. For example, when
the byte stream changes, SVGPathSegList will clear its items and nullify
the Path object. But it will not build any of them until they are explicitly
requested.

Like what was done for other SVG properties when removing their tear off
objects, a new accessor, a new animator and a new animation function will
be added for the SVGAnimatedPathSegList.

All the header files of the concrete classes of SVGPathSeg will be removed
because they are small structures which hold some data items and they provide
setters and getters for these items. Here is the new file structures and
their contents:

-- SVGPathSeg.h still has the class SVGPathSeg which is now a superclass
of SVGProperty.

-- SVGPathSegValue.h will have the template class SVGPathSegValue which
holds an std::tuple of packed arguments. It provides setters and getters
for these arguments. SVGPathSegValue.h will also have specialized
classed derived from SVGPathSegValue and hold different arguments.

-- SVGPathSegImpl.h will have the final concrete SVGPathSeg classes.

Note SVGPathSeg concrete classes do not need to have a reference to the
the context SVGPathElement. SVGPathSeg will be owned by its SVGPathSegList
which will be owned by the SVGAnimatedPathSegList which will be owned by
the SVGPathElement.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSSVGPathSegCustom.cpp:
* bindings/scripts/CodeGenerator.pm:
(IsSVGPathSegTypeName):
(IsSVGPathSegType):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
* rendering/svg/SVGPathData.cpp:
(WebCore::pathFromPathElement):
* svg/SVGAnimatedPath.cpp: Removed.
* svg/SVGAnimatedPath.h: Removed.
* svg/SVGAnimatedType.h:
(WebCore::SVGAnimatedType::type const):
* svg/SVGAnimatorFactory.h:
(WebCore::SVGAnimatorFactory::create):
* svg/SVGPathByteStream.h:
(WebCore::SVGPathByteStream::SVGPathByteStream):
This constructor is used by SVGAnimationPathSegListFunction to convert
the 'form', 'to' and 'toAtEndOfDuration' strings to SVGPathByteStreams.

(WebCore::SVGPathByteStream::resize): Deleted.
(WebCore::SVGPropertyTraits<SVGPathByteStream>::initialValue): Deleted.
(WebCore::SVGPropertyTraits<SVGPathByteStream>::fromString): Deleted.
(WebCore::SVGPropertyTraits<SVGPathByteStream>::parse): Deleted.
(WebCore::SVGPropertyTraits<SVGPathByteStream>::toString): Deleted.
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::SVGPathElement):
(WebCore::SVGPathElement::parseAttribute):
(WebCore::SVGPathElement::svgAttributeChanged):
(WebCore::SVGPathElement::getTotalLength const):
(WebCore::SVGPathElement::getPointAtLength const):
(WebCore::SVGPathElement::getPathSegAtLength const):
(WebCore::SVGPathElement::createSVGPathSegClosePath): Deleted.
(WebCore::SVGPathElement::createSVGPathSegMovetoAbs): Deleted.
(WebCore::SVGPathElement::createSVGPathSegMovetoRel): Deleted.
(WebCore::SVGPathElement::createSVGPathSegLinetoAbs): Deleted.
(WebCore::SVGPathElement::createSVGPathSegLinetoRel): Deleted.
(WebCore::SVGPathElement::createSVGPathSegCurvetoCubicAbs): Deleted.
(WebCore::SVGPathElement::createSVGPathSegCurvetoCubicRel): Deleted.
(WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticAbs): Deleted.
(WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticRel): Deleted.
(WebCore::SVGPathElement::createSVGPathSegArcAbs): Deleted.
(WebCore::SVGPathElement::createSVGPathSegArcRel): Deleted.
(WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalAbs): Deleted.
(WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalRel): Deleted.
(WebCore::SVGPathElement::createSVGPathSegLinetoVerticalAbs): Deleted.
(WebCore::SVGPathElement::createSVGPathSegLinetoVerticalRel): Deleted.
(WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs): Deleted.
(WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel): Deleted.
(WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs): Deleted.
(WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel): Deleted.
The SVGPathSeg creation functions are moved to the header file.

(WebCore::SVGPathElement::registerAttributes): Deleted.
(WebCore::SVGPathElement::pathByteStream const): Deleted.
(WebCore::SVGPathElement::pathForByteStream const): Deleted.
(WebCore::SVGPathElement::lookupOrCreateDWrapper): Deleted.
(WebCore::SVGPathElement::animatedPropertyWillBeDeleted): Deleted.
(WebCore::SVGPathElement::pathSegList): Deleted.
(WebCore::SVGPathElement::normalizedPathSegList): Deleted.
(WebCore::SVGPathElement::animatedPathSegList): Deleted.
(WebCore::SVGPathElement::animatedNormalizedPathSegList): Deleted.
(WebCore::SVGPathElement::approximateMemoryCost const): Deleted.
(WebCore::SVGPathElement::pathSegListChanged): Deleted.
Managing the SVGPathByteStream and the drawing Path objects will be the
responsibility of SVGPathSegList.

* svg/SVGPathElement.h:
* svg/SVGPathSeg.h:
* svg/SVGPathSegArc.h: Removed.
* svg/SVGPathSegArcAbs.h: Removed.
* svg/SVGPathSegArcRel.h: Removed.
* svg/SVGPathSegClosePath.h: Removed.
* svg/SVGPathSegCurvetoCubic.h: Removed.
* svg/SVGPathSegCurvetoCubicAbs.h: Removed.
* svg/SVGPathSegCurvetoCubicRel.h: Removed.
* svg/SVGPathSegCurvetoCubicSmooth.h: Removed.
* svg/SVGPathSegCurvetoCubicSmoothAbs.h: Removed.
* svg/SVGPathSegCurvetoCubicSmoothRel.h: Removed.
* svg/SVGPathSegCurvetoQuadratic.h: Removed.
* svg/SVGPathSegCurvetoQuadraticAbs.h: Removed.
* svg/SVGPathSegCurvetoQuadraticRel.h: Removed.
* svg/SVGPathSegCurvetoQuadraticSmoothAbs.h: Removed.
* svg/SVGPathSegCurvetoQuadraticSmoothRel.h: Removed.
* svg/SVGPathSegImpl.h: Added.
* svg/SVGPathSegLinetoAbs.h: Removed.
* svg/SVGPathSegLinetoHorizontal.h: Removed.
* svg/SVGPathSegLinetoHorizontalAbs.h: Removed.
* svg/SVGPathSegLinetoHorizontalRel.h: Removed.
* svg/SVGPathSegLinetoRel.h: Removed.
* svg/SVGPathSegLinetoVertical.h: Removed.
* svg/SVGPathSegLinetoVerticalAbs.h: Removed.
* svg/SVGPathSegLinetoVerticalRel.h: Removed.
The definition of these classes are now in SVGPathSegImpl.h.

* svg/SVGPathSegList.cpp: Removed.
* svg/SVGPathSegList.h:
* svg/SVGPathSegListBuilder.cpp:
(WebCore::SVGPathSegListBuilder::SVGPathSegListBuilder):
(WebCore::SVGPathSegListBuilder::moveTo):
(WebCore::SVGPathSegListBuilder::lineTo):
(WebCore::SVGPathSegListBuilder::lineToHorizontal):
(WebCore::SVGPathSegListBuilder::lineToVertical):
(WebCore::SVGPathSegListBuilder::curveToCubic):
(WebCore::SVGPathSegListBuilder::curveToCubicSmooth):
(WebCore::SVGPathSegListBuilder::curveToQuadratic):
(WebCore::SVGPathSegListBuilder::curveToQuadraticSmooth):
(WebCore::SVGPathSegListBuilder::arcTo):
(WebCore::SVGPathSegListBuilder::closePath):
* svg/SVGPathSegListBuilder.h:
The concrete SVGPathSeg classes can now create instances of their classes
without having to go through the SVGPathElement.

* svg/SVGPathSegListSource.cpp:
(WebCore::SVGPathSegListSource::SVGPathSegListSource):
* svg/SVGPathSegListSource.h:
* svg/SVGPathSegListValues.cpp: Removed.
* svg/SVGPathSegListValues.h: Removed.
* svg/SVGPathSegMovetoAbs.h: Removed.
* svg/SVGPathSegMovetoRel.h: Removed.
* svg/SVGPathSegValue.h: Added.
(WebCore::SVGPathSegValue::create):
(WebCore::SVGPathSegValue::clone const):
(WebCore::SVGPathSegValue::SVGPathSegValue):
(WebCore::SVGPathSegValue::argument const):
(WebCore::SVGPathSegValue::setArgument):
(WebCore::SVGPathSegLinetoHorizontal::x const):
(WebCore::SVGPathSegLinetoHorizontal::setX):
(WebCore::SVGPathSegLinetoVertical::y const):
(WebCore::SVGPathSegLinetoVertical::setY):
(WebCore::SVGPathSegSingleCoordinate::x const):
(WebCore::SVGPathSegSingleCoordinate::setX):
(WebCore::SVGPathSegSingleCoordinate::y const):
(WebCore::SVGPathSegSingleCoordinate::setY):
(WebCore::SVGPathSegCurvetoQuadratic::x const):
(WebCore::SVGPathSegCurvetoQuadratic::setX):
(WebCore::SVGPathSegCurvetoQuadratic::y const):
(WebCore::SVGPathSegCurvetoQuadratic::setY):
(WebCore::SVGPathSegCurvetoQuadratic::x1 const):
(WebCore::SVGPathSegCurvetoQuadratic::setX1):
(WebCore::SVGPathSegCurvetoQuadratic::y1 const):
(WebCore::SVGPathSegCurvetoQuadratic::setY1):
(WebCore::SVGPathSegCurvetoCubicSmooth::x const):
(WebCore::SVGPathSegCurvetoCubicSmooth::setX):
(WebCore::SVGPathSegCurvetoCubicSmooth::y const):
(WebCore::SVGPathSegCurvetoCubicSmooth::setY):
(WebCore::SVGPathSegCurvetoCubicSmooth::x2 const):
(WebCore::SVGPathSegCurvetoCubicSmooth::setX2):
(WebCore::SVGPathSegCurvetoCubicSmooth::y2 const):
(WebCore::SVGPathSegCurvetoCubicSmooth::setY2):
(WebCore::SVGPathSegCurvetoCubic::x const):
(WebCore::SVGPathSegCurvetoCubic::setX):
(WebCore::SVGPathSegCurvetoCubic::y const):
(WebCore::SVGPathSegCurvetoCubic::setY):
(WebCore::SVGPathSegCurvetoCubic::x1 const):
(WebCore::SVGPathSegCurvetoCubic::setX1):
(WebCore::SVGPathSegCurvetoCubic::y1 const):
(WebCore::SVGPathSegCurvetoCubic::setY1):
(WebCore::SVGPathSegCurvetoCubic::x2 const):
(WebCore::SVGPathSegCurvetoCubic::setX2):
(WebCore::SVGPathSegCurvetoCubic::y2 const):
(WebCore::SVGPathSegCurvetoCubic::setY2):
(WebCore::SVGPathSegArc::x const):
(WebCore::SVGPathSegArc::setX):
(WebCore::SVGPathSegArc::y const):
(WebCore::SVGPathSegArc::setY):
(WebCore::SVGPathSegArc::r1 const):
(WebCore::SVGPathSegArc::setR1):
(WebCore::SVGPathSegArc::r2 const):
(WebCore::SVGPathSegArc::setR2):
(WebCore::SVGPathSegArc::angle const):
(WebCore::SVGPathSegArc::setAngle):
(WebCore::SVGPathSegArc::largeArcFlag const):
(WebCore::SVGPathSegArc::setLargeArcFlag):
(WebCore::SVGPathSegArc::sweepFlag const):
(WebCore::SVGPathSegArc::setSweepFlag):
* svg/SVGPathSegWithContext.h: Removed.

* svg/SVGPathUtilities.cpp:
(WebCore::buildSVGPathByteStreamFromSVGPathSegList):
(WebCore::buildSVGPathSegListFromByteStream):
(WebCore::buildStringFromByteStream):
(WebCore::buildSVGPathByteStreamFromSVGPathSegListValues): Deleted.
(WebCore::appendSVGPathByteStreamFromSVGPathSeg): Deleted.
(WebCore::buildSVGPathSegListValuesFromByteStream): Deleted.
(WebCore::buildStringFromSVGPathSegListValues): Deleted.
* svg/SVGPathUtilities.h:
Since the class SVGPathSegListValues is removed, all the parsing functions
have now to deal with SVGPathSegList directly.

* svg/SVGPoint.h:
* svg/SVGValue.h:
* svg/properties/SVGAnimatedPathSegListPropertyTearOff.cpp: Removed.
* svg/properties/SVGAnimatedPathSegListPropertyTearOff.h: Removed.
* svg/properties/SVGAnimatedPropertyAccessorImpl.h:
* svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
* svg/properties/SVGAnimatedPropertyImpl.h:
(WebCore::SVGAnimatedPathSegList::create):
(WebCore::SVGAnimatedPathSegList::currentPathByteStream):
(WebCore::SVGAnimatedPathSegList::currentPath):
(WebCore::SVGAnimatedPathSegList::approximateMemoryCost const):
Provides an easy way to access the current SVGPathByteStream and Path
objects from the SVGAnimatedPathSegList.

* svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
(WebCore::SVGAnimationPathSegListFunction::progress):
* svg/properties/SVGPropertyOwnerRegistry.h:
(WebCore::SVGPropertyOwnerRegistry::registerProperty):

2019-03-27 Ryan Haddad <ryanhaddad@apple.com>

AVAudioSessionRouteSharingPolicyLongForm has been deprecated
Expand Down

0 comments on commit 8a435d3

Please sign in to comment.