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, 2006, 2008, 2012 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004, 2006, 2008, 2012 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 17 matching lines...) Expand all Loading... |
28 #include "platform/RuntimeEnabledFeatures.h" | 28 #include "platform/RuntimeEnabledFeatures.h" |
29 #include "wtf/PassRefPtr.h" | 29 #include "wtf/PassRefPtr.h" |
30 #include <libxml/tree.h> | 30 #include <libxml/tree.h> |
31 #include <libxslt/transform.h> | 31 #include <libxslt/transform.h> |
32 | 32 |
33 namespace blink { | 33 namespace blink { |
34 | 34 |
35 class ResourceFetcher; | 35 class ResourceFetcher; |
36 class XSLImportRule; | 36 class XSLImportRule; |
37 | 37 |
38 class XSLStyleSheet FINAL : public StyleSheet { | 38 class XSLStyleSheet final : public StyleSheet { |
39 public: | 39 public: |
40 static PassRefPtrWillBeRawPtr<XSLStyleSheet> create(XSLImportRule* parentImp
ort, const String& originalURL, const KURL& finalURL) | 40 static PassRefPtrWillBeRawPtr<XSLStyleSheet> create(XSLImportRule* parentImp
ort, const String& originalURL, const KURL& finalURL) |
41 { | 41 { |
42 ASSERT(RuntimeEnabledFeatures::xsltEnabled()); | 42 ASSERT(RuntimeEnabledFeatures::xsltEnabled()); |
43 return adoptRefWillBeNoop(new XSLStyleSheet(parentImport, originalURL, f
inalURL)); | 43 return adoptRefWillBeNoop(new XSLStyleSheet(parentImport, originalURL, f
inalURL)); |
44 } | 44 } |
45 static PassRefPtrWillBeRawPtr<XSLStyleSheet> create(ProcessingInstruction* p
arentNode, const String& originalURL, const KURL& finalURL) | 45 static PassRefPtrWillBeRawPtr<XSLStyleSheet> create(ProcessingInstruction* p
arentNode, const String& originalURL, const KURL& finalURL) |
46 { | 46 { |
47 ASSERT(RuntimeEnabledFeatures::xsltEnabled()); | 47 ASSERT(RuntimeEnabledFeatures::xsltEnabled()); |
48 return adoptRefWillBeNoop(new XSLStyleSheet(parentNode, originalURL, fin
alURL, false)); | 48 return adoptRefWillBeNoop(new XSLStyleSheet(parentNode, originalURL, fin
alURL, false)); |
(...skipping 20 matching lines...) Expand all Loading... |
69 void checkLoaded(); | 69 void checkLoaded(); |
70 | 70 |
71 const KURL& finalURL() const { return m_finalURL; } | 71 const KURL& finalURL() const { return m_finalURL; } |
72 | 72 |
73 void loadChildSheets(); | 73 void loadChildSheets(); |
74 void loadChildSheet(const String& href); | 74 void loadChildSheet(const String& href); |
75 | 75 |
76 ResourceFetcher* fetcher(); | 76 ResourceFetcher* fetcher(); |
77 | 77 |
78 Document* ownerDocument(); | 78 Document* ownerDocument(); |
79 virtual XSLStyleSheet* parentStyleSheet() const OVERRIDE { return m_parentSt
yleSheet; } | 79 virtual XSLStyleSheet* parentStyleSheet() const override { return m_parentSt
yleSheet; } |
80 void setParentStyleSheet(XSLStyleSheet*); | 80 void setParentStyleSheet(XSLStyleSheet*); |
81 | 81 |
82 xmlDocPtr document(); | 82 xmlDocPtr document(); |
83 xsltStylesheetPtr compileStyleSheet(); | 83 xsltStylesheetPtr compileStyleSheet(); |
84 xmlDocPtr locateStylesheetSubResource(xmlDocPtr parentDoc, const xmlChar* ur
i); | 84 xmlDocPtr locateStylesheetSubResource(xmlDocPtr parentDoc, const xmlChar* ur
i); |
85 | 85 |
86 void clearDocuments(); | 86 void clearDocuments(); |
87 | 87 |
88 void markAsProcessed(); | 88 void markAsProcessed(); |
89 bool processed() const { return m_processed; } | 89 bool processed() const { return m_processed; } |
90 | 90 |
91 virtual String type() const OVERRIDE { return "text/xml"; } | 91 virtual String type() const override { return "text/xml"; } |
92 virtual bool disabled() const OVERRIDE { return m_isDisabled; } | 92 virtual bool disabled() const override { return m_isDisabled; } |
93 virtual void setDisabled(bool b) OVERRIDE { m_isDisabled = b; } | 93 virtual void setDisabled(bool b) override { m_isDisabled = b; } |
94 virtual Node* ownerNode() const OVERRIDE { return m_ownerNode; } | 94 virtual Node* ownerNode() const override { return m_ownerNode; } |
95 virtual String href() const OVERRIDE { return m_originalURL; } | 95 virtual String href() const override { return m_originalURL; } |
96 virtual String title() const OVERRIDE { return emptyString(); } | 96 virtual String title() const override { return emptyString(); } |
97 | 97 |
98 virtual void clearOwnerNode() OVERRIDE { m_ownerNode = nullptr; } | 98 virtual void clearOwnerNode() override { m_ownerNode = nullptr; } |
99 virtual KURL baseURL() const OVERRIDE { return m_finalURL; } | 99 virtual KURL baseURL() const override { return m_finalURL; } |
100 virtual bool isLoading() const OVERRIDE; | 100 virtual bool isLoading() const override; |
101 | 101 |
102 virtual void trace(Visitor*) OVERRIDE; | 102 virtual void trace(Visitor*) override; |
103 | 103 |
104 private: | 104 private: |
105 XSLStyleSheet(Node* parentNode, const String& originalURL, const KURL& final
URL, bool embedded); | 105 XSLStyleSheet(Node* parentNode, const String& originalURL, const KURL& final
URL, bool embedded); |
106 XSLStyleSheet(Document* ownerDocument, Node* styleSheetRootNode, const Strin
g& originalURL, const KURL& finalURL, bool embedded); | 106 XSLStyleSheet(Document* ownerDocument, Node* styleSheetRootNode, const Strin
g& originalURL, const KURL& finalURL, bool embedded); |
107 XSLStyleSheet(XSLImportRule* parentImport, const String& originalURL, const
KURL& finalURL); | 107 XSLStyleSheet(XSLImportRule* parentImport, const String& originalURL, const
KURL& finalURL); |
108 | 108 |
109 RawPtrWillBeMember<Node> m_ownerNode; | 109 RawPtrWillBeMember<Node> m_ownerNode; |
110 String m_originalURL; | 110 String m_originalURL; |
111 KURL m_finalURL; | 111 KURL m_finalURL; |
112 bool m_isDisabled; | 112 bool m_isDisabled; |
113 | 113 |
114 WillBeHeapVector<OwnPtrWillBeMember<XSLImportRule> > m_children; | 114 WillBeHeapVector<OwnPtrWillBeMember<XSLImportRule> > m_children; |
115 | 115 |
116 bool m_embedded; | 116 bool m_embedded; |
117 bool m_processed; | 117 bool m_processed; |
118 | 118 |
119 xmlDocPtr m_stylesheetDoc; | 119 xmlDocPtr m_stylesheetDoc; |
120 bool m_stylesheetDocTaken; | 120 bool m_stylesheetDocTaken; |
121 bool m_compilationFailed; | 121 bool m_compilationFailed; |
122 | 122 |
123 RawPtrWillBeMember<XSLStyleSheet> m_parentStyleSheet; | 123 RawPtrWillBeMember<XSLStyleSheet> m_parentStyleSheet; |
124 RefPtrWillBeMember<Document> m_ownerDocument; | 124 RefPtrWillBeMember<Document> m_ownerDocument; |
125 }; | 125 }; |
126 | 126 |
127 DEFINE_TYPE_CASTS(XSLStyleSheet, StyleSheet, sheet, !sheet->isCSSStyleSheet(), !
sheet.isCSSStyleSheet()); | 127 DEFINE_TYPE_CASTS(XSLStyleSheet, StyleSheet, sheet, !sheet->isCSSStyleSheet(), !
sheet.isCSSStyleSheet()); |
128 | 128 |
129 } // namespace blink | 129 } // namespace blink |
130 | 130 |
131 #endif // XSLStyleSheet_h | 131 #endif // XSLStyleSheet_h |
OLD | NEW |