| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 PassRefPtrWillBeRawPtr<XSLStyleSheet> createForXSLTProcessor(Document
* document, Node* stylesheetRootNode, const String& originalURL, const KURL& fin
alURL) | 58 static PassRefPtrWillBeRawPtr<XSLStyleSheet> createForXSLTProcessor(Document
* document, Node* stylesheetRootNode, const String& originalURL, const KURL& fin
alURL) |
| 59 { | 59 { |
| 60 ASSERT(RuntimeEnabledFeatures::xsltEnabled()); | 60 ASSERT(RuntimeEnabledFeatures::xsltEnabled()); |
| 61 return adoptRefWillBeNoop(new XSLStyleSheet(document, stylesheetRootNode
, originalURL, finalURL, false)); | 61 return adoptRefWillBeNoop(new XSLStyleSheet(document, stylesheetRootNode
, originalURL, finalURL, false)); |
| 62 } | 62 } |
| 63 | 63 |
| 64 virtual ~XSLStyleSheet(); | 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; } |
| 71 | 71 |
| 72 void loadChildSheets(); | 72 void loadChildSheets(); |
| 73 void loadChildSheet(const String& href); | 73 void loadChildSheet(const String& href); |
| 74 | 74 |
| 75 Document* ownerDocument(); | 75 Document* ownerDocument(); |
| 76 virtual XSLStyleSheet* parentStyleSheet() const override { return m_parentSt
yleSheet; } | 76 XSLStyleSheet* parentStyleSheet() const override { return m_parentStyleSheet
; } |
| 77 void setParentStyleSheet(XSLStyleSheet*); | 77 void setParentStyleSheet(XSLStyleSheet*); |
| 78 | 78 |
| 79 xmlDocPtr document(); | 79 xmlDocPtr document(); |
| 80 xsltStylesheetPtr compileStyleSheet(); | 80 xsltStylesheetPtr compileStyleSheet(); |
| 81 xmlDocPtr locateStylesheetSubResource(xmlDocPtr parentDoc, const xmlChar* ur
i); | 81 xmlDocPtr locateStylesheetSubResource(xmlDocPtr parentDoc, const xmlChar* ur
i); |
| 82 | 82 |
| 83 void clearDocuments(); | 83 void clearDocuments(); |
| 84 | 84 |
| 85 void markAsProcessed(); | 85 void markAsProcessed(); |
| 86 bool processed() const { return m_processed; } | 86 bool processed() const { return m_processed; } |
| 87 | 87 |
| 88 virtual String type() const override { return "text/xml"; } | 88 String type() const override { return "text/xml"; } |
| 89 virtual bool disabled() const override { return m_isDisabled; } | 89 bool disabled() const override { return m_isDisabled; } |
| 90 virtual void setDisabled(bool b) override { m_isDisabled = b; } | 90 void setDisabled(bool b) override { m_isDisabled = b; } |
| 91 virtual Node* ownerNode() const override { return m_ownerNode; } | 91 Node* ownerNode() const override { return m_ownerNode; } |
| 92 virtual String href() const override { return m_originalURL; } | 92 String href() const override { return m_originalURL; } |
| 93 virtual String title() const override { return emptyString(); } | 93 String title() const override { return emptyString(); } |
| 94 | 94 |
| 95 virtual void clearOwnerNode() override { m_ownerNode = nullptr; } | 95 void clearOwnerNode() override { m_ownerNode = nullptr; } |
| 96 virtual KURL baseURL() const override { return m_finalURL; } | 96 KURL baseURL() const override { return m_finalURL; } |
| 97 virtual bool isLoading() const override; | 97 bool isLoading() const override; |
| 98 | 98 |
| 99 DECLARE_VIRTUAL_TRACE(); | 99 DECLARE_VIRTUAL_TRACE(); |
| 100 | 100 |
| 101 private: | 101 private: |
| 102 XSLStyleSheet(Node* parentNode, const String& originalURL, const KURL& final
URL, bool embedded); | 102 XSLStyleSheet(Node* parentNode, const String& originalURL, const KURL& final
URL, bool embedded); |
| 103 XSLStyleSheet(Document* ownerDocument, Node* styleSheetRootNode, const Strin
g& originalURL, const KURL& finalURL, bool embedded); | 103 XSLStyleSheet(Document* ownerDocument, Node* styleSheetRootNode, const Strin
g& originalURL, const KURL& finalURL, bool embedded); |
| 104 XSLStyleSheet(XSLImportRule* parentImport, const String& originalURL, const
KURL& finalURL); | 104 XSLStyleSheet(XSLImportRule* parentImport, const String& originalURL, const
KURL& finalURL); |
| 105 | 105 |
| 106 RawPtrWillBeMember<Node> m_ownerNode; | 106 RawPtrWillBeMember<Node> m_ownerNode; |
| 107 String m_originalURL; | 107 String m_originalURL; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 119 | 119 |
| 120 RawPtrWillBeMember<XSLStyleSheet> m_parentStyleSheet; | 120 RawPtrWillBeMember<XSLStyleSheet> m_parentStyleSheet; |
| 121 RefPtrWillBeMember<Document> m_ownerDocument; | 121 RefPtrWillBeMember<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 |