WebKit Bugzilla
Attachment 346340 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 SVGFESpecularLightingElement
186751-56.patch (text/plain), 9.58 KB, created by
Said Abou-Hallawa
on 2018-08-01 17:56:56 PDT
(
hide
)
Description:
Remove SVG macros from SVGFESpecularLightingElement
Filename:
MIME Type:
Creator:
Said Abou-Hallawa
Created:
2018-08-01 17:56:56 PDT
Size:
9.58 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 2b24f6b214b..d3547afb1af 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,18 @@ >+2018-08-01 Said Abou-Hallawa <sabouhallawa@apple.com> >+ >+ [56] Remove the SVG elements' attributes macros >+ https://bugs.webkit.org/show_bug.cgi?id=186751 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Remove SVG macros from SVGFESpecularLightingElement. >+ >+ * svg/SVGFESpecularLightingElement.cpp: >+ (WebCore::SVGFESpecularLightingElement::SVGFESpecularLightingElement): >+ (WebCore::SVGFESpecularLightingElement::registerAttributes): >+ (WebCore::SVGFESpecularLightingElement::parseAttribute): >+ * svg/SVGFESpecularLightingElement.h: >+ > 2018-08-01 Said Abou-Hallawa <sabouhallawa@apple.com> > > [55] Remove the SVG elements' attributes macros >diff --git a/Source/WebCore/svg/SVGFESpecularLightingElement.cpp b/Source/WebCore/svg/SVGFESpecularLightingElement.cpp >index b0454c21209..3a2f4d23f97 100644 >--- a/Source/WebCore/svg/SVGFESpecularLightingElement.cpp >+++ b/Source/WebCore/svg/SVGFESpecularLightingElement.cpp >@@ -2,6 +2,7 @@ > * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> > * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> > * Copyright (C) 2005 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 >@@ -34,32 +35,11 @@ namespace WebCore { > > WTF_MAKE_ISO_ALLOCATED_IMPL(SVGFESpecularLightingElement); > >-// Animated property definitions >-DEFINE_ANIMATED_STRING(SVGFESpecularLightingElement, SVGNames::inAttr, In1, in1) >-DEFINE_ANIMATED_NUMBER(SVGFESpecularLightingElement, SVGNames::specularConstantAttr, SpecularConstant, specularConstant) >-DEFINE_ANIMATED_NUMBER(SVGFESpecularLightingElement, SVGNames::specularExponentAttr, SpecularExponent, specularExponent) >-DEFINE_ANIMATED_NUMBER(SVGFESpecularLightingElement, SVGNames::surfaceScaleAttr, SurfaceScale, surfaceScale) >-DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFESpecularLightingElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthXIdentifier(), KernelUnitLengthX, kernelUnitLengthX) >-DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFESpecularLightingElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthYIdentifier(), KernelUnitLengthY, kernelUnitLengthY) >- >-BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFESpecularLightingElement) >- REGISTER_LOCAL_ANIMATED_PROPERTY(in1) >- REGISTER_LOCAL_ANIMATED_PROPERTY(specularConstant) >- REGISTER_LOCAL_ANIMATED_PROPERTY(specularExponent) >- REGISTER_LOCAL_ANIMATED_PROPERTY(surfaceScale) >- REGISTER_LOCAL_ANIMATED_PROPERTY(kernelUnitLengthX) >- REGISTER_LOCAL_ANIMATED_PROPERTY(kernelUnitLengthY) >- REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes) >-END_REGISTER_ANIMATED_PROPERTIES >- > inline SVGFESpecularLightingElement::SVGFESpecularLightingElement(const QualifiedName& tagName, Document& document) > : SVGFilterPrimitiveStandardAttributes(tagName, document) >- , m_specularConstant(1) >- , m_specularExponent(1) >- , m_surfaceScale(1) > { > ASSERT(hasTagName(SVGNames::feSpecularLightingTag)); >- registerAnimatedPropertiesForSVGFESpecularLightingElement(); >+ registerAttributes(); > } > > Ref<SVGFESpecularLightingElement> SVGFESpecularLightingElement::create(const QualifiedName& tagName, Document& document) >@@ -79,33 +59,47 @@ const AtomicString& SVGFESpecularLightingElement::kernelUnitLengthYIdentifier() > return s_identifier; > } > >+void SVGFESpecularLightingElement::registerAttributes() >+{ >+ auto& registry = attributeRegistry(); >+ if (!registry.isEmpty()) >+ return; >+ registry.registerAttribute<SVGNames::inAttr, &SVGFESpecularLightingElement::m_in1>(); >+ registry.registerAttribute<SVGNames::specularConstantAttr, &SVGFESpecularLightingElement::m_specularConstant>(); >+ registry.registerAttribute<SVGNames::specularExponentAttr, &SVGFESpecularLightingElement::m_specularExponent>(); >+ registry.registerAttribute<SVGNames::surfaceScaleAttr, &SVGFESpecularLightingElement::m_surfaceScale>(); >+ registry.registerAttribute<SVGNames::kernelUnitLengthAttr, >+ &SVGFESpecularLightingElement::kernelUnitLengthXIdentifier, &SVGFESpecularLightingElement::m_kernelUnitLengthX, >+ &SVGFESpecularLightingElement::kernelUnitLengthYIdentifier, &SVGFESpecularLightingElement::m_kernelUnitLengthY>(); >+} >+ > void SVGFESpecularLightingElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::inAttr) { >- setIn1BaseValue(value); >+ m_in1.setValue(value); > return; > } > > if (name == SVGNames::surfaceScaleAttr) { >- setSurfaceScaleBaseValue(value.toFloat()); >+ m_surfaceScale.setValue(value.toFloat()); > return; > } > > if (name == SVGNames::specularConstantAttr) { >- setSpecularConstantBaseValue(value.toFloat()); >+ m_specularConstant.setValue(value.toFloat()); > return; > } > > if (name == SVGNames::specularExponentAttr) { >- setSpecularExponentBaseValue(value.toFloat()); >+ m_specularExponent.setValue(value.toFloat()); > return; > } > > if (name == SVGNames::kernelUnitLengthAttr) { > float x, y; > if (parseNumberOptionalNumber(value, x, y)) { >- setKernelUnitLengthXBaseValue(x); >- setKernelUnitLengthYBaseValue(y); >+ m_kernelUnitLengthX.setValue(x); >+ m_kernelUnitLengthY.setValue(y); > } > return; > } >diff --git a/Source/WebCore/svg/SVGFESpecularLightingElement.h b/Source/WebCore/svg/SVGFESpecularLightingElement.h >index fed1ce448e5..0e66102eca2 100644 >--- a/Source/WebCore/svg/SVGFESpecularLightingElement.h >+++ b/Source/WebCore/svg/SVGFESpecularLightingElement.h >@@ -2,6 +2,7 @@ > * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> > * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> > * Copyright (C) 2005 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 >@@ -34,25 +35,45 @@ public: > static Ref<SVGFESpecularLightingElement> create(const QualifiedName&, Document&); > void lightElementAttributeChanged(const SVGFELightElement*, const QualifiedName&); > >+ String in1() const { return m_in1.currentValue(); } >+ float specularConstant() const { return m_specularConstant.currentValue(); } >+ float specularExponent() const { return m_specularExponent.currentValue(); } >+ float surfaceScale() const { return m_surfaceScale.currentValue(); } >+ float kernelUnitLengthX() const { return m_kernelUnitLengthX.currentValue(); } >+ float kernelUnitLengthY() const { return m_kernelUnitLengthY.currentValue(); } >+ >+ RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(); } >+ RefPtr<SVGAnimatedNumber> specularConstantAnimated() { return m_specularConstant.animatedProperty(); } >+ RefPtr<SVGAnimatedNumber> specularExponentAnimated() { return m_specularExponent.animatedProperty(); } >+ RefPtr<SVGAnimatedNumber> surfaceScaleAnimated() { return m_surfaceScale.animatedProperty(); } >+ RefPtr<SVGAnimatedNumber> kernelUnitLengthXAnimated() { return m_kernelUnitLengthX.animatedProperty(); } >+ RefPtr<SVGAnimatedNumber> kernelUnitLengthYAnimated() { return m_kernelUnitLengthY.animatedProperty(); } >+ > private: > SVGFESpecularLightingElement(const QualifiedName&, Document&); >- >+ >+ using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFESpecularLightingElement, 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&) override; > void svgAttributeChanged(const QualifiedName&) override; >+ >+ bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override; > RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; > > static const AtomicString& kernelUnitLengthXIdentifier(); > static const AtomicString& kernelUnitLengthYIdentifier(); > >- BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFESpecularLightingElement) >- DECLARE_ANIMATED_STRING(In1, in1) >- DECLARE_ANIMATED_NUMBER(SpecularConstant, specularConstant) >- DECLARE_ANIMATED_NUMBER(SpecularExponent, specularExponent) >- DECLARE_ANIMATED_NUMBER(SurfaceScale, surfaceScale) >- DECLARE_ANIMATED_NUMBER(KernelUnitLengthX, kernelUnitLengthX) >- DECLARE_ANIMATED_NUMBER(KernelUnitLengthY, kernelUnitLengthY) >- END_DECLARE_ANIMATED_PROPERTIES >+ AttributeOwnerProxy m_attributeOwnerProxy { *this }; >+ SVGAnimatedStringAttribute m_in1 { m_attributeOwnerProxy }; >+ SVGAnimatedNumberAttribute m_specularConstant { m_attributeOwnerProxy, 1 }; >+ SVGAnimatedNumberAttribute m_specularExponent { m_attributeOwnerProxy, 1 }; >+ SVGAnimatedNumberAttribute m_surfaceScale { m_attributeOwnerProxy, 1 }; >+ SVGAnimatedNumberAttribute m_kernelUnitLengthX { m_attributeOwnerProxy }; >+ SVGAnimatedNumberAttribute m_kernelUnitLengthY { 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