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 22 matching lines...) Expand all Loading... |
33 #include "core/css/parser/CSSParser.h" | 33 #include "core/css/parser/CSSParser.h" |
34 #include "core/dom/QualifiedName.h" | 34 #include "core/dom/QualifiedName.h" |
35 #include "core/dom/shadow/ElementShadow.h" | 35 #include "core/dom/shadow/ElementShadow.h" |
36 #include "core/dom/shadow/ShadowRoot.h" | 36 #include "core/dom/shadow/ShadowRoot.h" |
37 #include "platform/RuntimeEnabledFeatures.h" | 37 #include "platform/RuntimeEnabledFeatures.h" |
38 | 38 |
39 namespace blink { | 39 namespace blink { |
40 | 40 |
41 using namespace HTMLNames; | 41 using namespace HTMLNames; |
42 | 42 |
| 43 PassRefPtrWillBeRawPtr<HTMLContentElement> HTMLContentElement::create(Document&
document, PassOwnPtrWillBeRawPtr<HTMLContentSelectFilter> filter) |
| 44 { |
| 45 return adoptRefWillBeNoop(new HTMLContentElement(document, filter)); |
| 46 } |
| 47 |
43 inline HTMLContentElement::HTMLContentElement(Document& document, PassOwnPtrWill
BeRawPtr<HTMLContentSelectFilter> filter) | 48 inline HTMLContentElement::HTMLContentElement(Document& document, PassOwnPtrWill
BeRawPtr<HTMLContentSelectFilter> filter) |
44 : InsertionPoint(contentTag, document) | 49 : InsertionPoint(contentTag, document) |
45 , m_shouldParseSelect(false) | 50 , m_shouldParseSelect(false) |
46 , m_isValidSelector(true) | 51 , m_isValidSelector(true) |
47 , m_filter(filter) | 52 , m_filter(filter) |
48 { | 53 { |
49 } | 54 } |
50 | 55 |
51 PassRefPtrWillBeRawPtr<HTMLContentElement> HTMLContentElement::create(Document&
document, PassOwnPtrWillBeRawPtr<HTMLContentSelectFilter> filter) | |
52 { | |
53 return adoptRefWillBeNoop(new HTMLContentElement(document, filter)); | |
54 } | |
55 | |
56 HTMLContentElement::~HTMLContentElement() | 56 HTMLContentElement::~HTMLContentElement() |
57 { | 57 { |
58 } | 58 } |
59 | 59 |
| 60 DEFINE_TRACE(HTMLContentElement) |
| 61 { |
| 62 visitor->trace(m_filter); |
| 63 InsertionPoint::trace(visitor); |
| 64 } |
| 65 |
60 void HTMLContentElement::parseSelect() | 66 void HTMLContentElement::parseSelect() |
61 { | 67 { |
62 ASSERT(m_shouldParseSelect); | 68 ASSERT(m_shouldParseSelect); |
63 | 69 |
64 CSSParser::parseSelector(CSSParserContext(document(), 0), m_select, m_select
orList); | 70 CSSParser::parseSelector(CSSParserContext(document(), 0), m_select, m_select
orList); |
65 m_shouldParseSelect = false; | 71 m_shouldParseSelect = false; |
66 m_isValidSelector = validateSelect(); | 72 m_isValidSelector = validateSelect(); |
67 if (!m_isValidSelector) { | 73 if (!m_isValidSelector) { |
68 CSSSelectorList emptyList; | 74 CSSSelectorList emptyList; |
69 m_selectorList.adopt(emptyList); | 75 m_selectorList.adopt(emptyList); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 bool HTMLContentElement::matchSelector(const WillBeHeapVector<RawPtrWillBeMember
<Node>, 32>& siblings, int nth) const | 134 bool HTMLContentElement::matchSelector(const WillBeHeapVector<RawPtrWillBeMember
<Node>, 32>& siblings, int nth) const |
129 { | 135 { |
130 for (const CSSSelector* selector = selectorList().first(); selector; selecto
r = CSSSelectorList::next(*selector)) { | 136 for (const CSSSelector* selector = selectorList().first(); selector; selecto
r = CSSSelectorList::next(*selector)) { |
131 if (checkOneSelector(*selector, siblings, nth)) | 137 if (checkOneSelector(*selector, siblings, nth)) |
132 return true; | 138 return true; |
133 } | 139 } |
134 return false; | 140 return false; |
135 } | 141 } |
136 | 142 |
137 } | 143 } |
OLD | NEW |