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

Side by Side Diff: Source/core/css/CSSStyleRule.cpp

Issue 482753002: Use StringBuilder::appendLiteral() / StringBuilder::append(char) when possible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/CSSSelectorList.cpp ('k') | Source/core/css/CSSSupportsRule.cpp » ('j') | 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 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org) 3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2002, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved. 4 * Copyright (C) 2002, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 m_propertiesCSSOMWrapper = StyleRuleCSSStyleDeclaration::create(m_styleR ule->mutableProperties(), const_cast<CSSStyleRule*>(this)); 63 m_propertiesCSSOMWrapper = StyleRuleCSSStyleDeclaration::create(m_styleR ule->mutableProperties(), const_cast<CSSStyleRule*>(this));
64 } 64 }
65 return m_propertiesCSSOMWrapper.get(); 65 return m_propertiesCSSOMWrapper.get();
66 } 66 }
67 67
68 String CSSStyleRule::generateSelectorText() const 68 String CSSStyleRule::generateSelectorText() const
69 { 69 {
70 StringBuilder builder; 70 StringBuilder builder;
71 for (const CSSSelector* selector = m_styleRule->selectorList().first(); sele ctor; selector = CSSSelectorList::next(*selector)) { 71 for (const CSSSelector* selector = m_styleRule->selectorList().first(); sele ctor; selector = CSSSelectorList::next(*selector)) {
72 if (selector != m_styleRule->selectorList().first()) 72 if (selector != m_styleRule->selectorList().first())
73 builder.append(", "); 73 builder.appendLiteral(", ");
74 builder.append(selector->selectorText()); 74 builder.append(selector->selectorText());
75 } 75 }
76 return builder.toString(); 76 return builder.toString();
77 } 77 }
78 78
79 String CSSStyleRule::selectorText() const 79 String CSSStyleRule::selectorText() const
80 { 80 {
81 if (hasCachedSelectorText()) { 81 if (hasCachedSelectorText()) {
82 ASSERT(selectorTextCache().contains(this)); 82 ASSERT(selectorTextCache().contains(this));
83 return selectorTextCache().get(this); 83 return selectorTextCache().get(this);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 } 131 }
132 132
133 void CSSStyleRule::trace(Visitor* visitor) 133 void CSSStyleRule::trace(Visitor* visitor)
134 { 134 {
135 visitor->trace(m_styleRule); 135 visitor->trace(m_styleRule);
136 visitor->trace(m_propertiesCSSOMWrapper); 136 visitor->trace(m_propertiesCSSOMWrapper);
137 CSSRule::trace(visitor); 137 CSSRule::trace(visitor);
138 } 138 }
139 139
140 } // namespace blink 140 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/CSSSelectorList.cpp ('k') | Source/core/css/CSSSupportsRule.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698