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

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

Issue 668113003: SVGElement::parseAttribute resolves property via property map (Step 2.6) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 months 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
« no previous file with comments | « Source/core/svg/SVGStyleElement.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005 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 * Copyright (C) 2006 Apple Inc. All rights reserved. 4 * Copyright (C) 2006 Apple Inc. All rights reserved.
5 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> 5 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 String SVGStyleElement::title() const 88 String SVGStyleElement::title() const
89 { 89 {
90 return fastGetAttribute(SVGNames::titleAttr); 90 return fastGetAttribute(SVGNames::titleAttr);
91 } 91 }
92 92
93 void SVGStyleElement::setTitle(const AtomicString& title) 93 void SVGStyleElement::setTitle(const AtomicString& title)
94 { 94 {
95 setAttribute(SVGNames::titleAttr, title); 95 setAttribute(SVGNames::titleAttr, title);
96 } 96 }
97 97
98 bool SVGStyleElement::isSupportedAttribute(const QualifiedName& attrName)
99 {
100 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
101 if (supportedAttributes.isEmpty())
102 supportedAttributes.add(SVGNames::titleAttr);
103 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
104 }
105
106 void SVGStyleElement::parseAttribute(const QualifiedName& name, const AtomicStri ng& value) 98 void SVGStyleElement::parseAttribute(const QualifiedName& name, const AtomicStri ng& value)
107 { 99 {
108 if (!isSupportedAttribute(name)) { 100 if (name == SVGNames::titleAttr) {
109 SVGElement::parseAttribute(name, value); 101 if (m_sheet)
102 m_sheet->setTitle(value);
103
110 return; 104 return;
111 } 105 }
112 106
113 if (name == SVGNames::titleAttr) { 107 SVGElement::parseAttribute(name, value);
114 if (m_sheet)
115 m_sheet->setTitle(value);
116 return;
117 }
118
119 ASSERT_NOT_REACHED();
120 } 108 }
121 109
122 void SVGStyleElement::finishParsingChildren() 110 void SVGStyleElement::finishParsingChildren()
123 { 111 {
124 StyleElement::finishParsingChildren(this); 112 StyleElement::finishParsingChildren(this);
125 SVGElement::finishParsingChildren(); 113 SVGElement::finishParsingChildren();
126 } 114 }
127 115
128 Node::InsertionNotificationRequest SVGStyleElement::insertedInto(ContainerNode* rootParent) 116 Node::InsertionNotificationRequest SVGStyleElement::insertedInto(ContainerNode* rootParent)
129 { 117 {
(...skipping 19 matching lines...) Expand all
149 StyleElement::childrenChanged(this); 137 StyleElement::childrenChanged(this);
150 } 138 }
151 139
152 void SVGStyleElement::trace(Visitor* visitor) 140 void SVGStyleElement::trace(Visitor* visitor)
153 { 141 {
154 StyleElement::trace(visitor); 142 StyleElement::trace(visitor);
155 SVGElement::trace(visitor); 143 SVGElement::trace(visitor);
156 } 144 }
157 145
158 } 146 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGStyleElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698