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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |