| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Peter Kelly (pmk@post.com) | 2 * Copyright (C) 2000 Peter Kelly (pmk@post.com) |
| 3 * Copyright (C) 2006 Apple Inc. All rights reserved. | 3 * Copyright (C) 2006 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 const String& localHref() const { return m_localHref; } | 47 const String& localHref() const { return m_localHref; } |
| 48 StyleSheet* sheet() const { return m_sheet.get(); } | 48 StyleSheet* sheet() const { return m_sheet.get(); } |
| 49 | 49 |
| 50 bool isCSS() const { return m_isCSS; } | 50 bool isCSS() const { return m_isCSS; } |
| 51 bool isXSL() const { return m_isXSL; } | 51 bool isXSL() const { return m_isXSL; } |
| 52 | 52 |
| 53 void didAttributeChanged(); | 53 void didAttributeChanged(); |
| 54 bool isLoading() const; | 54 bool isLoading() const; |
| 55 | 55 |
| 56 // For XSLT | 56 // For XSLT |
| 57 class DetachableEventListener { | 57 class DetachableEventListener : public WillBeGarbageCollectedMixin { |
| 58 public: | 58 public: |
| 59 virtual ~DetachableEventListener() { } | 59 virtual ~DetachableEventListener() { } |
| 60 virtual EventListener* toEventListener() = 0; |
| 61 // Detach event listener from its processing instruction. |
| 62 virtual void detach() = 0; |
| 60 | 63 |
| 64 DEFINE_INLINE_VIRTUAL_TRACE() { } |
| 65 |
| 66 #if !ENABLE(OILPAN) |
| 61 void ref() { refDetachableEventListener(); } | 67 void ref() { refDetachableEventListener(); } |
| 62 void deref() { derefDetachableEventListener(); } | 68 void deref() { derefDetachableEventListener(); } |
| 63 | 69 |
| 64 virtual EventListener* toEventListener() = 0; | |
| 65 | |
| 66 // Detach event listener from its processing instruction. | |
| 67 virtual void detach() = 0; | |
| 68 | |
| 69 private: | 70 private: |
| 70 virtual void refDetachableEventListener() = 0; | 71 virtual void refDetachableEventListener() = 0; |
| 71 virtual void derefDetachableEventListener() = 0; | 72 virtual void derefDetachableEventListener() = 0; |
| 73 #endif |
| 72 }; | 74 }; |
| 73 | 75 |
| 74 void setEventListenerForXSLT(PassRefPtr<DetachableEventListener> listener) {
m_listenerForXSLT = listener; } | 76 void setEventListenerForXSLT(PassRefPtrWillBeRawPtr<DetachableEventListener>
listener) { m_listenerForXSLT = listener; } |
| 75 EventListener* eventListenerForXSLT(); | 77 EventListener* eventListenerForXSLT(); |
| 76 void clearEventListenerForXSLT(); | 78 void clearEventListenerForXSLT(); |
| 77 | 79 |
| 78 private: | 80 private: |
| 79 ProcessingInstruction(Document&, const String& target, const String& data); | 81 ProcessingInstruction(Document&, const String& target, const String& data); |
| 80 | 82 |
| 81 String nodeName() const override; | 83 String nodeName() const override; |
| 82 NodeType nodeType() const override; | 84 NodeType nodeType() const override; |
| 83 PassRefPtrWillBeRawPtr<Node> cloneNode(bool deep = true) override; | 85 PassRefPtrWillBeRawPtr<Node> cloneNode(bool deep = true) override; |
| 84 | 86 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 100 String m_localHref; | 102 String m_localHref; |
| 101 String m_title; | 103 String m_title; |
| 102 String m_media; | 104 String m_media; |
| 103 RefPtrWillBeMember<StyleSheet> m_sheet; | 105 RefPtrWillBeMember<StyleSheet> m_sheet; |
| 104 bool m_loading; | 106 bool m_loading; |
| 105 bool m_alternate; | 107 bool m_alternate; |
| 106 bool m_createdByParser; | 108 bool m_createdByParser; |
| 107 bool m_isCSS; | 109 bool m_isCSS; |
| 108 bool m_isXSL; | 110 bool m_isXSL; |
| 109 | 111 |
| 110 RefPtr<DetachableEventListener> m_listenerForXSLT; | 112 RefPtrWillBeMember<DetachableEventListener> m_listenerForXSLT; |
| 111 }; | 113 }; |
| 112 | 114 |
| 113 DEFINE_NODE_TYPE_CASTS(ProcessingInstruction, nodeType() == Node::PROCESSING_INS
TRUCTION_NODE); | 115 DEFINE_NODE_TYPE_CASTS(ProcessingInstruction, nodeType() == Node::PROCESSING_INS
TRUCTION_NODE); |
| 114 | 116 |
| 115 inline bool isXSLStyleSheet(const Node& node) | 117 inline bool isXSLStyleSheet(const Node& node) |
| 116 { | 118 { |
| 117 return node.nodeType() == Node::PROCESSING_INSTRUCTION_NODE && toProcessingI
nstruction(node).isXSL(); | 119 return node.nodeType() == Node::PROCESSING_INSTRUCTION_NODE && toProcessingI
nstruction(node).isXSL(); |
| 118 } | 120 } |
| 119 | 121 |
| 120 } // namespace blink | 122 } // namespace blink |
| 121 | 123 |
| 122 #endif // ProcessingInstruction_h | 124 #endif // ProcessingInstruction_h |
| OLD | NEW |