WebKit Bugzilla
Attachment 346197 Details for
Bug 186751
: Remove the SVG elements' attributes macros
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Add animated type and animated attribute for PathSegList
186751-14.patch (text/plain), 11.10 KB, created by
Said Abou-Hallawa
on 2018-07-31 13:25:53 PDT
(
hide
)
Description:
Add animated type and animated attribute for PathSegList
Filename:
MIME Type:
Creator:
Said Abou-Hallawa
Created:
2018-07-31 13:25:53 PDT
Size:
11.10 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index ccfaab852d4..1061b1a98d0 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,35 @@ >+2018-07-31 Said Abou-Hallawa <sabouhallawa@apple.com> >+ >+ [14] Remove the SVG elements' attributes macros >+ https://bugs.webkit.org/show_bug.cgi?id=186751 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Define the types SVGAnimatedPathSegList and SVGAnimatedPathSegListAttribute. >+ >+ 1. Add a new source file SVGAnimatedPathSegListPropertyTearOff.cpp to >+ remove a cyclic header file inclusion: >+ SVGAnimatedPath.h > SVGAnimatedPathSegListPropertyTearOff.h > >+ SVGPathElement.h > SVGAnimatedPath.h. >+ 2. Move the methods that needs the definition of SVGPathElement to the >+ SVGAnimatedPathSegListPropertyTearOff.cpp >+ >+ The only SVGAnimatedPathSegListAttribute attribute, which is an >+ attribute of SVGPathElement, has a custom accessor. So nothing will be >+ added to SVGAttributeRegistry for SVGAnimatedPathSegListAttribute. >+ >+ An example of registering SVGAnimatedPathSegListAttribute: >+ registry.registerAttribute(SVGAnimatedCustomPathSegListAttributeAccessor::singleton<SVGNames::dAttr, &SVGPathElement::m_pathSegList>()); >+ >+ * Sources.txt: >+ * WebCore.xcodeproj/project.pbxproj: >+ * svg/SVGAnimatedPath.h: >+ * svg/properties/SVGAnimatedPathSegListPropertyTearOff.cpp: Added. >+ (WebCore::SVGAnimatedPathSegListPropertyTearOff::SVGAnimatedPathSegListPropertyTearOff): >+ (WebCore::SVGAnimatedPathSegListPropertyTearOff::~SVGAnimatedPathSegListPropertyTearOff): >+ (WebCore::SVGAnimatedPathSegListPropertyTearOff::animValDidChange): >+ * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h: >+ > 2018-07-31 Said Abou-Hallawa <sabouhallawa@apple.com> > > [13] Remove the SVG elements' attributes macros >diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt >index f996d273967..ccaccff7d53 100644 >--- a/Source/WebCore/Sources.txt >+++ b/Source/WebCore/Sources.txt >@@ -2270,6 +2270,7 @@ svg/graphics/filters/SVGFEImage.cpp > svg/graphics/filters/SVGFilter.cpp > svg/graphics/filters/SVGFilterBuilder.cpp > >+svg/properties/SVGAnimatedPathSegListPropertyTearOff.cpp > svg/properties/SVGAnimatedProperty.cpp > svg/properties/SVGAttributeToPropertyMap.cpp > svg/properties/SVGPropertyInfo.cpp >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index abdd2cd6ddf..72d783e29fd 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -8404,6 +8404,7 @@ > 55FA7FF6210FBE3E005AEFE7 /* SVGAttributeRegistry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAttributeRegistry.h; sourceTree = "<group>"; }; > 55FA7FF9210FDB34005AEFE7 /* SVGAttributeOwnerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAttributeOwnerProxy.h; sourceTree = "<group>"; }; > 55FA7FFA2110ECD7005AEFE7 /* SVGZoomAndPanType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGZoomAndPanType.h; sourceTree = "<group>"; }; >+ 55FA7FFC2110F813005AEFE7 /* SVGAnimatedPathSegListPropertyTearOff.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedPathSegListPropertyTearOff.cpp; sourceTree = "<group>"; }; > 570440571E53851600356601 /* CryptoAlgorithmAES_CFBMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmAES_CFBMac.cpp; sourceTree = "<group>"; }; > 570440591E53936200356601 /* JSAesCbcCfbParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAesCbcCfbParams.h; sourceTree = "<group>"; }; > 5704405B1E53937900356601 /* JSAesCbcCfbParams.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAesCbcCfbParams.cpp; sourceTree = "<group>"; }; >@@ -15455,6 +15456,7 @@ > children = ( > 71FB967A1383D64600AC8A4C /* SVGAnimatedEnumerationPropertyTearOff.h */, > 088A0DFB126EF1DB00978F7A /* SVGAnimatedListPropertyTearOff.h */, >+ 55FA7FFC2110F813005AEFE7 /* SVGAnimatedPathSegListPropertyTearOff.cpp */, > 089A8E06128D8B3D00E7A534 /* SVGAnimatedPathSegListPropertyTearOff.h */, > 836FBCEB178C117F00B21A15 /* SVGAnimatedProperty.cpp */, > 088A0DFC126EF1DB00978F7A /* SVGAnimatedProperty.h */, >diff --git a/Source/WebCore/svg/SVGAnimatedPath.h b/Source/WebCore/svg/SVGAnimatedPath.h >index 7feb70f0214..b864ed32bb4 100644 >--- a/Source/WebCore/svg/SVGAnimatedPath.h >+++ b/Source/WebCore/svg/SVGAnimatedPath.h >@@ -1,5 +1,6 @@ > /* > * Copyright (C) Research In Motion Limited 2011, 2012. 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 >@@ -19,12 +20,17 @@ > > #pragma once > >+#include "SVGAnimatedPathSegListPropertyTearOff.h" > #include "SVGAnimatedTypeAnimator.h" >+#include "SVGAttributeAccessor.h" > > namespace WebCore { > > class SVGAnimationElement; > >+using SVGAnimatedPathSegList = SVGAnimatedPathSegListPropertyTearOff; >+using SVGAnimatedPathSegListAttribute = SVGAnimatedAttributeList<SVGAnimatedPathSegList>; >+ > class SVGAnimatedPathAnimator final : public SVGAnimatedTypeAnimator { > public: > SVGAnimatedPathAnimator(SVGAnimationElement*, SVGElement*); >diff --git a/Source/WebCore/svg/properties/SVGAnimatedPathSegListPropertyTearOff.cpp b/Source/WebCore/svg/properties/SVGAnimatedPathSegListPropertyTearOff.cpp >index 8b137891791..d27968e8309 100644 >--- a/Source/WebCore/svg/properties/SVGAnimatedPathSegListPropertyTearOff.cpp >+++ b/Source/WebCore/svg/properties/SVGAnimatedPathSegListPropertyTearOff.cpp >@@ -1 +1,61 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ > >+#include "config.h" >+#include "SVGAnimatedPathSegListPropertyTearOff.h" >+ >+#include "SVGPathElement.h" >+ >+namespace WebCore { >+ >+SVGAnimatedPathSegListPropertyTearOff::SVGAnimatedPathSegListPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, SVGPathSegListValues& values) >+ : Base(contextElement, attributeName, animatedPropertyType, values) >+{ >+ ASSERT(contextElement); >+ ASSERT(is<SVGPathElement>(contextElement)); >+} >+ >+SVGAnimatedPathSegListPropertyTearOff::~SVGAnimatedPathSegListPropertyTearOff() >+{ >+ downcast<SVGPathElement>(contextElement())->animatedPropertyWillBeDeleted(); >+} >+ >+void SVGAnimatedPathSegListPropertyTearOff::animValDidChange() >+{ >+ ASSERT(m_animatedPathByteStream); >+ auto pathElement = makeRefPtr(downcast<SVGPathElement>(contextElement())); >+ >+ // If the animVal is observed from JS, we have to update it on each animation step. >+ // This is an expensive operation and only done, if someone actually observes the animatedPathSegList() while an animation is running. >+ if (pathElement->isAnimValObserved()) { >+ auto& animatedList = currentAnimatedValue(); >+ animatedList.clear(); >+ buildSVGPathSegListValuesFromByteStream(*m_animatedPathByteStream, *pathElement, animatedList, UnalteredParsing); >+ } >+ >+ Base::animValDidChange(); >+} >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGAnimatedPathSegListPropertyTearOff.h b/Source/WebCore/svg/properties/SVGAnimatedPathSegListPropertyTearOff.h >index 6732f9af24c..ba859937436 100644 >--- a/Source/WebCore/svg/properties/SVGAnimatedPathSegListPropertyTearOff.h >+++ b/Source/WebCore/svg/properties/SVGAnimatedPathSegListPropertyTearOff.h >@@ -1,5 +1,6 @@ > /* > * Copyright (C) Research In Motion Limited 2010, 2012. 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,7 +22,6 @@ > > #include "SVGAnimatedListPropertyTearOff.h" > #include "SVGPathByteStream.h" >-#include "SVGPathElement.h" > #include "SVGPathSegList.h" > #include "SVGPathUtilities.h" > >@@ -87,39 +87,15 @@ public: > Base::animationEnded(); > } > >- void animValDidChange() >- { >- ASSERT(m_animatedPathByteStream); >- auto pathElement = makeRefPtr(downcast<SVGPathElement>(contextElement())); >- >- // If the animVal is observed from JS, we have to update it on each animation step. >- // This is an expensive operation and only done, if someone actually observes the animatedPathSegList() while an animation is running. >- if (pathElement->isAnimValObserved()) { >- auto& animatedList = currentAnimatedValue(); >- animatedList.clear(); >- buildSVGPathSegListValuesFromByteStream(*m_animatedPathByteStream, *pathElement, animatedList, UnalteredParsing); >- } >- >- Base::animValDidChange(); >- } >+ void animValDidChange(); > > SVGPathByteStream* animatedPathByteStream() const { return m_animatedPathByteStream; } > > private: >- SVGAnimatedPathSegListPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, SVGPathSegListValues& values) >- : Base(contextElement, attributeName, animatedPropertyType, values) >- , m_animatedPathByteStream(nullptr) >- { >- ASSERT(contextElement); >- ASSERT(is<SVGPathElement>(contextElement)); >- } >- >- virtual ~SVGAnimatedPathSegListPropertyTearOff() >- { >- downcast<SVGPathElement>(contextElement())->animatedPropertyWillBeDeleted(); >- } >+ SVGAnimatedPathSegListPropertyTearOff(SVGElement*, const QualifiedName&, AnimatedPropertyType, SVGPathSegListValues&); >+ virtual ~SVGAnimatedPathSegListPropertyTearOff(); > >- SVGPathByteStream* m_animatedPathByteStream; >+ SVGPathByteStream* m_animatedPathByteStream { nullptr }; > }; > > } // namespace WebCore
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 186751
:
342916
|
342917
|
342985
|
343001
|
343114
|
343123
|
343124
|
343127
|
343129
|
343162
|
343167
|
343169
|
343171
|
343174
|
343213
|
343217
|
343327
|
343335
|
343338
|
343339
|
343343
|
343415
|
343979
|
343989
|
344002
|
344513
|
344516
|
344523
|
344534
|
344536
|
344988
|
344990
|
346097
|
346103
|
346124
|
346129
|
346177
|
346179
|
346180
|
346182
|
346185
|
346188
|
346190
|
346192
|
346193
|
346197
|
346199
|
346201
|
346202
|
346203
|
346204
|
346205
|
346206
|
346207
|
346211
|
346212
|
346217
|
346224
|
346230
|
346233
|
346241
|
346244
|
346245
|
346315
|
346316
|
346317
|
346318
|
346319
|
346320
|
346322
|
346323
|
346324
|
346325
|
346326
|
346327
|
346328
|
346329
|
346330
|
346331
|
346332
|
346333
|
346334
|
346335
|
346336
|
346337
|
346338
|
346339
|
346340
|
346341
|
346342
|
346343
|
346344
|
346345
|
346346
|
346347
|
346348
|
346349
|
346350
|
346518
|
346519
|
346520
|
346521
|
346522
|
346524
|
346525
|
346526
|
346527
|
346528
|
346529
|
346530
|
346531
|
346532
|
346533
|
346534
|
346535
|
346536
|
346537
|
346538
|
346539
|
346540
|
346541
|
346545
|
346546
|
346549
|
346551
|
346552
|
346601
|
346602
|
346611
|
346636
|
346642