| 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 14 matching lines...) Expand all Loading... |
| 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 | 34 |
| 35 class ProcessingInstruction FINAL : public CharacterData, private ResourceOwner<
StyleSheetResource> { | 35 class ProcessingInstruction final : public CharacterData, private ResourceOwner<
StyleSheetResource> { |
| 36 DEFINE_WRAPPERTYPEINFO(); | 36 DEFINE_WRAPPERTYPEINFO(); |
| 37 public: | 37 public: |
| 38 static PassRefPtrWillBeRawPtr<ProcessingInstruction> create(Document&, const
String& target, const String& data); | 38 static PassRefPtrWillBeRawPtr<ProcessingInstruction> create(Document&, const
String& target, const String& data); |
| 39 virtual ~ProcessingInstruction(); | 39 virtual ~ProcessingInstruction(); |
| 40 virtual void trace(Visitor*) OVERRIDE; | 40 virtual void trace(Visitor*) override; |
| 41 | 41 |
| 42 const String& target() const { return m_target; } | 42 const String& target() const { return m_target; } |
| 43 | 43 |
| 44 void setCreatedByParser(bool createdByParser) { m_createdByParser = createdB
yParser; } | 44 void setCreatedByParser(bool createdByParser) { m_createdByParser = createdB
yParser; } |
| 45 | 45 |
| 46 const String& localHref() const { return m_localHref; } | 46 const String& localHref() const { return m_localHref; } |
| 47 StyleSheet* sheet() const { return m_sheet.get(); } | 47 StyleSheet* sheet() const { return m_sheet.get(); } |
| 48 void setCSSStyleSheet(PassRefPtrWillBeRawPtr<CSSStyleSheet>); | 48 void setCSSStyleSheet(PassRefPtrWillBeRawPtr<CSSStyleSheet>); |
| 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 private: | 56 private: |
| 57 ProcessingInstruction(Document&, const String& target, const String& data); | 57 ProcessingInstruction(Document&, const String& target, const String& data); |
| 58 | 58 |
| 59 virtual String nodeName() const OVERRIDE; | 59 virtual String nodeName() const override; |
| 60 virtual NodeType nodeType() const OVERRIDE; | 60 virtual NodeType nodeType() const override; |
| 61 virtual PassRefPtrWillBeRawPtr<Node> cloneNode(bool deep = true) OVERRIDE; | 61 virtual PassRefPtrWillBeRawPtr<Node> cloneNode(bool deep = true) override; |
| 62 | 62 |
| 63 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; | 63 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override; |
| 64 virtual void removedFrom(ContainerNode*) OVERRIDE; | 64 virtual void removedFrom(ContainerNode*) override; |
| 65 | 65 |
| 66 bool checkStyleSheet(String& href, String& charset); | 66 bool checkStyleSheet(String& href, String& charset); |
| 67 void process(const String& href, const String& charset); | 67 void process(const String& href, const String& charset); |
| 68 | 68 |
| 69 virtual void setCSSStyleSheet(const String& href, const KURL& baseURL, const
String& charset, const CSSStyleSheetResource*) OVERRIDE; | 69 virtual void setCSSStyleSheet(const String& href, const KURL& baseURL, const
String& charset, const CSSStyleSheetResource*) override; |
| 70 virtual void setXSLStyleSheet(const String& href, const KURL& baseURL, const
String& sheet) OVERRIDE; | 70 virtual void setXSLStyleSheet(const String& href, const KURL& baseURL, const
String& sheet) override; |
| 71 | 71 |
| 72 virtual bool sheetLoaded() OVERRIDE; | 72 virtual bool sheetLoaded() override; |
| 73 | 73 |
| 74 void parseStyleSheet(const String& sheet); | 74 void parseStyleSheet(const String& sheet); |
| 75 void clearSheet(); | 75 void clearSheet(); |
| 76 | 76 |
| 77 String m_target; | 77 String m_target; |
| 78 String m_localHref; | 78 String m_localHref; |
| 79 String m_title; | 79 String m_title; |
| 80 String m_media; | 80 String m_media; |
| 81 RefPtrWillBeMember<StyleSheet> m_sheet; | 81 RefPtrWillBeMember<StyleSheet> m_sheet; |
| 82 bool m_loading; | 82 bool m_loading; |
| 83 bool m_alternate; | 83 bool m_alternate; |
| 84 bool m_createdByParser; | 84 bool m_createdByParser; |
| 85 bool m_isCSS; | 85 bool m_isCSS; |
| 86 bool m_isXSL; | 86 bool m_isXSL; |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 DEFINE_NODE_TYPE_CASTS(ProcessingInstruction, nodeType() == Node::PROCESSING_INS
TRUCTION_NODE); | 89 DEFINE_NODE_TYPE_CASTS(ProcessingInstruction, nodeType() == Node::PROCESSING_INS
TRUCTION_NODE); |
| 90 | 90 |
| 91 inline bool isXSLStyleSheet(const Node& node) | 91 inline bool isXSLStyleSheet(const Node& node) |
| 92 { | 92 { |
| 93 return node.nodeType() == Node::PROCESSING_INSTRUCTION_NODE && toProcessingI
nstruction(node).isXSL(); | 93 return node.nodeType() == Node::PROCESSING_INSTRUCTION_NODE && toProcessingI
nstruction(node).isXSL(); |
| 94 } | 94 } |
| 95 | 95 |
| 96 } // namespace blink | 96 } // namespace blink |
| 97 | 97 |
| 98 #endif // ProcessingInstruction_h | 98 #endif // ProcessingInstruction_h |
| OLD | NEW |