WebKit Bugzilla
Attachment 356497 Details for
Bug 191237
: Remove SVG properties tear-off objects
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
5-SVGPathSegList
5-SVGPathSegList.patch (text/plain), 42.74 KB, created by
Said Abou-Hallawa
on 2018-12-04 07:56:12 PST
(
hide
)
Description:
5-SVGPathSegList
Filename:
MIME Type:
Creator:
Said Abou-Hallawa
Created:
2018-12-04 07:56:12 PST
Size:
42.74 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 81490bde668..470ac168cc7 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,60 @@ >+2018-12-03 Said Abou-Hallawa <sabouhallawa@apple.com> >+ >+ Remove SVG properties tear-off objects >+ https://bugs.webkit.org/show_bug.cgi?id=191237 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ SVGPathSegList should be an SVGPropertyList<SVGPathSeg> but it has to >+ maintain also SVGPathByteStream. Since converting from and to >+ SVGPathByteStream is expensive, SVGPathSegList will be lazy with updating >+ the SVGPathSeg items when SVGPathByteStream changes and with updating the >+ SVGPathByteStream when SVGPathSeg items change. >+ >+ The DOM interface methods will be wrappers of the SVGPropertyList. These >+ methods will ensure the existence of SVGPathSeg items and SVGPathByteStream >+ when they are needed and they also clear them when they have to be updated. >+ >+ SVGPathSegListBuilder does not need SVGPathElement to create the SVGPathSeg >+ items. The items should be able to create themselves, see SVGPathSegImpl.h >+ >+ Get rid of SVGPathSegRole since it was never used. >+ >+ SVGPathSegListSource, SVGPathSegListBuilder and SVGPathUtilities functions >+ should deal with SVGPathSegList directly instead of dealing with >+ SVGPathSegListValues. >+ >+ * WebCore.xcodeproj/project.pbxproj: >+ * 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: >+ * svg/SVGPathSegListSource.cpp: >+ (WebCore::SVGPathSegListSource::SVGPathSegListSource): >+ * svg/SVGPathSegListSource.h: >+ * svg/SVGPathSegListValues.cpp: Removed. >+ * svg/SVGPathSegListValues.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: >+ > 2018-12-03 Said Abou-Hallawa <sabouhallawa@apple.com> > > Remove SVG properties tear-off objects >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index abf3a36e1e3..3e3662eb512 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -9544,9 +9544,6 @@ > 7C330A051DF9F95100D3395C /* JSPositionOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPositionOptions.cpp; sourceTree = "<group>"; }; > 7C330A061DF9F95100D3395C /* JSPositionOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPositionOptions.h; sourceTree = "<group>"; }; > 7C33F3601B4A050400502CAF /* JSDocumentFragmentCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDocumentFragmentCustom.cpp; sourceTree = "<group>"; }; >- 7C39C36E1DDBA3E000FEFB29 /* SVGPathSegListValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathSegListValues.cpp; sourceTree = "<group>"; }; >- 7C39C36F1DDBA3E000FEFB29 /* SVGPathSegListValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegListValues.h; sourceTree = "<group>"; }; >- 7C39C3701DDBA44000FEFB29 /* SVGPathSegList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathSegList.cpp; sourceTree = "<group>"; }; > 7C3A91E51C963B8800D1A7E3 /* ClipboardAccessPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClipboardAccessPolicy.h; sourceTree = "<group>"; }; > 7C3B796F1908757B00B47A2D /* UserMessageHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserMessageHandler.cpp; sourceTree = "<group>"; }; > 7C3B79701908757B00B47A2D /* UserMessageHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserMessageHandler.h; sourceTree = "<group>"; }; >@@ -23731,15 +23728,12 @@ > B22278E50D00BF200071B782 /* SVGPathSegLinetoRel.idl */, > B22278E80D00BF200071B782 /* SVGPathSegLinetoVerticalAbs.idl */, > B22278E90D00BF200071B782 /* SVGPathSegLinetoVerticalRel.idl */, >- 7C39C3701DDBA44000FEFB29 /* SVGPathSegList.cpp */, > B22278EB0D00BF200071B782 /* SVGPathSegList.h */, > B22278EC0D00BF210071B782 /* SVGPathSegList.idl */, > 8476C9E311DF6A0B00555B02 /* SVGPathSegListBuilder.cpp */, > 8476C9E411DF6A0B00555B02 /* SVGPathSegListBuilder.h */, > 84B6B975120F13E500B8EFAF /* SVGPathSegListSource.cpp */, > 84B6B976120F13E500B8EFAF /* SVGPathSegListSource.h */, >- 7C39C36E1DDBA3E000FEFB29 /* SVGPathSegListValues.cpp */, >- 7C39C36F1DDBA3E000FEFB29 /* SVGPathSegListValues.h */, > 83C1D423178D5AB400141E68 /* SVGPathSegMovetoAbs.h */, > B22278EF0D00BF210071B782 /* SVGPathSegMovetoAbs.idl */, > 83C1D424178D5AB400141E68 /* SVGPathSegMovetoRel.h */, >diff --git a/Source/WebCore/svg/SVGPathSegList.cpp b/Source/WebCore/svg/SVGPathSegList.cpp >deleted file mode 100644 >index 6a0ce90eaed..00000000000 >--- a/Source/WebCore/svg/SVGPathSegList.cpp >+++ /dev/null >@@ -1,110 +0,0 @@ >-/* >- * Copyright (C) Research In Motion Limited 2010. All rights reserved. >- * Copyright (C) 2018 Apple Inc. All rights reserved. >- * >- * This library is free software; you can redistribute it and/or >- * modify it under the terms of the GNU Library General Public >- * License as published by the Free Software Foundation; either >- * version 2 of the License, or (at your option) any later version. >- * >- * This library is distributed in the hope that it will be useful, >- * but WITHOUT ANY WARRANTY; without even the implied warranty of >- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >- * Library General Public License for more details. >- * >- * You should have received a copy of the GNU Library General Public License >- * along with this library; see the file COPYING.LIB. If not, write to >- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >- * Boston, MA 02110-1301, USA. >- */ >- >-#include "config.h" >-#include "SVGPathSegList.h" >- >-#include "SVGAnimatedPathSegListPropertyTearOff.h" >-#include "SVGPathElement.h" >-#include "SVGPathSegWithContext.h" >- >-namespace WebCore { >- >-ExceptionOr<void> SVGPathSegList::clear() >-{ >- ASSERT(m_values); >- if (m_values->isEmpty()) >- return { }; >- return Base::clearValues(); >-} >- >-ExceptionOr<RefPtr<SVGPathSeg>> SVGPathSegList::getItem(unsigned index) >-{ >- return Base::getItemValues(index); >-} >- >-ExceptionOr<RefPtr<SVGPathSeg>> SVGPathSegList::replaceItem(Ref<SVGPathSeg>&& newItem, unsigned index) >-{ >- if (index < m_values->size()) >- m_values->clearItemContextAndRole(index); >- return Base::replaceItemValues(WTFMove(newItem), index); >-} >- >-ExceptionOr<RefPtr<SVGPathSeg>> SVGPathSegList::removeItem(unsigned index) >-{ >- if (index < m_values->size()) >- m_values->clearItemContextAndRole(index); >- auto result = Base::removeItemValues(index); >- if (result.hasException()) >- return result; >- return result.releaseReturnValue(); >-} >- >-SVGPathElement* SVGPathSegList::contextElement() const >-{ >- SVGElement* contextElement = m_animatedProperty->contextElement(); >- ASSERT(contextElement); >- return downcast<SVGPathElement>(contextElement); >-} >- >-bool SVGPathSegList::processIncomingListItemValue(const ListItemType& newItem, unsigned* indexToModify) >-{ >- SVGPathSegWithContext* newItemWithContext = static_cast<SVGPathSegWithContext*>(newItem.get()); >- RefPtr<SVGAnimatedProperty> animatedPropertyOfItem = newItemWithContext->animatedProperty(); >- >- // Alter the role, after calling animatedProperty(), as that may influence the returned animated property. >- newItemWithContext->setContextAndRole(contextElement(), m_pathSegRole); >- >- if (!animatedPropertyOfItem) >- return true; >- >- // newItem belongs to a SVGPathElement, but its associated SVGAnimatedProperty is not an animated list tear off. >- // (for example: "pathElement.pathSegList.appendItem(pathElement.createSVGPathSegClosepath())") >- if (!animatedPropertyOfItem->isAnimatedListTearOff()) >- return true; >- >- // Spec: If newItem is already in a list, it is removed from its previous list before it is inserted into this list. >- // 'newItem' is already living in another list. If it's not our list, synchronize the other lists wrappers after the removal. >- bool livesInOtherList = animatedPropertyOfItem != m_animatedProperty; >- RefPtr<SVGAnimatedPathSegListPropertyTearOff> propertyTearOff = static_pointer_cast<SVGAnimatedPathSegListPropertyTearOff>(animatedPropertyOfItem); >- int indexToRemove = propertyTearOff->findItem(newItem.get()); >- ASSERT(indexToRemove != -1); >- >- // Do not remove newItem if already in this list at the target index. >- if (!livesInOtherList && indexToModify && static_cast<unsigned>(indexToRemove) == *indexToModify) >- return false; >- >- propertyTearOff->removeItemFromList(indexToRemove, livesInOtherList); >- >- if (!indexToModify) >- return true; >- >- // If the item lived in our list, adjust the insertion index. >- if (!livesInOtherList) { >- unsigned& index = *indexToModify; >- // Spec: If the item is already in this list, note that the index of the item to (replace|insert before) is before the removal of the item. >- if (static_cast<unsigned>(indexToRemove) < index) >- --index; >- } >- >- return true; >-} >- >-} >diff --git a/Source/WebCore/svg/SVGPathSegList.h b/Source/WebCore/svg/SVGPathSegList.h >index a29d01c6209..6291c46c3ec 100644 >--- a/Source/WebCore/svg/SVGPathSegList.h >+++ b/Source/WebCore/svg/SVGPathSegList.h >@@ -20,120 +20,202 @@ > > #pragma once > >-#include "SVGAnimatedListPropertyTearOff.h" >-#include "SVGPathSegListValues.h" >+#include "Path.h" >+#include "SVGPathByteStream.h" >+#include "SVGPathSeg.h" >+#include "SVGPropertyList.h" > > namespace WebCore { > > class SVGPathElement; > >-class SVGPathSegList final : public SVGListProperty<SVGPathSegListValues> { >+class SVGPathSegList final : public SVGPropertyList<SVGPathSeg> { >+ friend class SVGAnimatedPathSegListAnimator; >+ friend class SVGPathSegListBuilder; >+ friend class SVGPathSegListSource; >+ >+ using Base = SVGPropertyList<SVGPathSeg>; >+ using Base::Base; >+ > public: >- using Base = SVGListProperty<SVGPathSegListValues>; >- using AnimatedListPropertyTearOff = SVGAnimatedListPropertyTearOff<SVGPathSegListValues>; >- using ListItemType = SVGPropertyTraits<SVGPathSegListValues>::ListItemType; >+ static Ref<SVGPathSegList> create(SVGPropertyOwner* owner, SVGPropertyAccess access) >+ { >+ return adoptRef(*new SVGPathSegList(owner, access)); >+ } > >- static Ref<SVGPathSegList> create(AnimatedListPropertyTearOff& animatedProperty, SVGPropertyRole role, SVGPathSegRole pathSegRole, SVGPathSegListValues& values, ListWrapperCache& wrappers) >+ static Ref<SVGPathSegList> create(const SVGPathSegList& other, SVGPropertyAccess access) > { >- return adoptRef(*new SVGPathSegList(animatedProperty, role, pathSegRole, values, wrappers)); >+ return adoptRef(*new SVGPathSegList(other, access)); > } > >- static Ref<SVGPathSegList> create(AnimatedListPropertyTearOff& animatedProperty, SVGPropertyRole role, SVGPathSegListValues& values, ListWrapperCache& wrappers) >+ static Ref<SVGPathSegList> create(Ref<SVGPathSeg>&& newItem) > { >- ASSERT_NOT_REACHED(); >- return adoptRef(*new SVGPathSegList(animatedProperty, role, PathSegUndefinedRole, values, wrappers)); >+ return adoptRef(*new SVGPathSegList(WTFMove(newItem))); > } > >- int findItem(const ListItemType& item) const >+ SVGPathSegList& operator=(const SVGPathSegList& other) > { >- ASSERT(m_values); >+ pathByteStreamWillChange(); >+ m_pathByteStream = other.pathByteStream(); >+ return *this; >+ } > >- unsigned size = m_values->size(); >- for (size_t i = 0; i < size; ++i) { >- if (item == m_values->at(i)) >- return i; >- } >+ unsigned numberOfItems() const >+ { >+ const_cast<SVGPathSegList*>(this)->ensureItems(); >+ return Base::numberOfItems(); >+ } >+ >+ ExceptionOr<void> clear() >+ { >+ itemsWillChange(); >+ return Base::clear(); >+ } > >- return -1; >+ ExceptionOr<Ref<SVGPathSeg>> getItem(unsigned index) >+ { >+ ensureItems(); >+ return Base::getItem(index); > } > >- void removeItemFromList(size_t itemIndex, bool shouldSynchronizeWrappers) >+ ExceptionOr<Ref<SVGPathSeg>> initialize(Ref<SVGPathSeg>&& newItem) > { >- ASSERT(m_values); >- ASSERT_WITH_SECURITY_IMPLICATION(itemIndex < m_values->size()); >+ itemsWillChange(); >+ return Base::initialize(WTFMove(newItem)); >+ } > >- m_values->remove(itemIndex); >+ ExceptionOr<Ref<SVGPathSeg>> insertItemBefore(Ref<SVGPathSeg>&& newItem, unsigned index) >+ { >+ ensureItems(); >+ itemsWillChange(); >+ return Base::insertItemBefore(WTFMove(newItem), index); >+ } > >- if (shouldSynchronizeWrappers) >- commitChange(); >+ ExceptionOr<Ref<SVGPathSeg>> replaceItem(Ref<SVGPathSeg>&& newItem, unsigned index) >+ { >+ ensureItems(); >+ itemsWillChange(); >+ return Base::replaceItem(WTFMove(newItem), index); > } > >- // SVGList API >- ExceptionOr<void> clear(); >+ ExceptionOr<Ref<SVGPathSeg>> removeItem(unsigned index) >+ { >+ ensureItems(); >+ itemsWillChange(); >+ return Base::removeItem(index); >+ } > >- ExceptionOr<RefPtr<SVGPathSeg>> initialize(Ref<SVGPathSeg>&& newItem) >+ ExceptionOr<Ref<SVGPathSeg>> appendItem(Ref<SVGPathSeg>&& newItem) > { >- return Base::initializeValues(WTFMove(newItem)); >+ ensureItems(); >+ appendPathSegToPathByteStream(newItem); >+ clearPath(); >+ return Base::appendItem(WTFMove(newItem)); > } > >- ExceptionOr<RefPtr<SVGPathSeg>> getItem(unsigned index); >+ const SVGPathByteStream& pathByteStream() const { return const_cast<SVGPathSegList*>(this)->pathByteStream(); } >+ SVGPathByteStream& pathByteStream() >+ { >+ ensurePathByteStream(); >+ return m_pathByteStream; >+ } > >- ExceptionOr<RefPtr<SVGPathSeg>> insertItemBefore(Ref<SVGPathSeg>&& newItem, unsigned index) >+ bool parse(const String& value) > { >- return Base::insertItemBeforeValues(WTFMove(newItem), index); >+ pathByteStreamWillChange(); >+ return buildSVGPathByteStreamFromString(value, m_pathByteStream, UnalteredParsing); > } > >- ExceptionOr<RefPtr<SVGPathSeg>> replaceItem(Ref<SVGPathSeg>&&, unsigned index); >+ Path path() const >+ { >+ if (!m_path) >+ m_path = buildPathFromByteStream(pathByteStream()); >+ return *m_path; >+ } > >- ExceptionOr<RefPtr<SVGPathSeg>> removeItem(unsigned index); >+ size_t approximateMemoryCost() const >+ { >+ // This is an approximation for path memory cost since the path is parsed on demand. >+ size_t pathMemoryCost = (m_pathByteStream.size() / 10) * sizeof(FloatPoint); >+ // We need to account for the memory which is allocated by the m_path. >+ return m_path ? pathMemoryCost + sizeof(*m_path) : pathMemoryCost; >+ } > >- ExceptionOr<RefPtr<SVGPathSeg>> appendItem(Ref<SVGPathSeg>&& newItem) >+ String valueAsString() const override > { >- return Base::appendItemValues(WTFMove(newItem)); >+ String value; >+ buildStringFromByteStream(pathByteStream(), value, UnalteredParsing); >+ return value; > } > > private: >- SVGPathSegList(AnimatedListPropertyTearOff& animatedProperty, SVGPropertyRole role, SVGPathSegRole pathSegRole, SVGPathSegListValues& values, ListWrapperCache& wrappers) >- : SVGListProperty<SVGPathSegListValues>(role, values, &wrappers) >- , m_animatedProperty(&animatedProperty) >- , m_pathSegRole(pathSegRole) >+ SVGPathSegList(const SVGPathSegList& other, SVGPropertyAccess access) >+ : Base(other.owner(), access) >+ , m_pathByteStream(other.pathByteStream()) >+ { >+ } >+ >+ // Used by appendPathSegToPathByteStream() to create a temporary SVGPathSegList with one item. >+ SVGPathSegList(Ref<SVGPathSeg>&& newItem) >+ { >+ append(WTFMove(newItem)); >+ } >+ >+ // Called when changing an item in the list. >+ void commitPropertyChange(SVGProperty* property) override > { >+ itemsWillChange(); >+ Base::commitPropertyChange(property); > } > >- SVGPathElement* contextElement() const; >- using Base::m_role; >+ void ensureItems() >+ { >+ if (!m_items.isEmpty() || m_pathByteStream.isEmpty()) >+ return; >+ buildSVGPathSegListFromByteStream(m_pathByteStream, *this, UnalteredParsing); >+ } > >- bool isReadOnly() const final >+ void ensurePathByteStream() > { >- if (m_role == AnimValRole) >- return true; >- if (m_animatedProperty && m_animatedProperty->isReadOnly()) >- return true; >- return false; >+ if (!m_pathByteStream.isEmpty() || m_items.isEmpty()) >+ return; >+ buildSVGPathByteStreamFromSVGPathSegList(*this, m_pathByteStream, UnalteredParsing); > } > >- void commitChange() final >+ // Optimize appending an SVGPathSeg to the list. Instead of creating the whole >+ // byte stream, a temporary byte stream will be creating just for the new item >+ // and this temporary byte stream will be appended to m_pathByteStream. >+ void appendPathSegToPathByteStream(const Ref<SVGPathSeg>& item) > { >- ASSERT(m_values); >- m_values->commitChange(*m_animatedProperty->contextElement(), ListModificationUnknown); >+ if (m_pathByteStream.isEmpty()) >+ return; >+ >+ Ref<SVGPathSegList> pathSegList = SVGPathSegList::create(item.copyRef()); >+ SVGPathByteStream pathSegStream; >+ >+ if (!buildSVGPathByteStreamFromSVGPathSegList(pathSegList, pathSegStream, UnalteredParsing, false)) >+ return; >+ >+ m_pathByteStream.append(pathSegStream); > } > >- void commitChange(ListModification listModification) final >+ void clearPathByteStream() { m_pathByteStream.clear(); } >+ void clearPath() { m_path = std::nullopt; } >+ >+ void pathByteStreamWillChange() > { >- ASSERT(m_values); >- m_values->commitChange(*m_animatedProperty->contextElement(), listModification); >+ clearItems(); >+ clearPath(); > } > >- bool processIncomingListItemValue(const ListItemType& newItem, unsigned* indexToModify) final; >- bool processIncomingListItemWrapper(Ref<ListItemTearOff>&, unsigned*) final >+ void itemsWillChange() > { >- ASSERT_NOT_REACHED(); >- return true; >+ clearPathByteStream(); >+ clearPath(); > } > >-private: >- RefPtr<AnimatedListPropertyTearOff> m_animatedProperty; >- SVGPathSegRole m_pathSegRole; >+ SVGPathByteStream m_pathByteStream; >+ mutable std::optional<Path> m_path; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegListBuilder.cpp b/Source/WebCore/svg/SVGPathSegListBuilder.cpp >index 1558f808a4e..b8b1e47d0ef 100644 >--- a/Source/WebCore/svg/SVGPathSegListBuilder.cpp >+++ b/Source/WebCore/svg/SVGPathSegListBuilder.cpp >@@ -4,6 +4,7 @@ > * Copyright (C) 2006, 2007 Rob Buis <buis@kde.org> > * Copyright (C) 2007, 2009, 2015 Apple Inc. All rights reserved. > * Copyright (C) Research In Motion Limited 2010. All rights reserved. >+ * Copyright (C) 2018 Apple Inc. All rights reserved. > * > * This library is free software; you can redistribute it and/or > * modify it under the terms of the GNU Library General Public >@@ -24,112 +25,91 @@ > #include "config.h" > #include "SVGPathSegListBuilder.h" > >-#include "SVGPathElement.h" >-#include "SVGPathSegArcAbs.h" >-#include "SVGPathSegArcRel.h" >-#include "SVGPathSegClosePath.h" >-#include "SVGPathSegCurvetoCubicAbs.h" >-#include "SVGPathSegCurvetoCubicRel.h" >-#include "SVGPathSegCurvetoCubicSmoothAbs.h" >-#include "SVGPathSegCurvetoCubicSmoothRel.h" >-#include "SVGPathSegCurvetoQuadraticAbs.h" >-#include "SVGPathSegCurvetoQuadraticRel.h" >-#include "SVGPathSegCurvetoQuadraticSmoothAbs.h" >-#include "SVGPathSegCurvetoQuadraticSmoothRel.h" >-#include "SVGPathSegLinetoAbs.h" >-#include "SVGPathSegLinetoHorizontalAbs.h" >-#include "SVGPathSegLinetoHorizontalRel.h" >-#include "SVGPathSegLinetoRel.h" >-#include "SVGPathSegLinetoVerticalAbs.h" >-#include "SVGPathSegLinetoVerticalRel.h" >-#include "SVGPathSegListValues.h" >-#include "SVGPathSegMovetoAbs.h" >-#include "SVGPathSegMovetoRel.h" >+#include "SVGPathSegImpl.h" >+#include "SVGPathSegList.h" > > namespace WebCore { > >-SVGPathSegListBuilder::SVGPathSegListBuilder(SVGPathElement& pathElement, SVGPathSegListValues& pathSegList, SVGPathSegRole role) >- : m_pathElement(pathElement) >- , m_pathSegList(pathSegList) >- , m_pathSegRole(role) >+SVGPathSegListBuilder::SVGPathSegListBuilder(SVGPathSegList& pathSegList) >+ : m_pathSegList(pathSegList) > { > } > >-void SVGPathSegListBuilder::moveTo(const FloatPoint& targetPoint, bool, PathCoordinateMode mode) >+void SVGPathSegListBuilder::moveTo(const FloatPoint& point, bool, PathCoordinateMode mode) > { > if (mode == AbsoluteCoordinates) >- m_pathSegList.append(m_pathElement.createSVGPathSegMovetoAbs(targetPoint.x(), targetPoint.y(), m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegMovetoAbs::create(point.x(), point.y())); > else >- m_pathSegList.append(m_pathElement.createSVGPathSegMovetoRel(targetPoint.x(), targetPoint.y(), m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegMovetoRel::create(point.x(), point.y())); > } > >-void SVGPathSegListBuilder::lineTo(const FloatPoint& targetPoint, PathCoordinateMode mode) >+void SVGPathSegListBuilder::lineTo(const FloatPoint& point, PathCoordinateMode mode) > { > if (mode == AbsoluteCoordinates) >- m_pathSegList.append(m_pathElement.createSVGPathSegLinetoAbs(targetPoint.x(), targetPoint.y(), m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegLinetoAbs::create(point.x(), point.y())); > else >- m_pathSegList.append(m_pathElement.createSVGPathSegLinetoRel(targetPoint.x(), targetPoint.y(), m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegLinetoRel::create(point.x(), point.y())); > } > > void SVGPathSegListBuilder::lineToHorizontal(float x, PathCoordinateMode mode) > { > if (mode == AbsoluteCoordinates) >- m_pathSegList.append(m_pathElement.createSVGPathSegLinetoHorizontalAbs(x, m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegLinetoHorizontalAbs::create(x)); > else >- m_pathSegList.append(m_pathElement.createSVGPathSegLinetoHorizontalRel(x, m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegLinetoHorizontalRel::create(x)); > } > > void SVGPathSegListBuilder::lineToVertical(float y, PathCoordinateMode mode) > { > if (mode == AbsoluteCoordinates) >- m_pathSegList.append(m_pathElement.createSVGPathSegLinetoVerticalAbs(y, m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegLinetoVerticalAbs::create(y)); > else >- m_pathSegList.append(m_pathElement.createSVGPathSegLinetoVerticalRel(y, m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegLinetoVerticalRel::create(y)); > } > >-void SVGPathSegListBuilder::curveToCubic(const FloatPoint& point1, const FloatPoint& point2, const FloatPoint& targetPoint, PathCoordinateMode mode) >+void SVGPathSegListBuilder::curveToCubic(const FloatPoint& point1, const FloatPoint& point2, const FloatPoint& point, PathCoordinateMode mode) > { > if (mode == AbsoluteCoordinates) >- m_pathSegList.append(m_pathElement.createSVGPathSegCurvetoCubicAbs(targetPoint.x(), targetPoint.y(), point1.x(), point1.y(), point2.x(), point2.y(), m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegCurvetoCubicAbs::create(point.x(), point.y(), point1.x(), point1.y(), point2.x(), point2.y())); > else >- m_pathSegList.append(m_pathElement.createSVGPathSegCurvetoCubicRel(targetPoint.x(), targetPoint.y(), point1.x(), point1.y(), point2.x(), point2.y(), m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegCurvetoCubicRel::create(point.x(), point.y(), point1.x(), point1.y(), point2.x(), point2.y())); > } > >-void SVGPathSegListBuilder::curveToCubicSmooth(const FloatPoint& point2, const FloatPoint& targetPoint, PathCoordinateMode mode) >+void SVGPathSegListBuilder::curveToCubicSmooth(const FloatPoint& point2, const FloatPoint& point, PathCoordinateMode mode) > { > if (mode == AbsoluteCoordinates) >- m_pathSegList.append(m_pathElement.createSVGPathSegCurvetoCubicSmoothAbs(targetPoint.x(), targetPoint.y(), point2.x(), point2.y(), m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegCurvetoCubicSmoothAbs::create(point.x(), point.y(), point2.x(), point2.y())); > else >- m_pathSegList.append(m_pathElement.createSVGPathSegCurvetoCubicSmoothRel(targetPoint.x(), targetPoint.y(), point2.x(), point2.y(), m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegCurvetoCubicSmoothRel::create(point.x(), point.y(), point2.x(), point2.y())); > } > >-void SVGPathSegListBuilder::curveToQuadratic(const FloatPoint& point1, const FloatPoint& targetPoint, PathCoordinateMode mode) >+void SVGPathSegListBuilder::curveToQuadratic(const FloatPoint& point1, const FloatPoint& point, PathCoordinateMode mode) > { > if (mode == AbsoluteCoordinates) >- m_pathSegList.append(m_pathElement.createSVGPathSegCurvetoQuadraticAbs(targetPoint.x(), targetPoint.y(), point1.x(), point1.y(), m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegCurvetoQuadraticAbs::create(point.x(), point.y(), point1.x(), point1.y())); > else >- m_pathSegList.append(m_pathElement.createSVGPathSegCurvetoQuadraticRel(targetPoint.x(), targetPoint.y(), point1.x(), point1.y(), m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegCurvetoQuadraticRel::create(point.x(), point.y(), point1.x(), point1.y())); > } > >-void SVGPathSegListBuilder::curveToQuadraticSmooth(const FloatPoint& targetPoint, PathCoordinateMode mode) >+void SVGPathSegListBuilder::curveToQuadraticSmooth(const FloatPoint& point, PathCoordinateMode mode) > { > if (mode == AbsoluteCoordinates) >- m_pathSegList.append(m_pathElement.createSVGPathSegCurvetoQuadraticSmoothAbs(targetPoint.x(), targetPoint.y(), m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegCurvetoQuadraticSmoothAbs::create(point.x(), point.y())); > else >- m_pathSegList.append(m_pathElement.createSVGPathSegCurvetoQuadraticSmoothRel(targetPoint.x(), targetPoint.y(), m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegCurvetoQuadraticSmoothRel::create(point.x(), point.y())); > } > >-void SVGPathSegListBuilder::arcTo(float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag, const FloatPoint& targetPoint, PathCoordinateMode mode) >+void SVGPathSegListBuilder::arcTo(float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag, const FloatPoint& point, PathCoordinateMode mode) > { > if (mode == AbsoluteCoordinates) >- m_pathSegList.append(m_pathElement.createSVGPathSegArcAbs(targetPoint.x(), targetPoint.y(), r1, r2, angle, largeArcFlag, sweepFlag, m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegArcAbs::create(point.x(), point.y(), r1, r2, angle, largeArcFlag, sweepFlag)); > else >- m_pathSegList.append(m_pathElement.createSVGPathSegArcRel(targetPoint.x(), targetPoint.y(), r1, r2, angle, largeArcFlag, sweepFlag, m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegArcRel::create(point.x(), point.y(), r1, r2, angle, largeArcFlag, sweepFlag)); > } > > void SVGPathSegListBuilder::closePath() > { >- m_pathSegList.append(m_pathElement.createSVGPathSegClosePath(m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegClosePath::create()); > } > > } >diff --git a/Source/WebCore/svg/SVGPathSegListBuilder.h b/Source/WebCore/svg/SVGPathSegListBuilder.h >index eb1ab8b18be..394eb4f2988 100644 >--- a/Source/WebCore/svg/SVGPathSegListBuilder.h >+++ b/Source/WebCore/svg/SVGPathSegListBuilder.h >@@ -4,6 +4,7 @@ > * Copyright (C) 2006, 2007 Rob Buis <buis@kde.org> > * Copyright (C) 2007, 2009, 2015 Apple Inc. All rights reserved. > * Copyright (C) Research In Motion Limited 2010. All rights reserved. >+ * Copyright (C) 2018 Apple Inc. All rights reserved. > * > * This library is free software; you can redistribute it and/or > * modify it under the terms of the GNU Library General Public >@@ -25,15 +26,14 @@ > > #include "FloatPoint.h" > #include "SVGPathConsumer.h" >-#include "SVGPathSegListValues.h" > > namespace WebCore { > >-class SVGPathElement; >+class SVGPathSegList; > > class SVGPathSegListBuilder final : public SVGPathConsumer { > public: >- SVGPathSegListBuilder(SVGPathElement&, SVGPathSegListValues&, SVGPathSegRole); >+ SVGPathSegListBuilder(SVGPathSegList&); > > private: > void incrementPathSegmentCount() final { } >@@ -53,9 +53,7 @@ private: > void curveToQuadraticSmooth(const FloatPoint&, PathCoordinateMode) final; > void arcTo(float, float, float, bool largeArcFlag, bool sweepFlag, const FloatPoint&, PathCoordinateMode) final; > >- SVGPathElement& m_pathElement; >- SVGPathSegListValues& m_pathSegList; >- SVGPathSegRole m_pathSegRole { PathSegUndefinedRole }; >+ SVGPathSegList& m_pathSegList; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegListSource.cpp b/Source/WebCore/svg/SVGPathSegListSource.cpp >index 0cdd8afed67..03463f3da3c 100644 >--- a/Source/WebCore/svg/SVGPathSegListSource.cpp >+++ b/Source/WebCore/svg/SVGPathSegListSource.cpp >@@ -1,5 +1,6 @@ > /* > * Copyright (C) Research In Motion Limited 2010. All rights reserved. >+ * Copyright (C) 2018 Apple Inc. All rights reserved. > * > * This library is free software; you can redistribute it and/or > * modify it under the terms of the GNU Library General Public >@@ -20,16 +21,12 @@ > #include "config.h" > #include "SVGPathSegListSource.h" > >-#include "SVGPathSegArc.h" >-#include "SVGPathSegCurvetoCubic.h" >-#include "SVGPathSegCurvetoCubicSmooth.h" >-#include "SVGPathSegCurvetoQuadratic.h" >-#include "SVGPathSegLinetoHorizontal.h" >-#include "SVGPathSegLinetoVertical.h" >+#include "SVGPathSeg.h" >+#include "SVGPathSegList.h" > > namespace WebCore { > >-SVGPathSegListSource::SVGPathSegListSource(const SVGPathSegListValues& pathSegList) >+SVGPathSegListSource::SVGPathSegListSource(const SVGPathSegList& pathSegList) > : m_pathSegList(pathSegList) > { > m_itemCurrent = 0; >diff --git a/Source/WebCore/svg/SVGPathSegListSource.h b/Source/WebCore/svg/SVGPathSegListSource.h >index 506e7c044fd..5fba1b6fb49 100644 >--- a/Source/WebCore/svg/SVGPathSegListSource.h >+++ b/Source/WebCore/svg/SVGPathSegListSource.h >@@ -1,5 +1,6 @@ > /* > * Copyright (C) Research In Motion Limited 2010. All rights reserved. >+ * Copyright (C) 2018 Apple Inc. All rights reserved. > * > * This library is free software; you can redistribute it and/or > * modify it under the terms of the GNU Library General Public >@@ -21,15 +22,16 @@ > > #include "FloatPoint.h" > #include "SVGPathSeg.h" >-#include "SVGPathSegListValues.h" > #include "SVGPathSource.h" > #include <wtf/RefPtr.h> > > namespace WebCore { >+ >+class SVGPathSegList; > > class SVGPathSegListSource final : public SVGPathSource { > public: >- explicit SVGPathSegListSource(const SVGPathSegListValues&); >+ explicit SVGPathSegListSource(const SVGPathSegList&); > > private: > bool hasMoreData() const final; >@@ -47,10 +49,10 @@ private: > bool parseCurveToQuadraticSmoothSegment(FloatPoint&) final; > bool parseArcToSegment(float&, float&, float&, bool&, bool&, FloatPoint&) final; > >- const SVGPathSegListValues& m_pathSegList; >+ const SVGPathSegList& m_pathSegList; > RefPtr<SVGPathSeg> m_segment; >- int m_itemCurrent; >- int m_itemEnd; >+ size_t m_itemCurrent; >+ size_t m_itemEnd; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegListValues.cpp b/Source/WebCore/svg/SVGPathSegListValues.cpp >deleted file mode 100644 >index 476d225b689..00000000000 >--- a/Source/WebCore/svg/SVGPathSegListValues.cpp >+++ /dev/null >@@ -1,57 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> >- * Copyright (C) 2007 Eric Seidel <eric@webkit.org> >- * Copyright (C) Research In Motion Limited 2010. All rights reserved. >- * Copyright (C) 2018 Apple Inc. All rights reserved. >- * >- * This library is free software; you can redistribute it and/or >- * modify it under the terms of the GNU Library General Public >- * License as published by the Free Software Foundation; either >- * version 2 of the License, or (at your option) any later version. >- * >- * This library is distributed in the hope that it will be useful, >- * but WITHOUT ANY WARRANTY; without even the implied warranty of >- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >- * Library General Public License for more details. >- * >- * You should have received a copy of the GNU Library General Public License >- * along with this library; see the file COPYING.LIB. If not, write to >- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >- * Boston, MA 02110-1301, USA. >- */ >- >-#include "config.h" >-#include "SVGPathSegListValues.h" >- >-#include "SVGPathElement.h" >-#include "SVGPathUtilities.h" >- >-namespace WebCore { >- >-String SVGPathSegListValues::valueAsString() const >-{ >- String pathString; >- buildStringFromSVGPathSegListValues(*this, pathString, UnalteredParsing); >- return pathString; >-} >- >-void SVGPathSegListValues::commitChange(SVGElement& contextElement, ListModification listModification) >-{ >- downcast<SVGPathElement>(contextElement).pathSegListChanged(m_role, listModification); >-} >- >-void SVGPathSegListValues::clearItemContextAndRole(unsigned index) >-{ >- auto& item = at(index); >- static_cast<SVGPathSegWithContext&>(*item).setContextAndRole(nullptr, PathSegUndefinedRole); >-} >- >-void SVGPathSegListValues::clearContextAndRoles() >-{ >- auto count = size(); >- while (count--) >- clearItemContextAndRole(count); >-} >- >-} >diff --git a/Source/WebCore/svg/SVGPathSegListValues.h b/Source/WebCore/svg/SVGPathSegListValues.h >deleted file mode 100644 >index 8681e31ff94..00000000000 >--- a/Source/WebCore/svg/SVGPathSegListValues.h >+++ /dev/null >@@ -1,87 +0,0 @@ >-/* >- * Copyright (C) 2007 Eric Seidel <eric@webkit.org> >- * Copyright (C) 2018 Apple Inc. All rights reserved. >- * >- * This library is free software; you can redistribute it and/or >- * modify it under the terms of the GNU Library General Public >- * License as published by the Free Software Foundation; either >- * version 2 of the License, or (at your option) any later version. >- * >- * This library is distributed in the hope that it will be useful, >- * but WITHOUT ANY WARRANTY; without even the implied warranty of >- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >- * Library General Public License for more details. >- * >- * You should have received a copy of the GNU Library General Public License >- * along with this library; see the file COPYING.LIB. If not, write to >- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >- * Boston, MA 02110-1301, USA. >- */ >- >-#pragma once >- >-#include "SVGListProperty.h" >-#include "SVGPathSeg.h" >-#include "SVGPropertyTraits.h" >-#include <wtf/Vector.h> >-#include <wtf/text/WTFString.h> >- >-namespace WebCore { >- >-class SVGElement; >-class SVGPathSegList; >- >-template<typename T> >-class SVGPropertyTearOff; >- >-class SVGPathSegListValues : public Vector<RefPtr<SVGPathSeg>> { >-public: >- using Base = Vector<RefPtr<SVGPathSeg>>; >- >- explicit SVGPathSegListValues(SVGPathSegRole role) >- : m_role(role) >- { >- } >- >- SVGPathSegListValues(const SVGPathSegListValues&) = default; >- SVGPathSegListValues(SVGPathSegListValues&&) = default; >- >- SVGPathSegListValues& operator=(const SVGPathSegListValues& other) >- { >- clearContextAndRoles(); >- return static_cast<SVGPathSegListValues&>(Base::operator=(other)); >- } >- >- SVGPathSegListValues& operator=(SVGPathSegListValues&& other) >- { >- clearContextAndRoles(); >- return static_cast<SVGPathSegListValues&>(Base::operator=(WTFMove(other))); >- } >- >- void clear() >- { >- clearContextAndRoles(); >- Base::clear(); >- } >- >- String valueAsString() const; >- >- void commitChange(SVGElement& contextElement, ListModification); >- void clearItemContextAndRole(unsigned index); >- >-private: >- void clearContextAndRoles(); >- >- SVGPathSegRole m_role; >-}; >- >-template<> struct SVGPropertyTraits<SVGPathSegListValues> { >- static SVGPathSegListValues initialValue() { return SVGPathSegListValues(PathSegUndefinedRole); } >- static String toString(const SVGPathSegListValues& list) { return list.valueAsString(); } >- >- using ListItemType = RefPtr<SVGPathSeg>; >- using ListItemTearOff = SVGPropertyTearOff<RefPtr<SVGPathSeg>>; >- using ListPropertyTearOff = SVGPathSegList; >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathUtilities.cpp b/Source/WebCore/svg/SVGPathUtilities.cpp >index cf9f01427e1..e5746ca2048 100644 >--- a/Source/WebCore/svg/SVGPathUtilities.cpp >+++ b/Source/WebCore/svg/SVGPathUtilities.cpp >@@ -104,32 +104,14 @@ String buildStringFromPath(const Path& path) > return builder.toString(); > } > >-bool buildSVGPathByteStreamFromSVGPathSegListValues(const SVGPathSegListValues& list, SVGPathByteStream& result, PathParsingMode parsingMode) >+bool buildSVGPathByteStreamFromSVGPathSegList(const SVGPathSegList& list, SVGPathByteStream& stream, PathParsingMode parsingMode, bool checkForInitialMoveTo) > { >- result.clear(); >+ stream.clear(); > if (list.isEmpty()) > return true; > > SVGPathSegListSource source(list); >- return SVGPathParser::parseToByteStream(source, result, parsingMode); >-} >- >-bool appendSVGPathByteStreamFromSVGPathSeg(RefPtr<SVGPathSeg>&& pathSeg, SVGPathByteStream& result, PathParsingMode parsingMode) >-{ >- // FIXME: https://bugs.webkit.org/show_bug.cgi?id=15412 - Implement normalized path segment lists! >- ASSERT(parsingMode == UnalteredParsing); >- >- SVGPathSegListValues appendedItemList(PathSegUnalteredRole); >- appendedItemList.append(WTFMove(pathSeg)); >- >- SVGPathByteStream appendedByteStream; >- SVGPathSegListSource source(appendedItemList); >- bool ok = SVGPathParser::parseToByteStream(source, result, parsingMode, false); >- >- if (ok) >- result.append(appendedByteStream); >- >- return ok; >+ return SVGPathParser::parseToByteStream(source, stream, parsingMode, checkForInitialMoveTo); > } > > Path buildPathFromByteStream(const SVGPathByteStream& stream) >@@ -144,33 +126,23 @@ Path buildPathFromByteStream(const SVGPathByteStream& stream) > return path; > } > >-bool buildSVGPathSegListValuesFromByteStream(const SVGPathByteStream& stream, SVGPathElement& element, SVGPathSegListValues& result, PathParsingMode parsingMode) >+bool buildSVGPathSegListFromByteStream(const SVGPathByteStream& stream, SVGPathSegList& list, PathParsingMode mode) > { > if (stream.isEmpty()) > return true; > >- SVGPathSegListBuilder builder(element, result, parsingMode == NormalizedParsing ? PathSegNormalizedRole : PathSegUnalteredRole); >+ SVGPathSegListBuilder builder(list); > SVGPathByteStreamSource source(stream); >- return SVGPathParser::parse(source, builder, parsingMode); >+ return SVGPathParser::parse(source, builder, mode); > } > >-bool buildStringFromByteStream(const SVGPathByteStream& stream, String& result, PathParsingMode parsingMode) >+bool buildStringFromByteStream(const SVGPathByteStream& stream, String& result, PathParsingMode parsingMode, bool checkForInitialMoveTo) > { > if (stream.isEmpty()) > return true; > > SVGPathByteStreamSource source(stream); >- return SVGPathParser::parseToString(source, result, parsingMode); >-} >- >-bool buildStringFromSVGPathSegListValues(const SVGPathSegListValues& list, String& result, PathParsingMode parsingMode) >-{ >- result = String(); >- if (list.isEmpty()) >- return true; >- >- SVGPathSegListSource source(list); >- return SVGPathParser::parseToString(source, result, parsingMode); >+ return SVGPathParser::parseToString(source, result, parsingMode, checkForInitialMoveTo); > } > > bool buildSVGPathByteStreamFromString(const String& d, SVGPathByteStream& result, PathParsingMode parsingMode) >diff --git a/Source/WebCore/svg/SVGPathUtilities.h b/Source/WebCore/svg/SVGPathUtilities.h >index 216766ee2d8..ae4a474cedc 100644 >--- a/Source/WebCore/svg/SVGPathUtilities.h >+++ b/Source/WebCore/svg/SVGPathUtilities.h >@@ -30,7 +30,7 @@ class Path; > class SVGPathByteStream; > class SVGPathElement; > class SVGPathSeg; >-class SVGPathSegListValues; >+class SVGPathSegList; > > // String/SVGPathByteStream -> Path > Path buildPathFromString(const String&); >@@ -39,17 +39,15 @@ Path buildPathFromByteStream(const SVGPathByteStream&); > // Path -> String > String buildStringFromPath(const Path&); > >-// SVGPathSegListValues/String -> SVGPathByteStream >-bool buildSVGPathByteStreamFromSVGPathSegListValues(const SVGPathSegListValues&, SVGPathByteStream& result, PathParsingMode); >-bool appendSVGPathByteStreamFromSVGPathSeg(RefPtr<SVGPathSeg>&&, SVGPathByteStream&, PathParsingMode); >+// SVGPathSegList/String -> SVGPathByteStream >+bool buildSVGPathByteStreamFromSVGPathSegList(const SVGPathSegList&, SVGPathByteStream& result, PathParsingMode, bool checkForInitialMoveTo = true); > bool buildSVGPathByteStreamFromString(const String&, SVGPathByteStream&, PathParsingMode); > >-// SVGPathByteStream/SVGPathSegListValues -> String >-bool buildStringFromByteStream(const SVGPathByteStream&, String&, PathParsingMode); >-bool buildStringFromSVGPathSegListValues(const SVGPathSegListValues&, String&, PathParsingMode); >+// SVGPathByteStream -> String >+bool buildStringFromByteStream(const SVGPathByteStream&, String&, PathParsingMode, bool checkForInitialMoveTo = true); > >-// SVGPathByteStream -> SVGPathSegListValues >-bool buildSVGPathSegListValuesFromByteStream(const SVGPathByteStream&, SVGPathElement&, SVGPathSegListValues&, PathParsingMode); >+// SVGPathByteStream -> SVGPathSegList >+bool buildSVGPathSegListFromByteStream(const SVGPathByteStream&, SVGPathSegList&, PathParsingMode); > > bool canBlendSVGPathByteStreams(const SVGPathByteStream& from, const SVGPathByteStream& to); >
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 191237
:
353808
|
353812
|
353815
|
353817
|
353818
|
353820
|
353824
|
353825
|
355382
|
355386
|
355388
|
355393
|
355568
|
355574
|
355575
|
355577
|
355580
|
355582
|
355585
|
355666
|
355672
|
355693
|
355699
|
355711
|
355752
|
355777
|
355820
|
356333
|
356334
|
356338
|
356340
|
356342
|
356344
|
356346
|
356351
|
356352
|
356358
|
356360
|
356380
|
356497
|
356500
|
356507
|
356579
|
356607
|
356728
|
356729
|
356730
|
356731
|
356732
|
356733
|
356752
|
356810
|
356811
|
356879
|
356880
|
356881
|
356882
|
356883
|
356884
|
356885
|
356887
|
356888
|
356889
|
356892
|
356895
|
356896
|
359721
|
359735
|
359747
|
363581
|
363595
|
363613
|
363690
|
364172
|
364180
|
366512
|
366557
|
366636