Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: Source/core/svg/SVGCursorElement.cpp

Issue 62083002: Remove support for the externalResourcesRequired attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 15 matching lines...) Expand all
26 #include "XLinkNames.h" 26 #include "XLinkNames.h"
27 #include "core/dom/Document.h" 27 #include "core/dom/Document.h"
28 #include "core/svg/SVGElementInstance.h" 28 #include "core/svg/SVGElementInstance.h"
29 29
30 namespace WebCore { 30 namespace WebCore {
31 31
32 // Animated property definitions 32 // Animated property definitions
33 DEFINE_ANIMATED_LENGTH(SVGCursorElement, SVGNames::xAttr, X, x) 33 DEFINE_ANIMATED_LENGTH(SVGCursorElement, SVGNames::xAttr, X, x)
34 DEFINE_ANIMATED_LENGTH(SVGCursorElement, SVGNames::yAttr, Y, y) 34 DEFINE_ANIMATED_LENGTH(SVGCursorElement, SVGNames::yAttr, Y, y)
35 DEFINE_ANIMATED_STRING(SVGCursorElement, XLinkNames::hrefAttr, Href, href) 35 DEFINE_ANIMATED_STRING(SVGCursorElement, XLinkNames::hrefAttr, Href, href)
36 DEFINE_ANIMATED_BOOLEAN(SVGCursorElement, SVGNames::externalResourcesRequiredAtt r, ExternalResourcesRequired, externalResourcesRequired)
37 36
38 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGCursorElement) 37 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGCursorElement)
39 REGISTER_LOCAL_ANIMATED_PROPERTY(x) 38 REGISTER_LOCAL_ANIMATED_PROPERTY(x)
40 REGISTER_LOCAL_ANIMATED_PROPERTY(y) 39 REGISTER_LOCAL_ANIMATED_PROPERTY(y)
41 REGISTER_LOCAL_ANIMATED_PROPERTY(href) 40 REGISTER_LOCAL_ANIMATED_PROPERTY(href)
42 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
43 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests) 41 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
44 END_REGISTER_ANIMATED_PROPERTIES 42 END_REGISTER_ANIMATED_PROPERTIES
45 43
46 inline SVGCursorElement::SVGCursorElement(const QualifiedName& tagName, Document & document) 44 inline SVGCursorElement::SVGCursorElement(const QualifiedName& tagName, Document & document)
47 : SVGElement(tagName, document) 45 : SVGElement(tagName, document)
48 , m_x(LengthModeWidth) 46 , m_x(LengthModeWidth)
49 , m_y(LengthModeHeight) 47 , m_y(LengthModeHeight)
50 { 48 {
51 ASSERT(hasTagName(SVGNames::cursorTag)); 49 ASSERT(hasTagName(SVGNames::cursorTag));
52 ScriptWrappable::init(this); 50 ScriptWrappable::init(this);
(...skipping 10 matching lines...) Expand all
63 HashSet<SVGElement*>::iterator end = m_clients.end(); 61 HashSet<SVGElement*>::iterator end = m_clients.end();
64 for (HashSet<SVGElement*>::iterator it = m_clients.begin(); it != end; ++it) 62 for (HashSet<SVGElement*>::iterator it = m_clients.begin(); it != end; ++it)
65 (*it)->cursorElementRemoved(); 63 (*it)->cursorElementRemoved();
66 } 64 }
67 65
68 bool SVGCursorElement::isSupportedAttribute(const QualifiedName& attrName) 66 bool SVGCursorElement::isSupportedAttribute(const QualifiedName& attrName)
69 { 67 {
70 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); 68 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
71 if (supportedAttributes.isEmpty()) { 69 if (supportedAttributes.isEmpty()) {
72 SVGTests::addSupportedAttributes(supportedAttributes); 70 SVGTests::addSupportedAttributes(supportedAttributes);
73 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes );
74 SVGURIReference::addSupportedAttributes(supportedAttributes); 71 SVGURIReference::addSupportedAttributes(supportedAttributes);
75 supportedAttributes.add(SVGNames::xAttr); 72 supportedAttributes.add(SVGNames::xAttr);
76 supportedAttributes.add(SVGNames::yAttr); 73 supportedAttributes.add(SVGNames::yAttr);
77 } 74 }
78 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); 75 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
79 } 76 }
80 77
81 void SVGCursorElement::parseAttribute(const QualifiedName& name, const AtomicStr ing& value) 78 void SVGCursorElement::parseAttribute(const QualifiedName& name, const AtomicStr ing& value)
82 { 79 {
83 SVGParsingError parseError = NoError; 80 SVGParsingError parseError = NoError;
84 81
85 if (!isSupportedAttribute(name)) 82 if (!isSupportedAttribute(name))
86 SVGElement::parseAttribute(name, value); 83 SVGElement::parseAttribute(name, value);
87 else if (name == SVGNames::xAttr) 84 else if (name == SVGNames::xAttr)
88 setXBaseValue(SVGLength::construct(LengthModeWidth, value, parseError)); 85 setXBaseValue(SVGLength::construct(LengthModeWidth, value, parseError));
89 else if (name == SVGNames::yAttr) 86 else if (name == SVGNames::yAttr)
90 setYBaseValue(SVGLength::construct(LengthModeHeight, value, parseError)) ; 87 setYBaseValue(SVGLength::construct(LengthModeHeight, value, parseError)) ;
91 else if (SVGTests::parseAttribute(name, value) 88 else if (SVGTests::parseAttribute(name, value)
92 || SVGExternalResourcesRequired::parseAttribute(name, value)
93 || SVGURIReference::parseAttribute(name, value)) { 89 || SVGURIReference::parseAttribute(name, value)) {
94 } else 90 } else
95 ASSERT_NOT_REACHED(); 91 ASSERT_NOT_REACHED();
96 92
97 reportAttributeParsingError(parseError, name, value); 93 reportAttributeParsingError(parseError, name, value);
98 } 94 }
99 95
100 void SVGCursorElement::addClient(SVGElement* element) 96 void SVGCursorElement::addClient(SVGElement* element)
101 { 97 {
102 m_clients.add(element); 98 m_clients.add(element);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 } 131 }
136 132
137 void SVGCursorElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) cons t 133 void SVGCursorElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) cons t
138 { 134 {
139 SVGElement::addSubresourceAttributeURLs(urls); 135 SVGElement::addSubresourceAttributeURLs(urls);
140 136
141 addSubresourceURL(urls, document().completeURL(hrefCurrentValue())); 137 addSubresourceURL(urls, document().completeURL(hrefCurrentValue()));
142 } 138 }
143 139
144 } 140 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698