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) 2009 Jakub Wieczorek <faw217@gmail.com> | 4 * Copyright (C) 2009 Jakub Wieczorek <faw217@gmail.com> |
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 "Document.h" | 28 #include "Document.h" |
29 #include "Node.h" | 29 #include "Node.h" |
30 #include "NotImplemented.h" | 30 #include "NotImplemented.h" |
31 #include "XSLTProcessor.h" | 31 #include "XSLTProcessor.h" |
32 #include "loader.h" | 32 #include "loader.h" |
33 | 33 |
34 namespace WebCore { | 34 namespace WebCore { |
35 | 35 |
36 XSLStyleSheet::XSLStyleSheet(Node* parentNode, const String& originalURL, const
KURL& finalURL, bool embedded) | 36 XSLStyleSheet::XSLStyleSheet(Node* parentNode, const String& originalURL, const
KURL& finalURL, bool embedded) |
37 : StyleSheet(parentNode, originalURL, finalURL) | 37 : StyleSheet(parentNode, originalURL, finalURL) |
| 38 , m_ownerDocument(parentNode->document()) |
38 , m_embedded(embedded) | 39 , m_embedded(embedded) |
39 { | 40 { |
40 } | 41 } |
41 | 42 |
42 XSLStyleSheet::~XSLStyleSheet() | 43 XSLStyleSheet::~XSLStyleSheet() |
43 { | 44 { |
44 } | 45 } |
45 | 46 |
46 bool XSLStyleSheet::isLoading() | 47 bool XSLStyleSheet::isLoading() |
47 { | 48 { |
48 notImplemented(); | 49 notImplemented(); |
49 return false; | 50 return false; |
50 } | 51 } |
51 | 52 |
52 void XSLStyleSheet::checkLoaded() | 53 void XSLStyleSheet::checkLoaded() |
53 { | 54 { |
54 if (ownerNode()) | 55 if (ownerNode()) |
55 ownerNode()->sheetLoaded(); | 56 ownerNode()->sheetLoaded(); |
56 } | 57 } |
57 | 58 |
58 void XSLStyleSheet::clearDocuments() | 59 void XSLStyleSheet::clearDocuments() |
59 { | 60 { |
60 notImplemented(); | 61 notImplemented(); |
61 } | 62 } |
62 | 63 |
63 CachedResourceLoader* XSLStyleSheet::cachedResourceLoader() | 64 CachedResourceLoader* XSLStyleSheet::cachedResourceLoader() |
64 { | 65 { |
65 Document* document = ownerDocument(); | 66 if (!m_ownerDocument) |
66 if (!document) | |
67 return 0; | 67 return 0; |
68 return document->cachedResourceLoader(); | 68 return m_ownerDocument->cachedResourceLoader(); |
69 } | 69 } |
70 | 70 |
71 bool XSLStyleSheet::parseString(const String& string, bool) | 71 bool XSLStyleSheet::parseString(const String& string, bool) |
72 { | 72 { |
73 // FIXME: Fix QXmlQuery so that it allows compiling the stylesheet before se
tting the document | 73 // FIXME: Fix QXmlQuery so that it allows compiling the stylesheet before se
tting the document |
74 // to be transformed. This way we could not only check if the stylesheet is
correct before using it | 74 // to be transformed. This way we could not only check if the stylesheet is
correct before using it |
75 // but also turn XSLStyleSheet::sheetString() into XSLStyleSheet::query() th
at returns a QXmlQuery. | 75 // but also turn XSLStyleSheet::sheetString() into XSLStyleSheet::query() th
at returns a QXmlQuery. |
76 | 76 |
77 m_sheetString = string; | 77 m_sheetString = string; |
78 return !m_sheetString.isEmpty(); | 78 return !m_sheetString.isEmpty(); |
79 } | 79 } |
80 | 80 |
81 void XSLStyleSheet::loadChildSheets() | 81 void XSLStyleSheet::loadChildSheets() |
82 { | 82 { |
83 notImplemented(); | 83 notImplemented(); |
84 } | 84 } |
85 | 85 |
86 void XSLStyleSheet::loadChildSheet(const String&) | 86 void XSLStyleSheet::loadChildSheet(const String&) |
87 { | 87 { |
88 notImplemented(); | 88 notImplemented(); |
89 } | 89 } |
90 | 90 |
91 Document* XSLStyleSheet::ownerDocument() | |
92 { | |
93 Node* node = ownerNode(); | |
94 return node ? node->document() : 0; | |
95 } | |
96 | |
97 void XSLStyleSheet::setParentStyleSheet(XSLStyleSheet*) | 91 void XSLStyleSheet::setParentStyleSheet(XSLStyleSheet*) |
98 { | 92 { |
99 notImplemented(); | 93 notImplemented(); |
100 } | 94 } |
101 | 95 |
102 void XSLStyleSheet::markAsProcessed() | 96 void XSLStyleSheet::markAsProcessed() |
103 { | 97 { |
104 notImplemented(); | 98 notImplemented(); |
105 } | 99 } |
106 | 100 |
107 } // namespace WebCore | 101 } // namespace WebCore |
108 | 102 |
109 #endif // ENABLE(XSLT) | 103 #endif // ENABLE(XSLT) |
OLD | NEW |