| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 DEFINE_NODE_FACTORY(HTMLContentElement) | 47 DEFINE_NODE_FACTORY(HTMLContentElement) |
| 48 | 48 |
| 49 HTMLContentElement::~HTMLContentElement() | 49 HTMLContentElement::~HTMLContentElement() |
| 50 { | 50 { |
| 51 } | 51 } |
| 52 | 52 |
| 53 void HTMLContentElement::parseSelect() | 53 void HTMLContentElement::parseSelect() |
| 54 { | 54 { |
| 55 ASSERT(m_shouldParseSelect); | 55 ASSERT(m_shouldParseSelect); |
| 56 | 56 |
| 57 BisonCSSParser parser(CSSParserContext(document(), 0)); | 57 CSSParserContext context(document()); |
| 58 BisonCSSParser parser(context); |
| 58 parser.parseSelector(m_select, m_selectorList); | 59 parser.parseSelector(m_select, m_selectorList); |
| 59 m_shouldParseSelect = false; | 60 m_shouldParseSelect = false; |
| 60 m_isValidSelector = validateSelect(); | 61 m_isValidSelector = validateSelect(); |
| 61 if (!m_isValidSelector) { | 62 if (!m_isValidSelector) { |
| 62 CSSSelectorList emptyList; | 63 CSSSelectorList emptyList; |
| 63 m_selectorList.adopt(emptyList); | 64 m_selectorList.adopt(emptyList); |
| 64 } | 65 } |
| 65 } | 66 } |
| 66 | 67 |
| 67 void HTMLContentElement::parseAttribute(const QualifiedName& name, const AtomicS
tring& value) | 68 void HTMLContentElement::parseAttribute(const QualifiedName& name, const AtomicS
tring& value) |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 { | 112 { |
| 112 for (const CSSSelector* selector = selectorList().first(); selector; selecto
r = CSSSelectorList::next(*selector)) { | 113 for (const CSSSelector* selector = selectorList().first(); selector; selecto
r = CSSSelectorList::next(*selector)) { |
| 113 SelectorChecker checker(toElement(*siblings[nth])); | 114 SelectorChecker checker(toElement(*siblings[nth])); |
| 114 if (checker.match(*selector)) | 115 if (checker.match(*selector)) |
| 115 return true; | 116 return true; |
| 116 } | 117 } |
| 117 return false; | 118 return false; |
| 118 } | 119 } |
| 119 | 120 |
| 120 } | 121 } |
| OLD | NEW |