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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSSelectorList.cpp

Issue 2017053003: Remove StringBuilder::appendLiteral. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase. Created 4 years, 6 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) 2008, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Google Inc. All rights reserved. 3 * Copyright (C) 2009 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 109
110 WTF::Partitions::fastFree(m_selectorArray); 110 WTF::Partitions::fastFree(m_selectorArray);
111 } 111 }
112 112
113 String CSSSelectorList::selectorsText() const 113 String CSSSelectorList::selectorsText() const
114 { 114 {
115 StringBuilder result; 115 StringBuilder result;
116 116
117 for (const CSSSelector* s = first(); s; s = next(*s)) { 117 for (const CSSSelector* s = first(); s; s = next(*s)) {
118 if (s != first()) 118 if (s != first())
119 result.appendLiteral(", "); 119 result.append(", ");
120 result.append(s->selectorText()); 120 result.append(s->selectorText());
121 } 121 }
122 122
123 return result.toString(); 123 return result.toString();
124 } 124 }
125 125
126 template <typename Functor> 126 template <typename Functor>
127 static bool forEachTagSelector(const Functor& functor, const CSSSelector& select or) 127 static bool forEachTagSelector(const Functor& functor, const CSSSelector& select or)
128 { 128 {
129 for (const CSSSelector* current = &selector; current; current = current->tag History()) { 129 for (const CSSSelector* current = &selector; current; current = current->tag History()) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 } 173 }
174 174
175 bool CSSSelectorList::selectorNeedsUpdatedDistribution(size_t index) const 175 bool CSSSelectorList::selectorNeedsUpdatedDistribution(size_t index) const
176 { 176 {
177 return forEachTagSelector([](const CSSSelector& selector) -> bool { 177 return forEachTagSelector([](const CSSSelector& selector) -> bool {
178 return selector.relationIsAffectedByPseudoContent() || selector.getPseud oType() == CSSSelector::PseudoSlotted || selector.getPseudoType() == CSSSelector ::PseudoHostContext; 178 return selector.relationIsAffectedByPseudoContent() || selector.getPseud oType() == CSSSelector::PseudoSlotted || selector.getPseudoType() == CSSSelector ::PseudoHostContext;
179 }, selectorAt(index)); 179 }, selectorAt(index));
180 } 180 }
181 181
182 } // namespace blink 182 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSSelector.cpp ('k') | third_party/WebKit/Source/core/css/CSSStyleRule.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698