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 20 matching lines...) Expand all Loading... |
31 #include <libxslt/transform.h> | 31 #include <libxslt/transform.h> |
32 | 32 |
33 namespace blink { | 33 namespace blink { |
34 | 34 |
35 class XSLImportRule; | 35 class XSLImportRule; |
36 | 36 |
37 class XSLStyleSheet final : public StyleSheet { | 37 class XSLStyleSheet final : public StyleSheet { |
38 public: | 38 public: |
39 static XSLStyleSheet* create(XSLImportRule* parentImport, const String& orig
inalURL, const KURL& finalURL) | 39 static XSLStyleSheet* create(XSLImportRule* parentImport, const String& orig
inalURL, const KURL& finalURL) |
40 { | 40 { |
41 ASSERT(RuntimeEnabledFeatures::xsltEnabled()); | 41 DCHECK(RuntimeEnabledFeatures::xsltEnabled()); |
42 return new XSLStyleSheet(parentImport, originalURL, finalURL); | 42 return new XSLStyleSheet(parentImport, originalURL, finalURL); |
43 } | 43 } |
44 static XSLStyleSheet* create(ProcessingInstruction* parentNode, const String
& originalURL, const KURL& finalURL) | 44 static XSLStyleSheet* create(ProcessingInstruction* parentNode, const String
& originalURL, const KURL& finalURL) |
45 { | 45 { |
46 ASSERT(RuntimeEnabledFeatures::xsltEnabled()); | 46 DCHECK(RuntimeEnabledFeatures::xsltEnabled()); |
47 return new XSLStyleSheet(parentNode, originalURL, finalURL, false); | 47 return new XSLStyleSheet(parentNode, originalURL, finalURL, false); |
48 } | 48 } |
49 static XSLStyleSheet* createEmbedded(ProcessingInstruction* parentNode, cons
t KURL& finalURL) | 49 static XSLStyleSheet* createEmbedded(ProcessingInstruction* parentNode, cons
t KURL& finalURL) |
50 { | 50 { |
51 ASSERT(RuntimeEnabledFeatures::xsltEnabled()); | 51 DCHECK(RuntimeEnabledFeatures::xsltEnabled()); |
52 return new XSLStyleSheet(parentNode, finalURL.getString(), finalURL, tru
e); | 52 return new XSLStyleSheet(parentNode, finalURL.getString(), finalURL, tru
e); |
53 } | 53 } |
54 | 54 |
55 // Taking an arbitrary node is unsafe, because owner node pointer can become | 55 // Taking an arbitrary node is unsafe, because owner node pointer can become |
56 // stale. XSLTProcessor ensures that the stylesheet doesn't outlive its | 56 // stale. XSLTProcessor ensures that the stylesheet doesn't outlive its |
57 // parent, in part by not exposing it to JavaScript. | 57 // parent, in part by not exposing it to JavaScript. |
58 static XSLStyleSheet* createForXSLTProcessor(Document* document, Node* style
sheetRootNode, const String& originalURL, const KURL& finalURL) | 58 static XSLStyleSheet* createForXSLTProcessor(Document* document, Node* style
sheetRootNode, const String& originalURL, const KURL& finalURL) |
59 { | 59 { |
60 ASSERT(RuntimeEnabledFeatures::xsltEnabled()); | 60 DCHECK(RuntimeEnabledFeatures::xsltEnabled()); |
61 return new XSLStyleSheet(document, stylesheetRootNode, originalURL, fina
lURL, false); | 61 return new XSLStyleSheet(document, stylesheetRootNode, originalURL, fina
lURL, false); |
62 } | 62 } |
63 | 63 |
64 ~XSLStyleSheet() override; | 64 ~XSLStyleSheet() override; |
65 | 65 |
66 bool parseString(const String&); | 66 bool parseString(const String&); |
67 | 67 |
68 void checkLoaded(); | 68 void checkLoaded(); |
69 | 69 |
70 const KURL& finalURL() const { return m_finalURL; } | 70 const KURL& finalURL() const { return m_finalURL; } |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 119 |
120 Member<XSLStyleSheet> m_parentStyleSheet; | 120 Member<XSLStyleSheet> m_parentStyleSheet; |
121 Member<Document> m_ownerDocument; | 121 Member<Document> m_ownerDocument; |
122 }; | 122 }; |
123 | 123 |
124 DEFINE_TYPE_CASTS(XSLStyleSheet, StyleSheet, sheet, !sheet->isCSSStyleSheet(), !
sheet.isCSSStyleSheet()); | 124 DEFINE_TYPE_CASTS(XSLStyleSheet, StyleSheet, sheet, !sheet->isCSSStyleSheet(), !
sheet.isCSSStyleSheet()); |
125 | 125 |
126 } // namespace blink | 126 } // namespace blink |
127 | 127 |
128 #endif // XSLStyleSheet_h | 128 #endif // XSLStyleSheet_h |
OLD | NEW |