WebKit Bugzilla
Attachment 346342 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 SVGFETurbulenceElement
186751-58.patch (text/plain), 10.48 KB, created by
Said Abou-Hallawa
on 2018-08-01 17:58:06 PDT
(
hide
)
Description:
Remove SVG macros from SVGFETurbulenceElement
Filename:
MIME Type:
Creator:
Said Abou-Hallawa
Created:
2018-08-01 17:58:06 PDT
Size:
10.48 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index f4f91d2d3c2..8bff17ca95b 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,20 @@ >+2018-08-01 Said Abou-Hallawa <sabouhallawa@apple.com> >+ >+ [58] Remove the SVG elements' attributes macros >+ https://bugs.webkit.org/show_bug.cgi?id=186751 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Remove SVG macros from SVGFETurbulenceElement. >+ >+ * svg/SVGFETurbulenceElement.cpp: >+ (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement): >+ (WebCore::SVGFETurbulenceElement::registerAttributes): >+ (WebCore::SVGFETurbulenceElement::parseAttribute): >+ (WebCore::SVGFETurbulenceElement::setFilterEffectAttribute): >+ (WebCore::SVGFETurbulenceElement::svgAttributeChanged): >+ * svg/SVGFETurbulenceElement.h: >+ > 2018-08-01 Said Abou-Hallawa <sabouhallawa@apple.com> > > [57] Remove the SVG elements' attributes macros >diff --git a/Source/WebCore/svg/SVGFETurbulenceElement.cpp b/Source/WebCore/svg/SVGFETurbulenceElement.cpp >index 1a15d9c73dd..6b76b847935 100644 >--- a/Source/WebCore/svg/SVGFETurbulenceElement.cpp >+++ b/Source/WebCore/svg/SVGFETurbulenceElement.cpp >@@ -1,6 +1,7 @@ > /* > * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> > * Copyright (C) 2004, 2005, 2006 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 >@@ -29,32 +30,11 @@ namespace WebCore { > > WTF_MAKE_ISO_ALLOCATED_IMPL(SVGFETurbulenceElement); > >-// Animated property definitions >-DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFETurbulenceElement, SVGNames::baseFrequencyAttr, baseFrequencyXIdentifier(), BaseFrequencyX, baseFrequencyX) >-DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFETurbulenceElement, SVGNames::baseFrequencyAttr, baseFrequencyYIdentifier(), BaseFrequencyY, baseFrequencyY) >-DEFINE_ANIMATED_INTEGER(SVGFETurbulenceElement, SVGNames::numOctavesAttr, NumOctaves, numOctaves) >-DEFINE_ANIMATED_NUMBER(SVGFETurbulenceElement, SVGNames::seedAttr, Seed, seed) >-DEFINE_ANIMATED_ENUMERATION(SVGFETurbulenceElement, SVGNames::stitchTilesAttr, StitchTiles, stitchTiles, SVGStitchOptions) >-DEFINE_ANIMATED_ENUMERATION(SVGFETurbulenceElement, SVGNames::typeAttr, Type, type, TurbulenceType) >- >-BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFETurbulenceElement) >- REGISTER_LOCAL_ANIMATED_PROPERTY(baseFrequencyX) >- REGISTER_LOCAL_ANIMATED_PROPERTY(baseFrequencyY) >- REGISTER_LOCAL_ANIMATED_PROPERTY(numOctaves) >- REGISTER_LOCAL_ANIMATED_PROPERTY(seed) >- REGISTER_LOCAL_ANIMATED_PROPERTY(stitchTiles) >- REGISTER_LOCAL_ANIMATED_PROPERTY(type) >- REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes) >-END_REGISTER_ANIMATED_PROPERTIES >- > inline SVGFETurbulenceElement::SVGFETurbulenceElement(const QualifiedName& tagName, Document& document) > : SVGFilterPrimitiveStandardAttributes(tagName, document) >- , m_numOctaves(1) >- , m_stitchTiles(SVG_STITCHTYPE_NOSTITCH) >- , m_type(TurbulenceType::Turbulence) > { > ASSERT(hasTagName(SVGNames::feTurbulenceTag)); >- registerAnimatedPropertiesForSVGFETurbulenceElement(); >+ registerAttributes(); > } > > Ref<SVGFETurbulenceElement> SVGFETurbulenceElement::create(const QualifiedName& tagName, Document& document) >@@ -74,38 +54,52 @@ const AtomicString& SVGFETurbulenceElement::baseFrequencyYIdentifier() > return s_identifier; > } > >+void SVGFETurbulenceElement::registerAttributes() >+{ >+ auto& registry = attributeRegistry(); >+ if (!registry.isEmpty()) >+ return; >+ registry.registerAttribute<SVGNames::baseFrequencyAttr, >+ &SVGFETurbulenceElement::baseFrequencyXIdentifier, &SVGFETurbulenceElement::m_baseFrequencyX, >+ &SVGFETurbulenceElement::baseFrequencyYIdentifier, &SVGFETurbulenceElement::m_baseFrequencyY>(); >+ registry.registerAttribute<SVGNames::numOctavesAttr, &SVGFETurbulenceElement::m_numOctaves>(); >+ registry.registerAttribute<SVGNames::seedAttr, &SVGFETurbulenceElement::m_seed>(); >+ registry.registerAttribute<SVGNames::stitchTilesAttr, SVGStitchOptions, &SVGFETurbulenceElement::m_stitchTiles>(); >+ registry.registerAttribute<SVGNames::typeAttr, TurbulenceType, &SVGFETurbulenceElement::m_type>(); >+} >+ > void SVGFETurbulenceElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::typeAttr) { > TurbulenceType propertyValue = SVGPropertyTraits<TurbulenceType>::fromString(value); > if (propertyValue != TurbulenceType::Unknown) >- setTypeBaseValue(propertyValue); >+ m_type.setValue(propertyValue); > return; > } > > if (name == SVGNames::stitchTilesAttr) { > SVGStitchOptions propertyValue = SVGPropertyTraits<SVGStitchOptions>::fromString(value); > if (propertyValue > 0) >- setStitchTilesBaseValue(propertyValue); >+ m_stitchTiles.setValue(propertyValue); > return; > } > > if (name == SVGNames::baseFrequencyAttr) { > float x, y; > if (parseNumberOptionalNumber(value, x, y)) { >- setBaseFrequencyXBaseValue(x); >- setBaseFrequencyYBaseValue(y); >+ m_baseFrequencyX.setValue(x); >+ m_baseFrequencyY.setValue(y); > } > return; > } > > if (name == SVGNames::seedAttr) { >- setSeedBaseValue(value.toFloat()); >+ m_seed.setValue(value.toFloat()); > return; > } > > if (name == SVGNames::numOctavesAttr) { >- setNumOctavesBaseValue(value.string().toUIntStrict()); >+ m_numOctaves.setValue(value.string().toUIntStrict()); > return; > } > >@@ -124,7 +118,7 @@ bool SVGFETurbulenceElement::setFilterEffectAttribute(FilterEffect* effect, cons > if (attrName == SVGNames::seedAttr) > return turbulence->setSeed(seed()); > if (attrName == SVGNames::numOctavesAttr) >- return turbulence->setNumOctaves(numOctaves()); >+ return turbulence->setNumOctaves(numOctaves()); > > ASSERT_NOT_REACHED(); > return false; >@@ -132,7 +126,7 @@ bool SVGFETurbulenceElement::setFilterEffectAttribute(FilterEffect* effect, cons > > void SVGFETurbulenceElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (attrName == SVGNames::baseFrequencyAttr || attrName == SVGNames::numOctavesAttr || attrName == SVGNames::seedAttr || attrName == SVGNames::stitchTilesAttr || attrName == SVGNames::typeAttr) { >+ if (isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > primitiveAttributeChanged(attrName); > return; >diff --git a/Source/WebCore/svg/SVGFETurbulenceElement.h b/Source/WebCore/svg/SVGFETurbulenceElement.h >index 4f3a096a1c7..756355b00aa 100644 >--- a/Source/WebCore/svg/SVGFETurbulenceElement.h >+++ b/Source/WebCore/svg/SVGFETurbulenceElement.h >@@ -1,6 +1,7 @@ > /* > * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> > * Copyright (C) 2004, 2005, 2006 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 >@@ -97,25 +98,45 @@ class SVGFETurbulenceElement final : public SVGFilterPrimitiveStandardAttributes > public: > static Ref<SVGFETurbulenceElement> create(const QualifiedName&, Document&); > >+ float baseFrequencyX() const { return m_baseFrequencyX.currentValue(); } >+ float baseFrequencyY() const { return m_baseFrequencyY.currentValue(); } >+ int numOctaves() const { return m_numOctaves.currentValue(); } >+ float seed() const { return m_seed.currentValue(); } >+ SVGStitchOptions stitchTiles() const { return m_stitchTiles.currentValue(); } >+ TurbulenceType type() const { return m_type.currentValue(); } >+ >+ RefPtr<SVGAnimatedNumber> baseFrequencyXAnimated() { return m_baseFrequencyX.animatedProperty(); } >+ RefPtr<SVGAnimatedNumber> baseFrequencyYAnimated() { return m_baseFrequencyY.animatedProperty(); } >+ RefPtr<SVGAnimatedInteger> numOctavesAnimated() { return m_numOctaves.animatedProperty(); } >+ RefPtr<SVGAnimatedNumber> seedAnimated() { return m_seed.animatedProperty(); } >+ RefPtr<SVGAnimatedEnumeration> stitchTilesAnimated() { return m_stitchTiles.animatedProperty(); } >+ RefPtr<SVGAnimatedEnumeration> typeAnimated() { return m_type.animatedProperty(); } >+ > private: > SVGFETurbulenceElement(const QualifiedName&, Document&); > >+ using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFETurbulenceElement, 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; > > static const AtomicString& baseFrequencyXIdentifier(); > static const AtomicString& baseFrequencyYIdentifier(); > >- BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFETurbulenceElement) >- DECLARE_ANIMATED_NUMBER(BaseFrequencyX, baseFrequencyX) >- DECLARE_ANIMATED_NUMBER(BaseFrequencyY, baseFrequencyY) >- DECLARE_ANIMATED_INTEGER(NumOctaves, numOctaves) >- DECLARE_ANIMATED_NUMBER(Seed, seed) >- DECLARE_ANIMATED_ENUMERATION(StitchTiles, stitchTiles, SVGStitchOptions) >- DECLARE_ANIMATED_ENUMERATION(Type, type, TurbulenceType) >- END_DECLARE_ANIMATED_PROPERTIES >+ AttributeOwnerProxy m_attributeOwnerProxy { *this }; >+ SVGAnimatedNumberAttribute m_baseFrequencyX { m_attributeOwnerProxy }; >+ SVGAnimatedNumberAttribute m_baseFrequencyY { m_attributeOwnerProxy }; >+ SVGAnimatedIntegerAttribute m_numOctaves { m_attributeOwnerProxy, 1 }; >+ SVGAnimatedNumberAttribute m_seed { m_attributeOwnerProxy }; >+ SVGAnimatedEnumerationAttribute<SVGStitchOptions> m_stitchTiles { m_attributeOwnerProxy, SVG_STITCHTYPE_NOSTITCH }; >+ SVGAnimatedEnumerationAttribute<TurbulenceType> m_type { m_attributeOwnerProxy, TurbulenceType::Turbulence }; > }; > > } // 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