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 11 matching lines...) Expand all Loading... |
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
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 "config.h" | 27 #include "config.h" |
28 #include "HTMLContentElement.h" | 28 #include "HTMLContentElement.h" |
29 | 29 |
30 #include "ContentDistributor.h" | 30 #include "ContentDistributor.h" |
31 #include "ContentSelectorQuery.h" | 31 #include "ContentSelectorQuery.h" |
| 32 #include "ContextFeatures.h" |
32 #include "ElementShadow.h" | 33 #include "ElementShadow.h" |
33 #include "HTMLNames.h" | 34 #include "HTMLNames.h" |
34 #include "QualifiedName.h" | 35 #include "QualifiedName.h" |
35 #include "RuntimeEnabledFeatures.h" | |
36 #include "ShadowRoot.h" | 36 #include "ShadowRoot.h" |
37 #include <wtf/StdLibExtras.h> | 37 #include <wtf/StdLibExtras.h> |
38 | 38 |
39 namespace WebCore { | 39 namespace WebCore { |
40 | 40 |
41 using HTMLNames::selectAttr; | 41 using HTMLNames::selectAttr; |
42 | 42 |
43 const QualifiedName& HTMLContentElement::contentTagName(Document*) | 43 const QualifiedName& HTMLContentElement::contentTagName(Document* document) |
44 { | 44 { |
45 #if ENABLE(SHADOW_DOM) | 45 #if ENABLE(SHADOW_DOM) |
46 if (!RuntimeEnabledFeatures::shadowDOMEnabled()) | 46 if (!ContextFeatures::shadowDOMEnabled(document)) |
47 return HTMLNames::webkitShadowContentTag; | 47 return HTMLNames::webkitShadowContentTag; |
48 return HTMLNames::contentTag; | 48 return HTMLNames::contentTag; |
49 #else | 49 #else |
| 50 UNUSED_PARAM(document); |
50 return HTMLNames::webkitShadowContentTag; | 51 return HTMLNames::webkitShadowContentTag; |
51 #endif | 52 #endif |
52 } | 53 } |
53 | 54 |
54 PassRefPtr<HTMLContentElement> HTMLContentElement::create(Document* document) | 55 PassRefPtr<HTMLContentElement> HTMLContentElement::create(Document* document) |
55 { | 56 { |
56 return adoptRef(new HTMLContentElement(contentTagName(document), document)); | 57 return adoptRef(new HTMLContentElement(contentTagName(document), document)); |
57 } | 58 } |
58 | 59 |
59 PassRefPtr<HTMLContentElement> HTMLContentElement::create(const QualifiedName& t
agName, Document* document) | 60 PassRefPtr<HTMLContentElement> HTMLContentElement::create(const QualifiedName& t
agName, Document* document) |
(...skipping 29 matching lines...) Expand all Loading... |
89 void HTMLContentElement::parseAttribute(const Attribute& attribute) | 90 void HTMLContentElement::parseAttribute(const Attribute& attribute) |
90 { | 91 { |
91 if (attribute.name() == selectAttr) { | 92 if (attribute.name() == selectAttr) { |
92 if (ShadowRoot* root = shadowRoot()) | 93 if (ShadowRoot* root = shadowRoot()) |
93 root->owner()->invalidateDistribution(); | 94 root->owner()->invalidateDistribution(); |
94 } else | 95 } else |
95 InsertionPoint::parseAttribute(attribute); | 96 InsertionPoint::parseAttribute(attribute); |
96 } | 97 } |
97 | 98 |
98 } | 99 } |
OLD | NEW |