| 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 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 #include "core/dom/CharacterData.h" | 25 #include "core/dom/CharacterData.h" |
| 26 #include "core/fetch/ResourceOwner.h" | 26 #include "core/fetch/ResourceOwner.h" |
| 27 #include "core/fetch/StyleSheetResource.h" | 27 #include "core/fetch/StyleSheetResource.h" |
| 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 | 35 |
| 35 class ProcessingInstruction final : public CharacterData, private ResourceOwner<
StyleSheetResource> { | 36 class ProcessingInstruction final : public CharacterData, private ResourceOwner<
StyleSheetResource> { |
| 36 DEFINE_WRAPPERTYPEINFO(); | 37 DEFINE_WRAPPERTYPEINFO(); |
| 37 public: | 38 public: |
| 38 static PassRefPtrWillBeRawPtr<ProcessingInstruction> create(Document&, const
String& target, const String& data); | 39 static PassRefPtrWillBeRawPtr<ProcessingInstruction> create(Document&, const
String& target, const String& data); |
| 39 virtual ~ProcessingInstruction(); | 40 virtual ~ProcessingInstruction(); |
| 40 virtual void trace(Visitor*) override; | 41 virtual void trace(Visitor*) override; |
| 41 | 42 |
| 42 const String& target() const { return m_target; } | 43 const String& target() const { return m_target; } |
| 43 | 44 |
| 44 void setCreatedByParser(bool createdByParser) { m_createdByParser = createdB
yParser; } | 45 void setCreatedByParser(bool createdByParser) { m_createdByParser = createdB
yParser; } |
| 45 | 46 |
| 46 const String& localHref() const { return m_localHref; } | 47 const String& localHref() const { return m_localHref; } |
| 47 StyleSheet* sheet() const { return m_sheet.get(); } | 48 StyleSheet* sheet() const { return m_sheet.get(); } |
| 48 void setCSSStyleSheet(PassRefPtrWillBeRawPtr<CSSStyleSheet>); | 49 void setCSSStyleSheet(PassRefPtrWillBeRawPtr<CSSStyleSheet>); |
| 49 | 50 |
| 50 bool isCSS() const { return m_isCSS; } | 51 bool isCSS() const { return m_isCSS; } |
| 51 bool isXSL() const { return m_isXSL; } | 52 bool isXSL() const { return m_isXSL; } |
| 52 | 53 |
| 53 void didAttributeChanged(); | 54 void didAttributeChanged(); |
| 54 bool isLoading() const; | 55 bool isLoading() const; |
| 55 | 56 |
| 57 // For XSLT |
| 58 void setEventListenerForXSLT(PassRefPtr<EventListener> listener) { m_listene
rForXSLT = listener; } |
| 59 EventListener* eventListenerForXSLT() { return m_listenerForXSLT.get(); } |
| 60 void clearEventListenerForXSLT() { m_listenerForXSLT.clear(); } |
| 61 |
| 56 private: | 62 private: |
| 57 ProcessingInstruction(Document&, const String& target, const String& data); | 63 ProcessingInstruction(Document&, const String& target, const String& data); |
| 58 | 64 |
| 59 virtual String nodeName() const override; | 65 virtual String nodeName() const override; |
| 60 virtual NodeType nodeType() const override; | 66 virtual NodeType nodeType() const override; |
| 61 virtual PassRefPtrWillBeRawPtr<Node> cloneNode(bool deep = true) override; | 67 virtual PassRefPtrWillBeRawPtr<Node> cloneNode(bool deep = true) override; |
| 62 | 68 |
| 63 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override; | 69 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override; |
| 64 virtual void removedFrom(ContainerNode*) override; | 70 virtual void removedFrom(ContainerNode*) override; |
| 65 | 71 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 77 String m_target; | 83 String m_target; |
| 78 String m_localHref; | 84 String m_localHref; |
| 79 String m_title; | 85 String m_title; |
| 80 String m_media; | 86 String m_media; |
| 81 RefPtrWillBeMember<StyleSheet> m_sheet; | 87 RefPtrWillBeMember<StyleSheet> m_sheet; |
| 82 bool m_loading; | 88 bool m_loading; |
| 83 bool m_alternate; | 89 bool m_alternate; |
| 84 bool m_createdByParser; | 90 bool m_createdByParser; |
| 85 bool m_isCSS; | 91 bool m_isCSS; |
| 86 bool m_isXSL; | 92 bool m_isXSL; |
| 93 |
| 94 RefPtr<EventListener> m_listenerForXSLT; |
| 87 }; | 95 }; |
| 88 | 96 |
| 89 DEFINE_NODE_TYPE_CASTS(ProcessingInstruction, nodeType() == Node::PROCESSING_INS
TRUCTION_NODE); | 97 DEFINE_NODE_TYPE_CASTS(ProcessingInstruction, nodeType() == Node::PROCESSING_INS
TRUCTION_NODE); |
| 90 | 98 |
| 91 inline bool isXSLStyleSheet(const Node& node) | 99 inline bool isXSLStyleSheet(const Node& node) |
| 92 { | 100 { |
| 93 return node.nodeType() == Node::PROCESSING_INSTRUCTION_NODE && toProcessingI
nstruction(node).isXSL(); | 101 return node.nodeType() == Node::PROCESSING_INSTRUCTION_NODE && toProcessingI
nstruction(node).isXSL(); |
| 94 } | 102 } |
| 95 | 103 |
| 96 } // namespace blink | 104 } // namespace blink |
| 97 | 105 |
| 98 #endif // ProcessingInstruction_h | 106 #endif // ProcessingInstruction_h |
| OLD | NEW |