WebKit Bugzilla
Attachment 346534 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 SVGScriptElement
186751-83.patch (text/plain), 9.76 KB, created by
Said Abou-Hallawa
on 2018-08-03 12:45:19 PDT
(
hide
)
Description:
Remove SVG macros from SVGScriptElement
Filename:
MIME Type:
Creator:
Said Abou-Hallawa
Created:
2018-08-03 12:45:19 PDT
Size:
9.76 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index fc1ef0f2e62..78cf95f3bd8 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,30 @@ >+2018-08-02 Said Abou-Hallawa <sabouhallawa@apple.com> >+ >+ [83] Remove the SVG elements' attributes macros >+ https://bugs.webkit.org/show_bug.cgi?id=186751 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Remove SVG macros from SVGScriptElement. >+ >+ * svg/SVGScriptElement.cpp: >+ (WebCore::SVGScriptElement::SVGScriptElement): >+ (WebCore::SVGScriptElement::svgAttributeChanged): >+ (WebCore::SVGScriptElement::addSubresourceAttributeURLs const): >+ (WebCore::SVGScriptElement::isURLAttribute const): Deleted. >+ (WebCore::SVGScriptElement::sourceAttributeValue const): Deleted. >+ (WebCore::SVGScriptElement::charsetAttributeValue const): Deleted. >+ (WebCore::SVGScriptElement::typeAttributeValue const): Deleted. >+ (WebCore::SVGScriptElement::languageAttributeValue const): Deleted. >+ (WebCore::SVGScriptElement::forAttributeValue const): Deleted. >+ (WebCore::SVGScriptElement::eventAttributeValue const): Deleted. >+ (WebCore::SVGScriptElement::hasAsyncAttribute const): Deleted. >+ (WebCore::SVGScriptElement::hasDeferAttribute const): Deleted. >+ (WebCore::SVGScriptElement::hasNoModuleAttribute const): Deleted. >+ (WebCore::SVGScriptElement::hasSourceAttribute const): Deleted. >+ (WebCore::SVGScriptElement::filterOutAnimatableAttribute const): Deleted. >+ * svg/SVGScriptElement.h: >+ > 2018-08-02 Said Abou-Hallawa <sabouhallawa@apple.com> > > [82] Remove the SVG elements' attributes macros >diff --git a/Source/WebCore/svg/SVGScriptElement.cpp b/Source/WebCore/svg/SVGScriptElement.cpp >index a0ef60a92e4..c951247bd7f 100644 >--- a/Source/WebCore/svg/SVGScriptElement.cpp >+++ b/Source/WebCore/svg/SVGScriptElement.cpp >@@ -1,6 +1,7 @@ > /* > * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> > * Copyright (C) 2004, 2005, 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 >@@ -31,22 +32,14 @@ namespace WebCore { > > WTF_MAKE_ISO_ALLOCATED_IMPL(SVGScriptElement); > >-// Animated property definitions >-DEFINE_ANIMATED_STRING(SVGScriptElement, XLinkNames::hrefAttr, Href, href) >-DEFINE_ANIMATED_BOOLEAN(SVGScriptElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired) >- >-BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGScriptElement) >- REGISTER_LOCAL_ANIMATED_PROPERTY(href) >- REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) >-END_REGISTER_ANIMATED_PROPERTIES >- > inline SVGScriptElement::SVGScriptElement(const QualifiedName& tagName, Document& document, bool wasInsertedByParser, bool alreadyStarted) > : SVGElement(tagName, document) >+ , SVGURIReference(*this) >+ , SVGExternalResourcesRequired(*this) > , ScriptElement(*this, wasInsertedByParser, alreadyStarted) > , m_svgLoadEventTimer(*this, &SVGElement::svgLoadEventTimerFired) > { > ASSERT(hasTagName(SVGNames::scriptTag)); >- registerAnimatedPropertiesForSVGScriptElement(); > } > > Ref<SVGScriptElement> SVGScriptElement::create(const QualifiedName& tagName, Document& document, bool insertedByParser) >@@ -70,15 +63,15 @@ void SVGScriptElement::svgAttributeChanged(const QualifiedName& attrName) > return; > } > >- SVGExternalResourcesRequired::handleAttributeChange(this, attrName); > SVGElement::svgAttributeChanged(attrName); >+ SVGExternalResourcesRequired::handleAttributeChange(attrName); > } > > Node::InsertedIntoAncestorResult SVGScriptElement::insertedIntoAncestor(InsertionType insertionType, ContainerNode& parentOfInsertedTree) > { > SVGElement::insertedIntoAncestor(insertionType, parentOfInsertedTree); > if (insertionType.connectedToDocument) >- SVGExternalResourcesRequired::insertedIntoDocument(this); >+ SVGExternalResourcesRequired::insertedIntoDocument(); > return ScriptElement::insertedIntoAncestor(insertionType, parentOfInsertedTree); > } > >@@ -93,11 +86,6 @@ void SVGScriptElement::childrenChanged(const ChildChange& change) > ScriptElement::childrenChanged(change); > } > >-bool SVGScriptElement::isURLAttribute(const Attribute& attribute) const >-{ >- return attribute.name() == sourceAttributeValue(); >-} >- > void SVGScriptElement::finishParsingChildren() > { > SVGElement::finishParsingChildren(); >@@ -110,67 +98,9 @@ void SVGScriptElement::addSubresourceAttributeURLs(ListHashSet<URL>& urls) const > > addSubresourceURL(urls, document().completeURL(href())); > } >- >-String SVGScriptElement::sourceAttributeValue() const >-{ >- return href(); >-} >- >-String SVGScriptElement::charsetAttributeValue() const >-{ >- return String(); >-} >- >-String SVGScriptElement::typeAttributeValue() const >-{ >- return getAttribute(SVGNames::typeAttr).string(); >-} >- >-String SVGScriptElement::languageAttributeValue() const >-{ >- return String(); >-} >- >-String SVGScriptElement::forAttributeValue() const >-{ >- return String(); >-} >- >-String SVGScriptElement::eventAttributeValue() const >-{ >- return String(); >-} >- >-bool SVGScriptElement::hasAsyncAttribute() const >-{ >- return false; >-} >- >-bool SVGScriptElement::hasDeferAttribute() const >-{ >- return false; >-} >- >-bool SVGScriptElement::hasNoModuleAttribute() const >-{ >- return false; >-} >- >-bool SVGScriptElement::hasSourceAttribute() const >-{ >- return hasAttribute(XLinkNames::hrefAttr); >-} >- > Ref<Element> SVGScriptElement::cloneElementWithoutAttributesAndChildren(Document& targetDocument) > { > return adoptRef(*new SVGScriptElement(tagQName(), targetDocument, false, alreadyStarted())); > } > >-#ifndef NDEBUG >-bool SVGScriptElement::filterOutAnimatableAttribute(const QualifiedName& name) const >-{ >- return name == SVGNames::typeAttr; >-} >-#endif >- > } >diff --git a/Source/WebCore/svg/SVGScriptElement.h b/Source/WebCore/svg/SVGScriptElement.h >index 1703b00a63e..51b73d2334c 100644 >--- a/Source/WebCore/svg/SVGScriptElement.h >+++ b/Source/WebCore/svg/SVGScriptElement.h >@@ -1,7 +1,7 @@ > /* > * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> > * Copyright (C) 2004, 2005, 2007 Rob Buis <buis@kde.org> >- * Copyright (C) 2008-2017 Apple Inc. All rights reserved. >+ * Copyright (C) 2008-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 >@@ -41,31 +41,34 @@ public: > private: > SVGScriptElement(const QualifiedName&, Document&, bool wasInsertedByParser, bool alreadyStarted); > >+ using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGScriptElement, SVGElement, SVGURIReference, SVGExternalResourcesRequired>; >+ >+ const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; >+ void svgAttributeChanged(const QualifiedName&) final; >+ > InsertedIntoAncestorResult insertedIntoAncestor(InsertionType, ContainerNode&) final; > void didFinishInsertingNode() final; > void childrenChanged(const ChildChange&) final; > >- void svgAttributeChanged(const QualifiedName&) final; >- bool isURLAttribute(const Attribute&) const final; >+ bool isURLAttribute(const Attribute& attribute) const final { return attribute.name() == sourceAttributeValue(); } > void finishParsingChildren() final; >- > void addSubresourceAttributeURLs(ListHashSet<URL>&) const final; > > bool haveLoadedRequiredResources() final { return SVGExternalResourcesRequired::haveLoadedRequiredResources(); } > >- String sourceAttributeValue() const final; >- String charsetAttributeValue() const final; >- String typeAttributeValue() const final; >- String languageAttributeValue() const final; >- String forAttributeValue() const final; >- String eventAttributeValue() const final; >- bool hasAsyncAttribute() const final; >- bool hasDeferAttribute() const final; >- bool hasNoModuleAttribute() const final; >- bool hasSourceAttribute() const final; >+ String sourceAttributeValue() const final { return href(); } >+ String charsetAttributeValue() const final { return String(); } >+ String typeAttributeValue() const final { return getAttribute(SVGNames::typeAttr).string(); } >+ String languageAttributeValue() const final { return String(); } >+ String forAttributeValue() const final { return String(); } >+ String eventAttributeValue() const final { return String(); } >+ bool hasAsyncAttribute() const final { return false; } >+ bool hasDeferAttribute() const final { return false; } >+ bool hasNoModuleAttribute() const final { return false; } >+ bool hasSourceAttribute() const final { return hasAttribute(XLinkNames::hrefAttr); } > >- void dispatchLoadEvent() final { SVGExternalResourcesRequired::dispatchLoadEvent(this); } >+ void dispatchLoadEvent() final { SVGExternalResourcesRequired::dispatchLoadEvent(); } > > Ref<Element> cloneElementWithoutAttributesAndChildren(Document&) final; > bool rendererIsNeeded(const RenderStyle&) final { return false; } >@@ -77,14 +80,10 @@ private: > Timer* svgLoadEventTimer() final { return &m_svgLoadEventTimer; } > > #ifndef NDEBUG >- bool filterOutAnimatableAttribute(const QualifiedName&) const final; >+ bool filterOutAnimatableAttribute(const QualifiedName& name) const final { return name == SVGNames::typeAttr; } > #endif > >- BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGScriptElement) >- DECLARE_ANIMATED_STRING_OVERRIDE(Href, href) >- DECLARE_ANIMATED_BOOLEAN_OVERRIDE(ExternalResourcesRequired, externalResourcesRequired) >- END_DECLARE_ANIMATED_PROPERTIES >- >+ AttributeOwnerProxy m_attributeOwnerProxy { *this }; > Timer m_svgLoadEventTimer; > }; >
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