OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 27 matching lines...) Expand all Loading... |
38 namespace WebCore { | 38 namespace WebCore { |
39 | 39 |
40 using namespace HTMLNames; | 40 using namespace HTMLNames; |
41 | 41 |
42 inline HTMLTemplateElement::HTMLTemplateElement(Document& document) | 42 inline HTMLTemplateElement::HTMLTemplateElement(Document& document) |
43 : HTMLElement(templateTag, document) | 43 : HTMLElement(templateTag, document) |
44 { | 44 { |
45 ScriptWrappable::init(this); | 45 ScriptWrappable::init(this); |
46 } | 46 } |
47 | 47 |
| 48 DEFINE_NODE_FACTORY(HTMLTemplateElement) |
| 49 |
48 HTMLTemplateElement::~HTMLTemplateElement() | 50 HTMLTemplateElement::~HTMLTemplateElement() |
49 { | 51 { |
50 #if !ENABLE(OILPAN) | 52 #if !ENABLE(OILPAN) |
51 if (m_content) | 53 if (m_content) |
52 m_content->clearHost(); | 54 m_content->clearHost(); |
53 #endif | 55 #endif |
54 } | 56 } |
55 | 57 |
56 PassRefPtrWillBeRawPtr<HTMLTemplateElement> HTMLTemplateElement::create(Document
& document) | |
57 { | |
58 return adoptRefWillBeRefCountedGarbageCollected(new HTMLTemplateElement(docu
ment)); | |
59 } | |
60 | |
61 DocumentFragment* HTMLTemplateElement::content() const | 58 DocumentFragment* HTMLTemplateElement::content() const |
62 { | 59 { |
63 if (!m_content) | 60 if (!m_content) |
64 m_content = TemplateContentDocumentFragment::create(document().ensureTem
plateDocument(), const_cast<HTMLTemplateElement*>(this)); | 61 m_content = TemplateContentDocumentFragment::create(document().ensureTem
plateDocument(), const_cast<HTMLTemplateElement*>(this)); |
65 | 62 |
66 return m_content.get(); | 63 return m_content.get(); |
67 } | 64 } |
68 | 65 |
69 PassRefPtrWillBeRawPtr<Node> HTMLTemplateElement::cloneNode(bool deep) | 66 PassRefPtrWillBeRawPtr<Node> HTMLTemplateElement::cloneNode(bool deep) |
70 { | 67 { |
(...skipping 14 matching lines...) Expand all Loading... |
85 document().ensureTemplateDocument().adoptIfNeeded(*m_content); | 82 document().ensureTemplateDocument().adoptIfNeeded(*m_content); |
86 } | 83 } |
87 | 84 |
88 void HTMLTemplateElement::trace(Visitor* visitor) | 85 void HTMLTemplateElement::trace(Visitor* visitor) |
89 { | 86 { |
90 visitor->trace(m_content); | 87 visitor->trace(m_content); |
91 HTMLElement::trace(visitor); | 88 HTMLElement::trace(visitor); |
92 } | 89 } |
93 | 90 |
94 } // namespace WebCore | 91 } // namespace WebCore |
OLD | NEW |