WebKit Bugzilla
Attachment 346199 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 a registration method for SVGAnimatedPointList
186751-15.patch (text/plain), 4.67 KB, created by
Said Abou-Hallawa
on 2018-07-31 13:42:28 PDT
(
hide
)
Description:
Add a registration method for SVGAnimatedPointList
Filename:
MIME Type:
Creator:
Said Abou-Hallawa
Created:
2018-07-31 13:42:28 PDT
Size:
4.67 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 1061b1a98d0..f0c29261d27 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,28 @@ >+2018-07-31 Said Abou-Hallawa <sabouhallawa@apple.com> >+ >+ [15] Remove the SVG elements' attributes macros >+ https://bugs.webkit.org/show_bug.cgi?id=186751 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Define the types SVGAnimatedPointListAttribute and SVGAnimatedPointListAttributeAccessor. >+ >+ 1. The only SVGPointListValues attribute we have is the points attribute >+ of the SVGPolyElement. But it is registered as a custom attribute. No >+ macros were used for this attribute. So we need to define the attribute >+ and the accessor. The custom registration will be removed later. >+ 2. Add template functions in SVGAttributeRegistry for registering >+ attributes of type SVGAnimatedEnumerationAttribute. >+ >+ An example of registering SVGAnimatedPointListAttribute: >+ registry.registerAttribute<SVGNames::pointsAttr, &SVGPolyElement::m_points>(); >+ >+ * svg/SVGAnimatedPointList.h: >+ * svg/SVGPointListValues.h: >+ (WebCore::SVGPropertyTraits<SVGPointListValues>::toString): >+ * svg/properties/SVGAttributeRegistry.h: >+ (WebCore::SVGAttributeRegistry::registerAttribute): >+ > 2018-07-31 Said Abou-Hallawa <sabouhallawa@apple.com> > > [14] Remove the SVG elements' attributes macros >diff --git a/Source/WebCore/svg/SVGAnimatedPointList.h b/Source/WebCore/svg/SVGAnimatedPointList.h >index 2090e827de6..1e773e1c98d 100644 >--- a/Source/WebCore/svg/SVGAnimatedPointList.h >+++ b/Source/WebCore/svg/SVGAnimatedPointList.h >@@ -1,5 +1,6 @@ > /* > * Copyright (C) Research In Motion Limited 2011. 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,9 +26,13 @@ > > namespace WebCore { > >+class SVGAnimationElement; >+ > using SVGAnimatedPointList = SVGAnimatedListPropertyTearOff<SVGPointListValues>; >+using SVGAnimatedPointListAttribute = SVGAnimatedAttributeList<SVGAnimatedPointList>; > >-class SVGAnimationElement; >+template<typename OwnerType> >+using SVGAnimatedPointListAttributeAccessor = SVGAnimatedAttributeAccessor<OwnerType, SVGAnimatedPointListAttribute, AnimatedPoints>; > > class SVGAnimatedPointListAnimator final : public SVGAnimatedTypeAnimator { > public: >diff --git a/Source/WebCore/svg/SVGPointListValues.h b/Source/WebCore/svg/SVGPointListValues.h >index e53515e27d3..362fdcc5d7d 100644 >--- a/Source/WebCore/svg/SVGPointListValues.h >+++ b/Source/WebCore/svg/SVGPointListValues.h >@@ -1,6 +1,7 @@ > /* > * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> > * Copyright (C) 2004, 2005 Rob Buis <buis@kde.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 >@@ -44,7 +45,7 @@ struct SVGPropertyTraits<SVGPointListValues> { > return list; > } > static std::optional<SVGPointListValues> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return { }; } >- static String toString(const SVGPointListValues&) { ASSERT_NOT_REACHED(); return emptyString(); } >+ static String toString(const SVGPointListValues& list) { return list.valueAsString(); } > > using ListItemType = FloatPoint; > using ListItemTearOff = SVGPoint; >diff --git a/Source/WebCore/svg/properties/SVGAttributeRegistry.h b/Source/WebCore/svg/properties/SVGAttributeRegistry.h >index 2a61def9a42..3abbf9dc0ff 100644 >--- a/Source/WebCore/svg/properties/SVGAttributeRegistry.h >+++ b/Source/WebCore/svg/properties/SVGAttributeRegistry.h >@@ -31,6 +31,7 @@ > #include "SVGAnimatedLength.h" > #include "SVGAnimatedLengthList.h" > #include "SVGAnimatedNumber.h" >+#include "SVGAnimatedPointList.h" > #include "SVGAnimatedProperty.h" > #include "SVGAttributeAccessor.h" > #include "SVGZoomAndPanType.h" >@@ -105,6 +106,12 @@ public: > registerAttribute(SVGAnimatedOptionalNumberAttributeAccessor<OwnerType>::template singleton<attributeName, identifier, attribute, optionalIdentifier, optionalAttribute>()); > } > >+ template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGAnimatedPointListAttribute OwnerType::*attribute> >+ void registerAttribute() >+ { >+ registerAttribute(SVGAnimatedPointListAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>()); >+ } >+ > bool isEmpty() const { return m_map.isEmpty(); } > > bool isKnownAttribute(const QualifiedName& attributeName) const
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