OLD | NEW |
1 /* | 1 /* |
2 * This file is part of the XSL implementation. | 2 * This file is part of the XSL implementation. |
3 * | 3 * |
4 * Copyright (C) 2004, 2007, 2008 Apple, Inc. All rights reserved. | 4 * Copyright (C) 2004, 2007, 2008 Apple, Inc. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 23 matching lines...) Expand all Loading... |
34 #include <libxslt/documents.h> | 34 #include <libxslt/documents.h> |
35 | 35 |
36 namespace blink { | 36 namespace blink { |
37 | 37 |
38 class LocalFrame; | 38 class LocalFrame; |
39 class Document; | 39 class Document; |
40 class DocumentFragment; | 40 class DocumentFragment; |
41 | 41 |
42 class XSLTProcessor : public RefCountedWillBeGarbageCollectedFinalized<XSLTProce
ssor>, public ScriptWrappable { | 42 class XSLTProcessor : public RefCountedWillBeGarbageCollectedFinalized<XSLTProce
ssor>, public ScriptWrappable { |
43 public: | 43 public: |
44 static PassRefPtrWillBeRawPtr<XSLTProcessor> create() | 44 static PassRefPtrWillBeRawPtr<XSLTProcessor> create(Document& document) |
45 { | 45 { |
46 ASSERT(RuntimeEnabledFeatures::xsltEnabled()); | 46 ASSERT(RuntimeEnabledFeatures::xsltEnabled()); |
47 return adoptRefWillBeNoop(new XSLTProcessor); | 47 return adoptRefWillBeNoop(new XSLTProcessor(document)); |
48 } | 48 } |
49 ~XSLTProcessor(); | 49 ~XSLTProcessor(); |
50 | 50 |
51 void setXSLStyleSheet(PassRefPtrWillBeRawPtr<XSLStyleSheet> styleSheet) { m_
stylesheet = styleSheet; } | 51 void setXSLStyleSheet(PassRefPtrWillBeRawPtr<XSLStyleSheet> styleSheet) { m_
stylesheet = styleSheet; } |
52 bool transformToString(Node* source, String& resultMIMEType, String& resultS
tring, String& resultEncoding); | 52 bool transformToString(Node* source, String& resultMIMEType, String& resultS
tring, String& resultEncoding); |
53 PassRefPtrWillBeRawPtr<Document> createDocumentFromSource(const String& sour
ce, const String& sourceEncoding, const String& sourceMIMEType, Node* sourceNode
, LocalFrame*); | 53 PassRefPtrWillBeRawPtr<Document> createDocumentFromSource(const String& sour
ce, const String& sourceEncoding, const String& sourceMIMEType, Node* sourceNode
, LocalFrame*); |
54 | 54 |
55 // DOM methods | 55 // DOM methods |
56 void importStylesheet(PassRefPtrWillBeRawPtr<Node> style) | 56 void importStylesheet(PassRefPtrWillBeRawPtr<Node> style) |
57 { | 57 { |
(...skipping 14 matching lines...) Expand all Loading... |
72 static void genericErrorFunc(void* userData, const char* msg, ...); | 72 static void genericErrorFunc(void* userData, const char* msg, ...); |
73 | 73 |
74 // Only for libXSLT callbacks | 74 // Only for libXSLT callbacks |
75 XSLStyleSheet* xslStylesheet() const { return m_stylesheet.get(); } | 75 XSLStyleSheet* xslStylesheet() const { return m_stylesheet.get(); } |
76 | 76 |
77 typedef HashMap<String, String> ParameterMap; | 77 typedef HashMap<String, String> ParameterMap; |
78 | 78 |
79 void trace(Visitor*); | 79 void trace(Visitor*); |
80 | 80 |
81 private: | 81 private: |
82 XSLTProcessor() | 82 XSLTProcessor(Document& document) |
| 83 : m_document(&document) |
83 { | 84 { |
84 ScriptWrappable::init(this); | 85 ScriptWrappable::init(this); |
85 } | 86 } |
86 | 87 |
87 RefPtrWillBeMember<XSLStyleSheet> m_stylesheet; | 88 RefPtrWillBeMember<XSLStyleSheet> m_stylesheet; |
88 RefPtrWillBeMember<Node> m_stylesheetRootNode; | 89 RefPtrWillBeMember<Node> m_stylesheetRootNode; |
| 90 RefPtrWillBeMember<Document> m_document; |
89 ParameterMap m_parameters; | 91 ParameterMap m_parameters; |
90 }; | 92 }; |
91 | 93 |
92 } | 94 } |
93 | 95 |
94 #endif | 96 #endif |
OLD | NEW |