| 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 13 matching lines...) Expand all Loading... |
| 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 */ | 25 */ |
| 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/ShadowRoot.h" | 35 #include "core/dom/shadow/ShadowRoot.h" |
| 35 #include "platform/RuntimeEnabledFeatures.h" | 36 #include "platform/RuntimeEnabledFeatures.h" |
| 36 | 37 |
| 37 namespace blink { | 38 namespace blink { |
| 38 | 39 |
| 39 using namespace HTMLNames; | 40 using namespace HTMLNames; |
| 40 | 41 |
| 41 HTMLContentElement* HTMLContentElement::create(Document& document, HTMLContentSe
lectFilter* filter) | 42 HTMLContentElement* HTMLContentElement::create(Document& document, HTMLContentSe
lectFilter* filter) |
| 42 { | 43 { |
| 43 return new HTMLContentElement(document, filter); | 44 return new HTMLContentElement(document, filter); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 70 m_isValidSelector = validateSelect(); | 71 m_isValidSelector = validateSelect(); |
| 71 if (!m_isValidSelector) | 72 if (!m_isValidSelector) |
| 72 m_selectorList = CSSSelectorList(); | 73 m_selectorList = CSSSelectorList(); |
| 73 } | 74 } |
| 74 | 75 |
| 75 void HTMLContentElement::parseAttribute(const QualifiedName& name, const AtomicS
tring& oldValue, const AtomicString& value) | 76 void HTMLContentElement::parseAttribute(const QualifiedName& name, const AtomicS
tring& oldValue, const AtomicString& value) |
| 76 { | 77 { |
| 77 if (name == selectAttr) { | 78 if (name == selectAttr) { |
| 78 if (ShadowRoot* root = containingShadowRoot()) { | 79 if (ShadowRoot* root = containingShadowRoot()) { |
| 79 if (!root->isV1() && root->owner()) | 80 if (!root->isV1() && root->owner()) |
| 80 root->owner()->willAffectSelector(); | 81 root->owner()->v0().willAffectSelector(); |
| 81 } | 82 } |
| 82 m_shouldParseSelect = true; | 83 m_shouldParseSelect = true; |
| 83 m_select = value; | 84 m_select = value; |
| 84 } else { | 85 } else { |
| 85 InsertionPoint::parseAttribute(name, oldValue, value); | 86 InsertionPoint::parseAttribute(name, oldValue, value); |
| 86 } | 87 } |
| 87 } | 88 } |
| 88 | 89 |
| 89 static inline bool includesDisallowedPseudoClass(const CSSSelector& selector) | 90 static inline bool includesDisallowedPseudoClass(const CSSSelector& selector) |
| 90 { | 91 { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 SelectorChecker::SelectorCheckingContext context(&element, SelectorChecker::
VisitedMatchDisabled); | 128 SelectorChecker::SelectorCheckingContext context(&element, SelectorChecker::
VisitedMatchDisabled); |
| 128 for (const CSSSelector* selector = selectorList().first(); selector; selecto
r = CSSSelectorList::next(*selector)) { | 129 for (const CSSSelector* selector = selectorList().first(); selector; selecto
r = CSSSelectorList::next(*selector)) { |
| 129 context.selector = selector; | 130 context.selector = selector; |
| 130 if (checker.match(context)) | 131 if (checker.match(context)) |
| 131 return true; | 132 return true; |
| 132 } | 133 } |
| 133 return false; | 134 return false; |
| 134 } | 135 } |
| 135 | 136 |
| 136 } // namespace blink | 137 } // namespace blink |
| OLD | NEW |