OLD | NEW |
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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 107 |
108 fastFree(m_selectorArray); | 108 fastFree(m_selectorArray); |
109 } | 109 } |
110 | 110 |
111 String CSSSelectorList::selectorsText() const | 111 String CSSSelectorList::selectorsText() const |
112 { | 112 { |
113 StringBuilder result; | 113 StringBuilder result; |
114 | 114 |
115 for (const CSSSelector* s = first(); s; s = next(*s)) { | 115 for (const CSSSelector* s = first(); s; s = next(*s)) { |
116 if (s != first()) | 116 if (s != first()) |
117 result.append(", "); | 117 result.appendLiteral(", "); |
118 result.append(s->selectorText()); | 118 result.append(s->selectorText()); |
119 } | 119 } |
120 | 120 |
121 return result.toString(); | 121 return result.toString(); |
122 } | 122 } |
123 | 123 |
124 template <typename Functor> | 124 template <typename Functor> |
125 static bool forEachTagSelector(Functor& functor, const CSSSelector& selector) | 125 static bool forEachTagSelector(Functor& functor, const CSSSelector& selector) |
126 { | 126 { |
127 for (const CSSSelector* current = &selector; current; current = current->tag
History()) { | 127 for (const CSSSelector* current = &selector; current; current = current->tag
History()) { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 } | 189 } |
190 }; | 190 }; |
191 | 191 |
192 bool CSSSelectorList::selectorCrossesTreeScopes(size_t index) const | 192 bool CSSSelectorList::selectorCrossesTreeScopes(size_t index) const |
193 { | 193 { |
194 SelectorCrossesTreeScopes functor; | 194 SelectorCrossesTreeScopes functor; |
195 return forEachTagSelector(functor, selectorAt(index)); | 195 return forEachTagSelector(functor, selectorAt(index)); |
196 } | 196 } |
197 | 197 |
198 } // namespace blink | 198 } // namespace blink |
OLD | NEW |