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()) | |
39 , m_embedded(embedded) | 38 , m_embedded(embedded) |
40 { | 39 { |
41 } | 40 } |
42 | 41 |
43 XSLStyleSheet::~XSLStyleSheet() | 42 XSLStyleSheet::~XSLStyleSheet() |
44 { | 43 { |
45 } | 44 } |
46 | 45 |
47 bool XSLStyleSheet::isLoading() | 46 bool XSLStyleSheet::isLoading() |
48 { | 47 { |
49 notImplemented(); | 48 notImplemented(); |
50 return false; | 49 return false; |
51 } | 50 } |
52 | 51 |
53 void XSLStyleSheet::checkLoaded() | 52 void XSLStyleSheet::checkLoaded() |
54 { | 53 { |
55 if (ownerNode()) | 54 if (ownerNode()) |
56 ownerNode()->sheetLoaded(); | 55 ownerNode()->sheetLoaded(); |
57 } | 56 } |
58 | 57 |
59 void XSLStyleSheet::clearDocuments() | 58 void XSLStyleSheet::clearDocuments() |
60 { | 59 { |
61 notImplemented(); | 60 notImplemented(); |
62 } | 61 } |
63 | 62 |
64 CachedResourceLoader* XSLStyleSheet::cachedResourceLoader() | 63 CachedResourceLoader* XSLStyleSheet::cachedResourceLoader() |
65 { | 64 { |
66 if (!m_ownerDocument) | 65 Document* document = ownerDocument(); |
| 66 if (!document) |
67 return 0; | 67 return 0; |
68 return m_ownerDocument->cachedResourceLoader(); | 68 return document->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 |
91 void XSLStyleSheet::setParentStyleSheet(XSLStyleSheet*) | 97 void XSLStyleSheet::setParentStyleSheet(XSLStyleSheet*) |
92 { | 98 { |
93 notImplemented(); | 99 notImplemented(); |
94 } | 100 } |
95 | 101 |
96 void XSLStyleSheet::markAsProcessed() | 102 void XSLStyleSheet::markAsProcessed() |
97 { | 103 { |
98 notImplemented(); | 104 notImplemented(); |
99 } | 105 } |
100 | 106 |
101 } // namespace WebCore | 107 } // namespace WebCore |
102 | 108 |
103 #endif // ENABLE(XSLT) | 109 #endif // ENABLE(XSLT) |
OLD | NEW |