WebKit Bugzilla
Attachment 346319 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 SVGAElement
186751-36.patch (text/plain), 7.00 KB, created by
Said Abou-Hallawa
on 2018-08-01 17:43:17 PDT
(
hide
)
Description:
Remove SVG macros from SVGAElement
Filename:
MIME Type:
Creator:
Said Abou-Hallawa
Created:
2018-08-01 17:43:17 PDT
Size:
7.00 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 9c54af4f958..41f0c51f94a 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,24 @@ >+2018-08-01 Said Abou-Hallawa <sabouhallawa@apple.com> >+ >+ [36] Remove the SVG elements' attributes macros >+ https://bugs.webkit.org/show_bug.cgi?id=186751 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Remove SVG macros from SVGAElement. >+ >+ -- No need to implement the attribute 'target' as 'svgTarget'. >+ -- No need to include the attributes of the base classes SVGURIReference >+ and SVGExternalResourcesRequired. >+ >+ * svg/SVGAElement.cpp: >+ (WebCore::SVGAElement::SVGAElement): >+ (WebCore::SVGAElement::registerAttributes): >+ (WebCore::SVGAElement::parseAttribute): >+ (WebCore::SVGAElement::svgAttributeChanged): >+ * svg/SVGAElement.h: >+ * svg/SVGAElement.idl: >+ > 2018-08-01 Said Abou-Hallawa <sabouhallawa@apple.com> > > [35] Remove the SVG elements' attributes macros >diff --git a/Source/WebCore/svg/SVGAElement.cpp b/Source/WebCore/svg/SVGAElement.cpp >index 92f21045e2a..e41f92dee05 100644 >--- a/Source/WebCore/svg/SVGAElement.cpp >+++ b/Source/WebCore/svg/SVGAElement.cpp >@@ -2,7 +2,7 @@ > * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> > * Copyright (C) 2004, 2005, 2007 Rob Buis <buis@kde.org> > * Copyright (C) 2007 Eric Seidel <eric@webkit.org> >- * Copyright (C) 2010 Apple Inc. All rights reserved. >+ * Copyright (C) 2010-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 >@@ -46,23 +46,13 @@ namespace WebCore { > > WTF_MAKE_ISO_ALLOCATED_IMPL(SVGAElement); > >-// Animated property definitions >-DEFINE_ANIMATED_STRING(SVGAElement, SVGNames::targetAttr, SVGTarget, svgTarget) >-DEFINE_ANIMATED_STRING(SVGAElement, XLinkNames::hrefAttr, Href, href) >-DEFINE_ANIMATED_BOOLEAN(SVGAElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired) >- >-BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGAElement) >- REGISTER_LOCAL_ANIMATED_PROPERTY(svgTarget) >- REGISTER_LOCAL_ANIMATED_PROPERTY(href) >- REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) >- REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement) >-END_REGISTER_ANIMATED_PROPERTIES >- > inline SVGAElement::SVGAElement(const QualifiedName& tagName, Document& document) > : SVGGraphicsElement(tagName, document) >+ , SVGURIReference(*this) >+ , SVGExternalResourcesRequired(*this) > { > ASSERT(hasTagName(SVGNames::aTag)); >- registerAnimatedPropertiesForSVGAElement(); >+ registerAttributes(); > } > > Ref<SVGAElement> SVGAElement::create(const QualifiedName& tagName, Document& document) >@@ -81,10 +71,18 @@ String SVGAElement::title() const > return SVGElement::title(); > } > >+void SVGAElement::registerAttributes() >+{ >+ auto& registry = attributeRegistry(); >+ if (!registry.isEmpty()) >+ return; >+ registry.registerAttribute<SVGNames::targetAttr, &SVGAElement::m_target>(); >+} >+ > void SVGAElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::targetAttr) { >- setSVGTargetBaseValue(value); >+ m_target.setValue(value); > return; > } > >@@ -102,9 +100,11 @@ void SVGAElement::svgAttributeChanged(const QualifiedName& attrName) > InstanceInvalidationGuard guard(*this); > invalidateStyleForSubtree(); > } >+ return; > } > > SVGGraphicsElement::svgAttributeChanged(attrName); >+ SVGExternalResourcesRequired::svgAttributeChanged(attrName); > } > > RenderPtr<RenderElement> SVGAElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&) >diff --git a/Source/WebCore/svg/SVGAElement.h b/Source/WebCore/svg/SVGAElement.h >index 254212e6486..e5ba4e34649 100644 >--- a/Source/WebCore/svg/SVGAElement.h >+++ b/Source/WebCore/svg/SVGAElement.h >@@ -2,6 +2,7 @@ > * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> > * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> > * Copyright (C) 2007 Eric Seidel <eric@webkit.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 >@@ -33,20 +34,25 @@ class SVGAElement final : public SVGGraphicsElement, public SVGURIReference, pub > public: > static Ref<SVGAElement> create(const QualifiedName&, Document&); > >+ auto targetAnimated() { return m_target.animatedProperty(); } >+ > private: > SVGAElement(const QualifiedName&, Document&); > >- bool isValid() const final { return SVGTests::isValid(); } >- >- String title() const final; >- String target() const final { return svgTarget(); } >+ using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGAElement, SVGGraphicsElement, SVGURIReference, SVGExternalResourcesRequired>; >+ static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >+ static void registerAttributes(); > >+ const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final; > bool childShouldCreateRenderer(const Node&) const final; > >+ bool isValid() const final { return SVGTests::isValid(); } >+ String title() const final; >+ String target() const final { return svgTarget(); } > void defaultEventHandler(Event&) final; > > bool supportsFocus() const final; >@@ -58,13 +64,8 @@ private: > > bool willRespondToMouseClickEvents() final; > >- BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGAElement) >- // This declaration used to define a non-virtual "String& target() const" method, that clashes with "virtual String Element::target() const". >- // That's why it has been renamed to "svgTarget", the CodeGenerators take care of calling svgTargetAnimated() instead of targetAnimated(), see CodeGenerator.pm. >- DECLARE_ANIMATED_STRING(SVGTarget, svgTarget) >- DECLARE_ANIMATED_STRING_OVERRIDE(Href, href) >- DECLARE_ANIMATED_BOOLEAN_OVERRIDE(ExternalResourcesRequired, externalResourcesRequired) >- END_DECLARE_ANIMATED_PROPERTIES >+ AttributeOwnerProxy m_attributeOwnerProxy { *this }; >+ SVGAnimatedStringAttribute m_target { m_attributeOwnerProxy }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGAElement.idl b/Source/WebCore/svg/SVGAElement.idl >index 3ede6dc9cb6..28795aad4ed 100644 >--- a/Source/WebCore/svg/SVGAElement.idl >+++ b/Source/WebCore/svg/SVGAElement.idl >@@ -24,7 +24,7 @@ > */ > > interface SVGAElement : SVGGraphicsElement { >- [ImplementedAs=svgTarget] readonly attribute SVGAnimatedString target; >+ readonly attribute SVGAnimatedString target; > }; > > SVGAElement implements SVGExternalResourcesRequired;
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