| 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/SiblingTraversalStrategies.h" | 33 #include "core/css/SiblingTraversalStrategies.h" |
| 34 #include "core/css/parser/BisonCSSParser.h" | 34 #include "core/css/parser/BisonCSSParser.h" |
| 35 #include "core/dom/QualifiedName.h" | 35 #include "core/dom/QualifiedName.h" |
| 36 #include "core/dom/shadow/ElementShadow.h" | 36 #include "core/dom/shadow/ElementShadow.h" |
| 37 #include "core/dom/shadow/ShadowRoot.h" | 37 #include "core/dom/shadow/ShadowRoot.h" |
| 38 | 38 |
| 39 namespace WebCore { | 39 namespace WebCore { |
| 40 | 40 |
| 41 using namespace HTMLNames; | 41 using namespace HTMLNames; |
| 42 | 42 |
| 43 PassRefPtrWillBeRawPtr<HTMLContentElement> HTMLContentElement::create(Document&
document) | 43 inline HTMLContentElement::HTMLContentElement(Document& document) |
| 44 { | |
| 45 return adoptRefWillBeRefCountedGarbageCollected(new HTMLContentElement(docum
ent)); | |
| 46 } | |
| 47 | |
| 48 HTMLContentElement::HTMLContentElement(Document& document) | |
| 49 : InsertionPoint(contentTag, document) | 44 : InsertionPoint(contentTag, document) |
| 50 , m_shouldParseSelect(false) | 45 , m_shouldParseSelect(false) |
| 51 , m_isValidSelector(true) | 46 , m_isValidSelector(true) |
| 52 { | 47 { |
| 53 ScriptWrappable::init(this); | 48 ScriptWrappable::init(this); |
| 54 } | 49 } |
| 55 | 50 |
| 51 DEFINE_NODE_FACTORY(HTMLContentElement) |
| 52 |
| 56 HTMLContentElement::~HTMLContentElement() | 53 HTMLContentElement::~HTMLContentElement() |
| 57 { | 54 { |
| 58 } | 55 } |
| 59 | 56 |
| 60 void HTMLContentElement::parseSelect() | 57 void HTMLContentElement::parseSelect() |
| 61 { | 58 { |
| 62 ASSERT(m_shouldParseSelect); | 59 ASSERT(m_shouldParseSelect); |
| 63 | 60 |
| 64 BisonCSSParser parser(CSSParserContext(document(), 0)); | 61 BisonCSSParser parser(CSSParserContext(document(), 0)); |
| 65 parser.parseSelector(m_select, m_selectorList); | 62 parser.parseSelector(m_select, m_selectorList); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 bool HTMLContentElement::matchSelector(const WillBeHeapVector<RawPtrWillBeMember
<Node>, 32>& siblings, int nth) const | 122 bool HTMLContentElement::matchSelector(const WillBeHeapVector<RawPtrWillBeMember
<Node>, 32>& siblings, int nth) const |
| 126 { | 123 { |
| 127 for (const CSSSelector* selector = selectorList().first(); selector; selecto
r = CSSSelectorList::next(*selector)) { | 124 for (const CSSSelector* selector = selectorList().first(); selector; selecto
r = CSSSelectorList::next(*selector)) { |
| 128 if (checkOneSelector(*selector, siblings, nth)) | 125 if (checkOneSelector(*selector, siblings, nth)) |
| 129 return true; | 126 return true; |
| 130 } | 127 } |
| 131 return false; | 128 return false; |
| 132 } | 129 } |
| 133 | 130 |
| 134 } | 131 } |
| OLD | NEW |