| 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 17 matching lines...) Expand all Loading... |
| 28 #include "core/fetch/StyleSheetResourceClient.h" | 28 #include "core/fetch/StyleSheetResourceClient.h" |
| 29 | 29 |
| 30 namespace blink { | 30 namespace blink { |
| 31 | 31 |
| 32 class StyleSheet; | 32 class StyleSheet; |
| 33 class CSSStyleSheet; | 33 class CSSStyleSheet; |
| 34 class EventListener; | 34 class EventListener; |
| 35 | 35 |
| 36 class ProcessingInstruction final : public CharacterData, private ResourceOwner<
StyleSheetResource> { | 36 class ProcessingInstruction final : public CharacterData, private ResourceOwner<
StyleSheetResource> { |
| 37 DEFINE_WRAPPERTYPEINFO(); | 37 DEFINE_WRAPPERTYPEINFO(); |
| 38 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ProcessingInstruction); | 38 USING_GARBAGE_COLLECTED_MIXIN(ProcessingInstruction); |
| 39 public: | 39 public: |
| 40 static PassRefPtrWillBeRawPtr<ProcessingInstruction> create(Document&, const
String& target, const String& data); | 40 static RawPtr<ProcessingInstruction> create(Document&, const String& target,
const String& data); |
| 41 ~ProcessingInstruction() override; | 41 ~ProcessingInstruction() override; |
| 42 DECLARE_VIRTUAL_TRACE(); | 42 DECLARE_VIRTUAL_TRACE(); |
| 43 | 43 |
| 44 const String& target() const { return m_target; } | 44 const String& target() const { return m_target; } |
| 45 | 45 |
| 46 void setCreatedByParser(bool createdByParser) { m_createdByParser = createdB
yParser; } | 46 void setCreatedByParser(bool createdByParser) { m_createdByParser = createdB
yParser; } |
| 47 | 47 |
| 48 const String& localHref() const { return m_localHref; } | 48 const String& localHref() const { return m_localHref; } |
| 49 StyleSheet* sheet() const { return m_sheet.get(); } | 49 StyleSheet* sheet() const { return m_sheet.get(); } |
| 50 | 50 |
| 51 bool isCSS() const { return m_isCSS; } | 51 bool isCSS() const { return m_isCSS; } |
| 52 bool isXSL() const { return m_isXSL; } | 52 bool isXSL() const { return m_isXSL; } |
| 53 | 53 |
| 54 void didAttributeChanged(); | 54 void didAttributeChanged(); |
| 55 bool isLoading() const; | 55 bool isLoading() const; |
| 56 | 56 |
| 57 // For XSLT | 57 // For XSLT |
| 58 class DetachableEventListener : public WillBeGarbageCollectedMixin { | 58 class DetachableEventListener : public GarbageCollectedMixin { |
| 59 public: | 59 public: |
| 60 virtual ~DetachableEventListener() { } | 60 virtual ~DetachableEventListener() { } |
| 61 virtual EventListener* toEventListener() = 0; | 61 virtual EventListener* toEventListener() = 0; |
| 62 // Detach event listener from its processing instruction. | 62 // Detach event listener from its processing instruction. |
| 63 virtual void detach() = 0; | 63 virtual void detach() = 0; |
| 64 | 64 |
| 65 DEFINE_INLINE_VIRTUAL_TRACE() { } | 65 DEFINE_INLINE_VIRTUAL_TRACE() { } |
| 66 | 66 |
| 67 #if !ENABLE(OILPAN) | 67 #if !ENABLE(OILPAN) |
| 68 void ref() { refDetachableEventListener(); } | 68 void ref() { refDetachableEventListener(); } |
| 69 void deref() { derefDetachableEventListener(); } | 69 void deref() { derefDetachableEventListener(); } |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 virtual void refDetachableEventListener() = 0; | 72 virtual void refDetachableEventListener() = 0; |
| 73 virtual void derefDetachableEventListener() = 0; | 73 virtual void derefDetachableEventListener() = 0; |
| 74 #endif | 74 #endif |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 void setEventListenerForXSLT(PassRefPtrWillBeRawPtr<DetachableEventListener>
listener) { m_listenerForXSLT = listener; } | 77 void setEventListenerForXSLT(RawPtr<DetachableEventListener> listener) { m_l
istenerForXSLT = listener; } |
| 78 EventListener* eventListenerForXSLT(); | 78 EventListener* eventListenerForXSLT(); |
| 79 void clearEventListenerForXSLT(); | 79 void clearEventListenerForXSLT(); |
| 80 | 80 |
| 81 private: | 81 private: |
| 82 ProcessingInstruction(Document&, const String& target, const String& data); | 82 ProcessingInstruction(Document&, const String& target, const String& data); |
| 83 | 83 |
| 84 String nodeName() const override; | 84 String nodeName() const override; |
| 85 NodeType nodeType() const override; | 85 NodeType nodeType() const override; |
| 86 PassRefPtrWillBeRawPtr<Node> cloneNode(bool deep) override; | 86 RawPtr<Node> cloneNode(bool deep) override; |
| 87 | 87 |
| 88 InsertionNotificationRequest insertedInto(ContainerNode*) override; | 88 InsertionNotificationRequest insertedInto(ContainerNode*) override; |
| 89 void removedFrom(ContainerNode*) override; | 89 void removedFrom(ContainerNode*) override; |
| 90 | 90 |
| 91 bool checkStyleSheet(String& href, String& charset); | 91 bool checkStyleSheet(String& href, String& charset); |
| 92 void process(const String& href, const String& charset); | 92 void process(const String& href, const String& charset); |
| 93 | 93 |
| 94 void setCSSStyleSheet(const String& href, const KURL& baseURL, const String&
charset, const CSSStyleSheetResource*) override; | 94 void setCSSStyleSheet(const String& href, const KURL& baseURL, const String&
charset, const CSSStyleSheetResource*) override; |
| 95 void setXSLStyleSheet(const String& href, const KURL& baseURL, const String&
sheet) override; | 95 void setXSLStyleSheet(const String& href, const KURL& baseURL, const String&
sheet) override; |
| 96 | 96 |
| 97 bool sheetLoaded() override; | 97 bool sheetLoaded() override; |
| 98 | 98 |
| 99 void parseStyleSheet(const String& sheet); | 99 void parseStyleSheet(const String& sheet); |
| 100 void clearSheet(); | 100 void clearSheet(); |
| 101 | 101 |
| 102 String debugName() const override { return "ProcessingInstruction"; } | 102 String debugName() const override { return "ProcessingInstruction"; } |
| 103 | 103 |
| 104 String m_target; | 104 String m_target; |
| 105 String m_localHref; | 105 String m_localHref; |
| 106 String m_title; | 106 String m_title; |
| 107 String m_media; | 107 String m_media; |
| 108 RefPtrWillBeMember<StyleSheet> m_sheet; | 108 Member<StyleSheet> m_sheet; |
| 109 bool m_loading; | 109 bool m_loading; |
| 110 bool m_alternate; | 110 bool m_alternate; |
| 111 bool m_createdByParser; | 111 bool m_createdByParser; |
| 112 bool m_isCSS; | 112 bool m_isCSS; |
| 113 bool m_isXSL; | 113 bool m_isXSL; |
| 114 | 114 |
| 115 RefPtrWillBeMember<DetachableEventListener> m_listenerForXSLT; | 115 Member<DetachableEventListener> m_listenerForXSLT; |
| 116 }; | 116 }; |
| 117 | 117 |
| 118 DEFINE_NODE_TYPE_CASTS(ProcessingInstruction, nodeType() == Node::PROCESSING_INS
TRUCTION_NODE); | 118 DEFINE_NODE_TYPE_CASTS(ProcessingInstruction, nodeType() == Node::PROCESSING_INS
TRUCTION_NODE); |
| 119 | 119 |
| 120 inline bool isXSLStyleSheet(const Node& node) | 120 inline bool isXSLStyleSheet(const Node& node) |
| 121 { | 121 { |
| 122 return node.nodeType() == Node::PROCESSING_INSTRUCTION_NODE && toProcessingI
nstruction(node).isXSL(); | 122 return node.nodeType() == Node::PROCESSING_INSTRUCTION_NODE && toProcessingI
nstruction(node).isXSL(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 } // namespace blink | 125 } // namespace blink |
| 126 | 126 |
| 127 #endif // ProcessingInstruction_h | 127 #endif // ProcessingInstruction_h |
| OLD | NEW |