| 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 23 matching lines...) Expand all Loading... |
| 34 namespace WebCore { | 34 namespace WebCore { |
| 35 | 35 |
| 36 class ResourceFetcher; | 36 class ResourceFetcher; |
| 37 class XSLImportRule; | 37 class XSLImportRule; |
| 38 | 38 |
| 39 class XSLStyleSheet FINAL : public StyleSheet { | 39 class XSLStyleSheet FINAL : public StyleSheet { |
| 40 public: | 40 public: |
| 41 static PassRefPtrWillBeRawPtr<XSLStyleSheet> create(XSLImportRule* parentImp
ort, const String& originalURL, const KURL& finalURL) | 41 static PassRefPtrWillBeRawPtr<XSLStyleSheet> create(XSLImportRule* parentImp
ort, const String& originalURL, const KURL& finalURL) |
| 42 { | 42 { |
| 43 ASSERT(RuntimeEnabledFeatures::xsltEnabled()); | 43 ASSERT(RuntimeEnabledFeatures::xsltEnabled()); |
| 44 return adoptRefWillBeRefCountedGarbageCollected(new XSLStyleSheet(parent
Import, originalURL, finalURL)); | 44 return adoptRefWillBeNoop(new XSLStyleSheet(parentImport, originalURL, f
inalURL)); |
| 45 } | 45 } |
| 46 static PassRefPtrWillBeRawPtr<XSLStyleSheet> create(ProcessingInstruction* p
arentNode, const String& originalURL, const KURL& finalURL) | 46 static PassRefPtrWillBeRawPtr<XSLStyleSheet> create(ProcessingInstruction* p
arentNode, const String& originalURL, const KURL& finalURL) |
| 47 { | 47 { |
| 48 ASSERT(RuntimeEnabledFeatures::xsltEnabled()); | 48 ASSERT(RuntimeEnabledFeatures::xsltEnabled()); |
| 49 return adoptRefWillBeRefCountedGarbageCollected(new XSLStyleSheet(parent
Node, originalURL, finalURL, false)); | 49 return adoptRefWillBeNoop(new XSLStyleSheet(parentNode, originalURL, fin
alURL, false)); |
| 50 } | 50 } |
| 51 static PassRefPtrWillBeRawPtr<XSLStyleSheet> createEmbedded(ProcessingInstru
ction* parentNode, const KURL& finalURL) | 51 static PassRefPtrWillBeRawPtr<XSLStyleSheet> createEmbedded(ProcessingInstru
ction* parentNode, const KURL& finalURL) |
| 52 { | 52 { |
| 53 ASSERT(RuntimeEnabledFeatures::xsltEnabled()); | 53 ASSERT(RuntimeEnabledFeatures::xsltEnabled()); |
| 54 return adoptRefWillBeRefCountedGarbageCollected(new XSLStyleSheet(parent
Node, finalURL.string(), finalURL, true)); | 54 return adoptRefWillBeNoop(new XSLStyleSheet(parentNode, finalURL.string(
), finalURL, true)); |
| 55 } | 55 } |
| 56 | 56 |
| 57 // Taking an arbitrary node is unsafe, because owner node pointer can become
stale. | 57 // Taking an arbitrary node is unsafe, because owner node pointer can become
stale. |
| 58 // XSLTProcessor ensures that the stylesheet doesn't outlive its parent, in
part by not exposing it to JavaScript. | 58 // XSLTProcessor ensures that the stylesheet doesn't outlive its parent, in
part by not exposing it to JavaScript. |
| 59 static PassRefPtrWillBeRawPtr<XSLStyleSheet> createForXSLTProcessor(Node* pa
rentNode, const String& originalURL, const KURL& finalURL) | 59 static PassRefPtrWillBeRawPtr<XSLStyleSheet> createForXSLTProcessor(Node* pa
rentNode, const String& originalURL, const KURL& finalURL) |
| 60 { | 60 { |
| 61 ASSERT(RuntimeEnabledFeatures::xsltEnabled()); | 61 ASSERT(RuntimeEnabledFeatures::xsltEnabled()); |
| 62 return adoptRefWillBeRefCountedGarbageCollected(new XSLStyleSheet(parent
Node, originalURL, finalURL, false)); | 62 return adoptRefWillBeNoop(new XSLStyleSheet(parentNode, originalURL, fin
alURL, false)); |
| 63 } | 63 } |
| 64 | 64 |
| 65 virtual ~XSLStyleSheet(); | 65 virtual ~XSLStyleSheet(); |
| 66 | 66 |
| 67 bool parseString(const String&); | 67 bool parseString(const String&); |
| 68 | 68 |
| 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 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 Vector<OwnPtr<XSLImportRule> > m_children; | 113 Vector<OwnPtr<XSLImportRule> > m_children; |
| 114 | 114 |
| 115 bool m_embedded; | 115 bool m_embedded; |
| 116 bool m_processed; | 116 bool m_processed; |
| 117 | 117 |
| 118 xmlDocPtr m_stylesheetDoc; | 118 xmlDocPtr m_stylesheetDoc; |
| 119 bool m_stylesheetDocTaken; | 119 bool m_stylesheetDocTaken; |
| 120 bool m_compilationFailed; | 120 bool m_compilationFailed; |
| 121 | 121 |
| 122 XSLStyleSheet* m_parentStyleSheet; | 122 RawPtrWillBeMember<XSLStyleSheet> m_parentStyleSheet; |
| 123 }; | 123 }; |
| 124 | 124 |
| 125 DEFINE_TYPE_CASTS(XSLStyleSheet, StyleSheet, sheet, !sheet->isCSSStyleSheet(), !
sheet.isCSSStyleSheet()); | 125 DEFINE_TYPE_CASTS(XSLStyleSheet, StyleSheet, sheet, !sheet->isCSSStyleSheet(), !
sheet.isCSSStyleSheet()); |
| 126 | 126 |
| 127 } // namespace WebCore | 127 } // namespace WebCore |
| 128 | 128 |
| 129 #endif // XSLStyleSheet_h | 129 #endif // XSLStyleSheet_h |
| OLD | NEW |