OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. |
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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 } | 179 } |
180 | 180 |
181 bool CSSParserSelector::isSimple() const | 181 bool CSSParserSelector::isSimple() const |
182 { | 182 { |
183 if (m_selector->selectorList() || m_selector->matchesPseudoElement()) | 183 if (m_selector->selectorList() || m_selector->matchesPseudoElement()) |
184 return false; | 184 return false; |
185 | 185 |
186 if (!m_tagHistory) | 186 if (!m_tagHistory) |
187 return true; | 187 return true; |
188 | 188 |
189 if (m_selector->m_match == CSSSelector::Tag) { | 189 if (m_selector->match() == CSSSelector::Tag) { |
190 // We can't check against anyQName() here because namespace may not be n
ullAtom. | 190 // We can't check against anyQName() here because namespace may not be n
ullAtom. |
191 // Example: | 191 // Example: |
192 // @namespace "http://www.w3.org/2000/svg"; | 192 // @namespace "http://www.w3.org/2000/svg"; |
193 // svg:not(:root) { ... | 193 // svg:not(:root) { ... |
194 if (m_selector->tagQName().localName() == starAtom) | 194 if (m_selector->tagQName().localName() == starAtom) |
195 return m_tagHistory->isSimple(); | 195 return m_tagHistory->isSimple(); |
196 } | 196 } |
197 | 197 |
198 return false; | 198 return false; |
199 } | 199 } |
(...skipping 17 matching lines...) Expand all Loading... |
217 } | 217 } |
218 | 218 |
219 void CSSParserSelector::prependTagSelector(const QualifiedName& tagQName, bool t
agIsForNamespaceRule) | 219 void CSSParserSelector::prependTagSelector(const QualifiedName& tagQName, bool t
agIsForNamespaceRule) |
220 { | 220 { |
221 OwnPtr<CSSParserSelector> second = adoptPtr(new CSSParserSelector); | 221 OwnPtr<CSSParserSelector> second = adoptPtr(new CSSParserSelector); |
222 second->m_selector = m_selector.release(); | 222 second->m_selector = m_selector.release(); |
223 second->m_tagHistory = m_tagHistory.release(); | 223 second->m_tagHistory = m_tagHistory.release(); |
224 m_tagHistory = second.release(); | 224 m_tagHistory = second.release(); |
225 | 225 |
226 m_selector = adoptPtr(new CSSSelector(tagQName, tagIsForNamespaceRule)); | 226 m_selector = adoptPtr(new CSSSelector(tagQName, tagIsForNamespaceRule)); |
227 m_selector->m_relation = CSSSelector::SubSelector; | 227 m_selector->setRelation(CSSSelector::SubSelector); |
228 } | 228 } |
229 | 229 |
230 bool CSSParserSelector::hasHostPseudoSelector() const | 230 bool CSSParserSelector::hasHostPseudoSelector() const |
231 { | 231 { |
232 CSSParserSelector* selector = const_cast<CSSParserSelector*>(this); | 232 CSSParserSelector* selector = const_cast<CSSParserSelector*>(this); |
233 do { | 233 do { |
234 if (selector->pseudoType() == CSSSelector::PseudoHost || selector->pseud
oType() == CSSSelector::PseudoHostContext) | 234 if (selector->pseudoType() == CSSSelector::PseudoHost || selector->pseud
oType() == CSSSelector::PseudoHostContext) |
235 return true; | 235 return true; |
236 } while ((selector = selector->tagHistory())); | 236 } while ((selector = selector->tagHistory())); |
237 return false; | 237 return false; |
238 } | 238 } |
239 | 239 |
240 } // namespace WebCore | 240 } // namespace WebCore |
OLD | NEW |