OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef DocumentXSLT_h | 5 #ifndef DocumentXSLT_h |
6 #define DocumentXSLT_h | 6 #define DocumentXSLT_h |
7 | 7 |
8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
9 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
10 #include "wtf/RefPtr.h" | 10 #include "wtf/RefPtr.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class Document; | 14 class Document; |
15 class ProcessingInstruction; | 15 class ProcessingInstruction; |
16 | 16 |
17 class DocumentXSLT final : public GarbageCollected<DocumentXSLT>, public HeapSup
plement<Document> { | 17 class DocumentXSLT final : public GarbageCollected<DocumentXSLT>, public Supplem
ent<Document> { |
18 WTF_MAKE_NONCOPYABLE(DocumentXSLT); | 18 WTF_MAKE_NONCOPYABLE(DocumentXSLT); |
19 USING_GARBAGE_COLLECTED_MIXIN(DocumentXSLT); | 19 USING_GARBAGE_COLLECTED_MIXIN(DocumentXSLT); |
20 public: | 20 public: |
21 Document* transformSourceDocument() | 21 Document* transformSourceDocument() |
22 { | 22 { |
23 return m_transformSourceDocument.get(); | 23 return m_transformSourceDocument.get(); |
24 } | 24 } |
25 | 25 |
26 void setTransformSourceDocument(Document* document) | 26 void setTransformSourceDocument(Document* document) |
27 { | 27 { |
28 ASSERT(document); | 28 ASSERT(document); |
29 m_transformSourceDocument = document; | 29 m_transformSourceDocument = document; |
30 } | 30 } |
31 | 31 |
32 static DocumentXSLT& from(HeapSupplementable<Document>&); | 32 static DocumentXSLT& from(Supplementable<Document>&); |
33 static const char* supplementName(); | 33 static const char* supplementName(); |
34 | 34 |
35 // The following static methods don't use any instance of DocumentXSLT. | 35 // The following static methods don't use any instance of DocumentXSLT. |
36 // They are just using DocumentXSLT namespace. | 36 // They are just using DocumentXSLT namespace. |
37 static void applyXSLTransform(Document&, ProcessingInstruction*); | 37 static void applyXSLTransform(Document&, ProcessingInstruction*); |
38 static ProcessingInstruction* findXSLStyleSheet(Document&); | 38 static ProcessingInstruction* findXSLStyleSheet(Document&); |
39 static bool processingInstructionInsertedIntoDocument(Document&, ProcessingI
nstruction*); | 39 static bool processingInstructionInsertedIntoDocument(Document&, ProcessingI
nstruction*); |
40 static bool processingInstructionRemovedFromDocument(Document&, ProcessingIn
struction*); | 40 static bool processingInstructionRemovedFromDocument(Document&, ProcessingIn
struction*); |
41 static bool sheetLoaded(Document&, ProcessingInstruction*); | 41 static bool sheetLoaded(Document&, ProcessingInstruction*); |
42 static bool hasTransformSourceDocument(Document&); | 42 static bool hasTransformSourceDocument(Document&); |
43 | 43 |
44 DECLARE_VIRTUAL_TRACE(); | 44 DECLARE_VIRTUAL_TRACE(); |
45 | 45 |
46 private: | 46 private: |
47 DocumentXSLT(); | 47 DocumentXSLT(); |
48 | 48 |
49 Member<Document> m_transformSourceDocument; | 49 Member<Document> m_transformSourceDocument; |
50 }; | 50 }; |
51 | 51 |
52 } // namespace blink | 52 } // namespace blink |
53 | 53 |
54 #endif | 54 #endif |
OLD | NEW |