WebKit Bugzilla
Attachment 346343 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 SVGCursorElement
186751-59.patch (text/plain), 8.88 KB, created by
Said Abou-Hallawa
on 2018-08-01 17:58:36 PDT
(
hide
)
Description:
Remove SVG macros from SVGCursorElement
Filename:
MIME Type:
Creator:
Said Abou-Hallawa
Created:
2018-08-01 17:58:36 PDT
Size:
8.88 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 8bff17ca95b..0b807aad50d 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,25 @@ >+2018-08-01 Said Abou-Hallawa <sabouhallawa@apple.com> >+ >+ [59] Remove the SVG elements' attributes macros >+ https://bugs.webkit.org/show_bug.cgi?id=186751 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Remove SVG macros from SVGCursorElement. >+ >+ -- Remove the SVGTests methods. >+ >+ * svg/SVGCursorElement.cpp: >+ (WebCore::SVGCursorElement::SVGCursorElement): >+ (WebCore::SVGCursorElement::registerAttributes): >+ (WebCore::SVGCursorElement::parseAttribute): >+ (WebCore::SVGCursorElement::svgAttributeChanged): >+ (WebCore::SVGCursorElement::isSupportedAttribute): Deleted. >+ (WebCore::SVGCursorElement::requiredFeatures): Deleted. >+ (WebCore::SVGCursorElement::requiredExtensions): Deleted. >+ (WebCore::SVGCursorElement::systemLanguage): Deleted. >+ * svg/SVGCursorElement.h: >+ > 2018-08-01 Said Abou-Hallawa <sabouhallawa@apple.com> > > [58] Remove the SVG elements' attributes macros >diff --git a/Source/WebCore/svg/SVGCursorElement.cpp b/Source/WebCore/svg/SVGCursorElement.cpp >index 070bfde8d05..38e54e1d3f2 100644 >--- a/Source/WebCore/svg/SVGCursorElement.cpp >+++ b/Source/WebCore/svg/SVGCursorElement.cpp >@@ -1,6 +1,7 @@ > /* > * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> > * Copyright (C) 2004, 2005, 2006, 2007 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 >@@ -33,27 +34,14 @@ namespace WebCore { > > WTF_MAKE_ISO_ALLOCATED_IMPL(SVGCursorElement); > >-// Animated property definitions >-DEFINE_ANIMATED_LENGTH(SVGCursorElement, SVGNames::xAttr, X, x) >-DEFINE_ANIMATED_LENGTH(SVGCursorElement, SVGNames::yAttr, Y, y) >-DEFINE_ANIMATED_STRING(SVGCursorElement, XLinkNames::hrefAttr, Href, href) >-DEFINE_ANIMATED_BOOLEAN(SVGCursorElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired) >- >-BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGCursorElement) >- REGISTER_LOCAL_ANIMATED_PROPERTY(x) >- REGISTER_LOCAL_ANIMATED_PROPERTY(y) >- REGISTER_LOCAL_ANIMATED_PROPERTY(href) >- REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) >- REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests) >-END_REGISTER_ANIMATED_PROPERTIES >- > inline SVGCursorElement::SVGCursorElement(const QualifiedName& tagName, Document& document) > : SVGElement(tagName, document) >- , m_x(LengthModeWidth) >- , m_y(LengthModeHeight) >+ , SVGTests(*this) >+ , SVGExternalResourcesRequired(*this) >+ , SVGURIReference(*this) > { > ASSERT(hasTagName(SVGNames::cursorTag)); >- registerAnimatedPropertiesForSVGCursorElement(); >+ registerAttributes(); > } > > Ref<SVGCursorElement> SVGCursorElement::create(const QualifiedName& tagName, Document& document) >@@ -67,17 +55,13 @@ SVGCursorElement::~SVGCursorElement() > client->cursorElementRemoved(*this); > } > >-bool SVGCursorElement::isSupportedAttribute(const QualifiedName& attrName) >+void SVGCursorElement::registerAttributes() > { >- static const auto supportedAttributes = makeNeverDestroyed([] { >- HashSet<QualifiedName> set; >- SVGTests::addSupportedAttributes(set); >- SVGExternalResourcesRequired::addSupportedAttributes(set); >- SVGURIReference::addSupportedAttributes(set); >- set.add({ SVGNames::xAttr.get(), SVGNames::yAttr.get() }); >- return set; >- }()); >- return supportedAttributes.get().contains<SVGAttributeHashTranslator>(attrName); >+ auto& registry = attributeRegistry(); >+ if (!registry.isEmpty()) >+ return; >+ registry.registerAttribute<SVGNames::xAttr, &SVGCursorElement::m_x>(); >+ registry.registerAttribute<SVGNames::yAttr, &SVGCursorElement::m_y>(); > } > > void SVGCursorElement::parseAttribute(const QualifiedName& name, const AtomicString& value) >@@ -85,9 +69,9 @@ void SVGCursorElement::parseAttribute(const QualifiedName& name, const AtomicStr > SVGParsingError parseError = NoError; > > if (name == SVGNames::xAttr) >- setXBaseValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_x.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::yAttr) >- setYBaseValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_y.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > > reportAttributeParsingError(parseError, name, value); > >@@ -109,14 +93,14 @@ void SVGCursorElement::removeClient(CSSCursorImageValue& value) > > void SVGCursorElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (!isSupportedAttribute(attrName)) { >- SVGElement::svgAttributeChanged(attrName); >+ if (isKnownAttribute(attrName)) { >+ InstanceInvalidationGuard guard(*this); >+ for (auto& client : m_clients) >+ client->cursorElementChanged(*this); > return; > } > >- InstanceInvalidationGuard guard(*this); >- for (auto& client : m_clients) >- client->cursorElementChanged(*this); >+ SVGElement::svgAttributeChanged(attrName); > } > > void SVGCursorElement::addSubresourceAttributeURLs(ListHashSet<URL>& urls) const >@@ -126,19 +110,4 @@ void SVGCursorElement::addSubresourceAttributeURLs(ListHashSet<URL>& urls) const > addSubresourceURL(urls, document().completeURL(href())); > } > >-Ref<SVGStringList> SVGCursorElement::requiredFeatures() >-{ >- return SVGTests::requiredFeatures(*this); >-} >- >-Ref<SVGStringList> SVGCursorElement::requiredExtensions() >-{ >- return SVGTests::requiredExtensions(*this); >-} >- >-Ref<SVGStringList> SVGCursorElement::systemLanguage() >-{ >- return SVGTests::systemLanguage(*this); >-} >- > } >diff --git a/Source/WebCore/svg/SVGCursorElement.h b/Source/WebCore/svg/SVGCursorElement.h >index 37eebb0c8ee..b7c5433c209 100644 >--- a/Source/WebCore/svg/SVGCursorElement.h >+++ b/Source/WebCore/svg/SVGCursorElement.h >@@ -1,6 +1,7 @@ > /* > * Copyright (C) 2004, 2005, 2006, 2008 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 >@@ -42,36 +43,32 @@ public: > void addClient(CSSCursorImageValue&); > void removeClient(CSSCursorImageValue&); > >- // SVGTests >- Ref<SVGStringList> requiredFeatures(); >- Ref<SVGStringList> requiredExtensions(); >- Ref<SVGStringList> systemLanguage(); >+ const SVGLengthValue& x() const { return m_x.currentValue(); } >+ const SVGLengthValue& y() const { return m_y.currentValue(); } >+ >+ RefPtr<SVGAnimatedLength> xAnimated() { return m_x.animatedProperty(); } >+ RefPtr<SVGAnimatedLength> yAnimated() { return m_y.animatedProperty(); } > > private: > SVGCursorElement(const QualifiedName&, Document&); > >- bool isValid() const final { return SVGTests::isValid(); } >+ using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGCursorElement, SVGElement, SVGTests, SVGExternalResourcesRequired, SVGURIReference>; >+ static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >+ static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >+ static void registerAttributes(); > >- static bool isSupportedAttribute(const QualifiedName&); >+ const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >+ bool isValid() const final { return SVGTests::isValid(); } > bool rendererIsNeeded(const RenderStyle&) final { return false; } > > void addSubresourceAttributeURLs(ListHashSet<URL>&) const final; > >- BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGCursorElement) >- DECLARE_ANIMATED_LENGTH(X, x) >- DECLARE_ANIMATED_LENGTH(Y, y) >- DECLARE_ANIMATED_STRING_OVERRIDE(Href, href) >- DECLARE_ANIMATED_BOOLEAN_OVERRIDE(ExternalResourcesRequired, externalResourcesRequired) >- END_DECLARE_ANIMATED_PROPERTIES >- >- // SVGTests >- void synchronizeRequiredFeatures() final { SVGTests::synchronizeRequiredFeatures(*this); } >- void synchronizeRequiredExtensions() final { SVGTests::synchronizeRequiredExtensions(*this); } >- void synchronizeSystemLanguage() final { SVGTests::synchronizeSystemLanguage(*this); } >- >+ AttributeOwnerProxy m_attributeOwnerProxy { *this }; >+ SVGAnimatedLengthAttribute m_x { m_attributeOwnerProxy, LengthModeWidth }; >+ SVGAnimatedLengthAttribute m_y { m_attributeOwnerProxy, LengthModeHeight }; > HashSet<CSSCursorImageValue*> m_clients; > }; >
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