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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 20 matching lines...) Expand all Loading... |
31 #ifndef HTMLContentElement_h | 31 #ifndef HTMLContentElement_h |
32 #define HTMLContentElement_h | 32 #define HTMLContentElement_h |
33 | 33 |
34 #include "core/css/CSSSelectorList.h" | 34 #include "core/css/CSSSelectorList.h" |
35 #include "core/dom/shadow/InsertionPoint.h" | 35 #include "core/dom/shadow/InsertionPoint.h" |
36 | 36 |
37 namespace WebCore { | 37 namespace WebCore { |
38 | 38 |
39 class HTMLContentElement FINAL : public InsertionPoint { | 39 class HTMLContentElement FINAL : public InsertionPoint { |
40 public: | 40 public: |
41 static PassRefPtr<HTMLContentElement> create(const QualifiedName&, Document*
); | 41 static PassRefPtr<HTMLContentElement> create(const QualifiedName&, Document&
); |
42 static PassRefPtr<HTMLContentElement> create(Document*); | 42 static PassRefPtr<HTMLContentElement> create(Document&); |
43 | 43 |
44 virtual ~HTMLContentElement(); | 44 virtual ~HTMLContentElement(); |
45 | 45 |
46 virtual bool canAffectSelector() const OVERRIDE { return true; } | 46 virtual bool canAffectSelector() const OVERRIDE { return true; } |
47 | 47 |
48 bool canSelectNode(const Vector<Node*>& siblings, int nth) const; | 48 bool canSelectNode(const Vector<Node*>& siblings, int nth) const; |
49 | 49 |
50 const CSSSelectorList& selectorList() const; | 50 const CSSSelectorList& selectorList() const; |
51 bool isSelectValid() const; | 51 bool isSelectValid() const; |
52 | 52 |
53 private: | 53 private: |
54 HTMLContentElement(const QualifiedName&, Document*); | 54 HTMLContentElement(const QualifiedName&, Document&); |
55 | 55 |
56 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; | 56 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; |
57 | 57 |
58 bool validateSelect() const; | 58 bool validateSelect() const; |
59 void parseSelect(); | 59 void parseSelect(); |
60 | 60 |
61 bool matchSelector(const Vector<Node*>& siblings, int nth) const; | 61 bool matchSelector(const Vector<Node*>& siblings, int nth) const; |
62 | 62 |
63 bool m_shouldParseSelect; | 63 bool m_shouldParseSelect; |
64 bool m_isValidSelector; | 64 bool m_isValidSelector; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 103 |
104 inline HTMLContentElement* toHTMLContentElement(Node* node) | 104 inline HTMLContentElement* toHTMLContentElement(Node* node) |
105 { | 105 { |
106 ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLContentElement(node)); | 106 ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLContentElement(node)); |
107 return static_cast<HTMLContentElement*>(node); | 107 return static_cast<HTMLContentElement*>(node); |
108 } | 108 } |
109 | 109 |
110 } | 110 } |
111 | 111 |
112 #endif | 112 #endif |
OLD | NEW |