Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Side by Side Diff: Source/core/dom/ProcessingInstruction.h

Issue 730003002: Refactoring XSLT (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed ASSERT crashes when xsltEnabled() returns false Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/dom/ProcessingInstruction.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/dom/ProcessingInstruction.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698