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 15 matching lines...) Expand all Loading... |
26 | 26 |
27 #include "core/html/HTMLContentElement.h" | 27 #include "core/html/HTMLContentElement.h" |
28 | 28 |
29 #include "core/HTMLNames.h" | 29 #include "core/HTMLNames.h" |
30 #include "core/css/SelectorChecker.h" | 30 #include "core/css/SelectorChecker.h" |
31 #include "core/css/parser/CSSParser.h" | 31 #include "core/css/parser/CSSParser.h" |
32 #include "core/dom/QualifiedName.h" | 32 #include "core/dom/QualifiedName.h" |
33 #include "core/dom/shadow/ElementShadow.h" | 33 #include "core/dom/shadow/ElementShadow.h" |
34 #include "core/dom/shadow/ElementShadowV0.h" | 34 #include "core/dom/shadow/ElementShadowV0.h" |
35 #include "core/dom/shadow/ShadowRoot.h" | 35 #include "core/dom/shadow/ShadowRoot.h" |
| 36 #include "core/frame/UseCounter.h" |
36 #include "platform/RuntimeEnabledFeatures.h" | 37 #include "platform/RuntimeEnabledFeatures.h" |
37 | 38 |
38 namespace blink { | 39 namespace blink { |
39 | 40 |
40 using namespace HTMLNames; | 41 using namespace HTMLNames; |
41 | 42 |
42 HTMLContentElement* HTMLContentElement::create( | 43 HTMLContentElement* HTMLContentElement::create( |
43 Document& document, | 44 Document& document, |
44 HTMLContentSelectFilter* filter) { | 45 HTMLContentSelectFilter* filter) { |
45 return new HTMLContentElement(document, filter); | 46 return new HTMLContentElement(document, filter); |
46 } | 47 } |
47 | 48 |
48 inline HTMLContentElement::HTMLContentElement(Document& document, | 49 inline HTMLContentElement::HTMLContentElement(Document& document, |
49 HTMLContentSelectFilter* filter) | 50 HTMLContentSelectFilter* filter) |
50 : InsertionPoint(contentTag, document), | 51 : InsertionPoint(contentTag, document), |
51 m_shouldParseSelect(false), | 52 m_shouldParseSelect(false), |
52 m_isValidSelector(true), | 53 m_isValidSelector(true), |
53 m_filter(filter) {} | 54 m_filter(filter) { |
| 55 UseCounter::count(document, UseCounter::HTMLContentElement); |
| 56 } |
54 | 57 |
55 HTMLContentElement::~HTMLContentElement() {} | 58 HTMLContentElement::~HTMLContentElement() {} |
56 | 59 |
57 DEFINE_TRACE(HTMLContentElement) { | 60 DEFINE_TRACE(HTMLContentElement) { |
58 visitor->trace(m_filter); | 61 visitor->trace(m_filter); |
59 InsertionPoint::trace(visitor); | 62 InsertionPoint::trace(visitor); |
60 } | 63 } |
61 | 64 |
62 void HTMLContentElement::parseSelect() { | 65 void HTMLContentElement::parseSelect() { |
63 DCHECK(m_shouldParseSelect); | 66 DCHECK(m_shouldParseSelect); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 for (const CSSSelector* selector = selectorList().first(); selector; | 129 for (const CSSSelector* selector = selectorList().first(); selector; |
127 selector = CSSSelectorList::next(*selector)) { | 130 selector = CSSSelectorList::next(*selector)) { |
128 context.selector = selector; | 131 context.selector = selector; |
129 if (checker.match(context)) | 132 if (checker.match(context)) |
130 return true; | 133 return true; |
131 } | 134 } |
132 return false; | 135 return false; |
133 } | 136 } |
134 | 137 |
135 } // namespace blink | 138 } // namespace blink |
OLD | NEW |