WebKit Bugzilla
Attachment 346332 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]
Remove SVG macros from SVGFEDisplacementMapElement
186751-48.patch (text/plain), 8.40 KB, created by
Said Abou-Hallawa
on 2018-08-01 17:51:54 PDT
(
hide
)
Description:
Remove SVG macros from SVGFEDisplacementMapElement
Filename:
MIME Type:
Creator:
Said Abou-Hallawa
Created:
2018-08-01 17:51:54 PDT
Size:
8.40 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 2f4deaad729..a3acebbb1a7 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,18 @@ >+2018-08-01 Said Abou-Hallawa <sabouhallawa@apple.com> >+ >+ [48] Remove the SVG elements' attributes macros >+ https://bugs.webkit.org/show_bug.cgi?id=186751 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Remove SVG macros from SVGFEDisplacementMapElement. >+ >+ * svg/SVGFEDisplacementMapElement.cpp: >+ (WebCore::SVGFEDisplacementMapElement::SVGFEDisplacementMapElement): >+ (WebCore::SVGFEDisplacementMapElement::registerAttributes): >+ (WebCore::SVGFEDisplacementMapElement::parseAttribute): >+ * svg/SVGFEDisplacementMapElement.h: >+ > 2018-08-01 Said Abou-Hallawa <sabouhallawa@apple.com> > > [47] Remove the SVG elements' attributes macros >diff --git a/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp b/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp >index 2b48e843025..435fc701df6 100644 >--- a/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp >+++ b/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp >@@ -1,5 +1,6 @@ > /* > * Copyright (C) 2006 Oliver Hunt <oliver@nerget.com> >+ * 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 >@@ -29,29 +30,11 @@ namespace WebCore { > > WTF_MAKE_ISO_ALLOCATED_IMPL(SVGFEDisplacementMapElement); > >-// Animated property definitions >-DEFINE_ANIMATED_STRING(SVGFEDisplacementMapElement, SVGNames::inAttr, In1, in1) >-DEFINE_ANIMATED_STRING(SVGFEDisplacementMapElement, SVGNames::in2Attr, In2, in2) >-DEFINE_ANIMATED_ENUMERATION(SVGFEDisplacementMapElement, SVGNames::xChannelSelectorAttr, XChannelSelector, xChannelSelector, ChannelSelectorType) >-DEFINE_ANIMATED_ENUMERATION(SVGFEDisplacementMapElement, SVGNames::yChannelSelectorAttr, YChannelSelector, yChannelSelector, ChannelSelectorType) >-DEFINE_ANIMATED_NUMBER(SVGFEDisplacementMapElement, SVGNames::scaleAttr, Scale, scale) >- >-BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEDisplacementMapElement) >- REGISTER_LOCAL_ANIMATED_PROPERTY(in1) >- REGISTER_LOCAL_ANIMATED_PROPERTY(in2) >- REGISTER_LOCAL_ANIMATED_PROPERTY(xChannelSelector) >- REGISTER_LOCAL_ANIMATED_PROPERTY(yChannelSelector) >- REGISTER_LOCAL_ANIMATED_PROPERTY(scale) >- REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes) >-END_REGISTER_ANIMATED_PROPERTIES >- > inline SVGFEDisplacementMapElement::SVGFEDisplacementMapElement(const QualifiedName& tagName, Document& document) > : SVGFilterPrimitiveStandardAttributes(tagName, document) >- , m_xChannelSelector(CHANNEL_A) >- , m_yChannelSelector(CHANNEL_A) > { > ASSERT(hasTagName(SVGNames::feDisplacementMapTag)); >- registerAnimatedPropertiesForSVGFEDisplacementMapElement(); >+ registerAttributes(); > } > > Ref<SVGFEDisplacementMapElement> SVGFEDisplacementMapElement::create(const QualifiedName& tagName, Document& document) >@@ -59,34 +42,46 @@ Ref<SVGFEDisplacementMapElement> SVGFEDisplacementMapElement::create(const Quali > return adoptRef(*new SVGFEDisplacementMapElement(tagName, document)); > } > >+void SVGFEDisplacementMapElement::registerAttributes() >+{ >+ auto& registry = attributeRegistry(); >+ if (!registry.isEmpty()) >+ return; >+ registry.registerAttribute<SVGNames::inAttr, &SVGFEDisplacementMapElement::m_in1>(); >+ registry.registerAttribute<SVGNames::in2Attr, &SVGFEDisplacementMapElement::m_in2>(); >+ registry.registerAttribute<SVGNames::xChannelSelectorAttr, ChannelSelectorType, &SVGFEDisplacementMapElement::m_xChannelSelector>(); >+ registry.registerAttribute<SVGNames::yChannelSelectorAttr, ChannelSelectorType, &SVGFEDisplacementMapElement::m_yChannelSelector>(); >+ registry.registerAttribute<SVGNames::scaleAttr, &SVGFEDisplacementMapElement::m_scale>(); >+} >+ > void SVGFEDisplacementMapElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::xChannelSelectorAttr) { > auto propertyValue = SVGPropertyTraits<ChannelSelectorType>::fromString(value); > if (propertyValue > 0) >- setXChannelSelectorBaseValue(propertyValue); >+ m_xChannelSelector.setValue(propertyValue); > return; > } > > if (name == SVGNames::yChannelSelectorAttr) { > auto propertyValue = SVGPropertyTraits<ChannelSelectorType>::fromString(value); > if (propertyValue > 0) >- setYChannelSelectorBaseValue(propertyValue); >+ m_yChannelSelector.setValue(propertyValue); > return; > } > > if (name == SVGNames::inAttr) { >- setIn1BaseValue(value); >+ m_in1.setValue(value); > return; > } > > if (name == SVGNames::in2Attr) { >- setIn2BaseValue(value); >+ m_in2.setValue(value); > return; > } > > if (name == SVGNames::scaleAttr) { >- setScaleBaseValue(value.toFloat()); >+ m_scale.setValue(value.toFloat()); > return; > } > >diff --git a/Source/WebCore/svg/SVGFEDisplacementMapElement.h b/Source/WebCore/svg/SVGFEDisplacementMapElement.h >index 15f8be7e31a..2781319f5c3 100644 >--- a/Source/WebCore/svg/SVGFEDisplacementMapElement.h >+++ b/Source/WebCore/svg/SVGFEDisplacementMapElement.h >@@ -1,5 +1,6 @@ > /* > * Copyright (C) 2006 Oliver Hunt <oliver@nerget.com> >+ * 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 >@@ -69,22 +70,40 @@ public: > static Ref<SVGFEDisplacementMapElement> create(const QualifiedName&, Document&); > > static ChannelSelectorType stringToChannel(const String&); >- >+ >+ String in1() const { return m_in1.currentValue(); } >+ String in2() const { return m_in2.currentValue(); } >+ ChannelSelectorType xChannelSelector() const { return m_xChannelSelector.currentValue(); } >+ ChannelSelectorType yChannelSelector() const { return m_yChannelSelector.currentValue(); } >+ float scale() const { return m_scale.currentValue(); } >+ >+ RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(); } >+ RefPtr<SVGAnimatedString> in2Animated() { return m_in2.animatedProperty(); } >+ RefPtr<SVGAnimatedEnumeration> xChannelSelectorAnimated() { return m_xChannelSelector.animatedProperty(); } >+ RefPtr<SVGAnimatedEnumeration> yChannelSelectorAnimated() { return m_yChannelSelector.animatedProperty(); } >+ RefPtr<SVGAnimatedNumber> scaleAnimated() { return m_scale.animatedProperty(); } >+ > private: > SVGFEDisplacementMapElement(const QualifiedName& tagName, Document&); >- >+ >+ using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEDisplacementMapElement, SVGFilterPrimitiveStandardAttributes>; >+ static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >+ static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >+ static void registerAttributes(); >+ >+ const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; >- bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) override; > void svgAttributeChanged(const QualifiedName&) override; >+ >+ bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) override; > RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; > >- BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFEDisplacementMapElement) >- DECLARE_ANIMATED_STRING(In1, in1) >- DECLARE_ANIMATED_STRING(In2, in2) >- DECLARE_ANIMATED_ENUMERATION(XChannelSelector, xChannelSelector, ChannelSelectorType) >- DECLARE_ANIMATED_ENUMERATION(YChannelSelector, yChannelSelector, ChannelSelectorType) >- DECLARE_ANIMATED_NUMBER(Scale, scale) >- END_DECLARE_ANIMATED_PROPERTIES >+ AttributeOwnerProxy m_attributeOwnerProxy { *this }; >+ SVGAnimatedStringAttribute m_in1 { m_attributeOwnerProxy }; >+ SVGAnimatedStringAttribute m_in2 { m_attributeOwnerProxy }; >+ SVGAnimatedEnumerationAttribute<ChannelSelectorType> m_xChannelSelector { m_attributeOwnerProxy, CHANNEL_A }; >+ SVGAnimatedEnumerationAttribute<ChannelSelectorType> m_yChannelSelector { m_attributeOwnerProxy, CHANNEL_A }; >+ SVGAnimatedNumberAttribute m_scale { m_attributeOwnerProxy }; > }; > > } // 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