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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGTextContentElement.cpp

Issue 1844223002: Literal AtomicString construction can rely on strlen optimization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 bool SVGTextContentElement::isPresentationAttribute(const QualifiedName& name) c onst 203 bool SVGTextContentElement::isPresentationAttribute(const QualifiedName& name) c onst
204 { 204 {
205 if (name.matches(XMLNames::spaceAttr)) 205 if (name.matches(XMLNames::spaceAttr))
206 return true; 206 return true;
207 return SVGGraphicsElement::isPresentationAttribute(name); 207 return SVGGraphicsElement::isPresentationAttribute(name);
208 } 208 }
209 209
210 void SVGTextContentElement::collectStyleForPresentationAttribute(const Qualified Name& name, const AtomicString& value, MutableStylePropertySet* style) 210 void SVGTextContentElement::collectStyleForPresentationAttribute(const Qualified Name& name, const AtomicString& value, MutableStylePropertySet* style)
211 { 211 {
212 if (name.matches(XMLNames::spaceAttr)) { 212 if (name.matches(XMLNames::spaceAttr)) {
213 DEFINE_STATIC_LOCAL(const AtomicString, preserveString, ("preserve", Ato micString::ConstructFromLiteral)); 213 DEFINE_STATIC_LOCAL(const AtomicString, preserveString, ("preserve"));
214 214
215 if (value == preserveString) { 215 if (value == preserveString) {
216 UseCounter::count(document(), UseCounter::WhiteSpacePreFromXMLSpace) ; 216 UseCounter::count(document(), UseCounter::WhiteSpacePreFromXMLSpace) ;
217 addPropertyToPresentationAttributeStyle(style, CSSPropertyWhiteSpace , CSSValuePre); 217 addPropertyToPresentationAttributeStyle(style, CSSPropertyWhiteSpace , CSSValuePre);
218 } else { 218 } else {
219 UseCounter::count(document(), UseCounter::WhiteSpaceNowrapFromXMLSpa ce); 219 UseCounter::count(document(), UseCounter::WhiteSpaceNowrapFromXMLSpa ce);
220 addPropertyToPresentationAttributeStyle(style, CSSPropertyWhiteSpace , CSSValueNowrap); 220 addPropertyToPresentationAttributeStyle(style, CSSPropertyWhiteSpace , CSSValueNowrap);
221 } 221 }
222 } else { 222 } else {
223 SVGGraphicsElement::collectStyleForPresentationAttribute(name, value, st yle); 223 SVGGraphicsElement::collectStyleForPresentationAttribute(name, value, st yle);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 { 255 {
256 if (!lineLayoutItem || (!lineLayoutItem.isSVGText() && !lineLayoutItem.isSVG Inline())) 256 if (!lineLayoutItem || (!lineLayoutItem.isSVGText() && !lineLayoutItem.isSVG Inline()))
257 return nullptr; 257 return nullptr;
258 258
259 SVGElement* element = toSVGElement(lineLayoutItem.node()); 259 SVGElement* element = toSVGElement(lineLayoutItem.node());
260 ASSERT(element); 260 ASSERT(element);
261 return isSVGTextContentElement(*element) ? toSVGTextContentElement(element) : 0; 261 return isSVGTextContentElement(*element) ? toSVGTextContentElement(element) : 0;
262 } 262 }
263 263
264 } // namespace blink 264 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698