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

Unified Diff: Source/core/dom/ProcessingInstruction.h

Issue 22911019: [DOM4] Have ProcessingInstruction inherit CharacterData (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/CharacterData.cpp ('k') | Source/core/dom/ProcessingInstruction.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ProcessingInstruction.h
diff --git a/Source/core/dom/ProcessingInstruction.h b/Source/core/dom/ProcessingInstruction.h
index d8c837bcff9bc23f12862e02fcf0d0e9059da3c1..7b216f05194413a499c88b219442e71fda0ba9d5 100644
--- a/Source/core/dom/ProcessingInstruction.h
+++ b/Source/core/dom/ProcessingInstruction.h
@@ -22,7 +22,7 @@
#ifndef ProcessingInstruction_h
#define ProcessingInstruction_h
-#include "core/dom/Node.h"
+#include "core/dom/CharacterData.h"
#include "core/fetch/ResourcePtr.h"
#include "core/fetch/StyleSheetResourceClient.h"
@@ -31,14 +31,12 @@ namespace WebCore {
class StyleSheet;
class CSSStyleSheet;
-class ProcessingInstruction FINAL : public Node, private StyleSheetResourceClient {
+class ProcessingInstruction FINAL : public CharacterData, private StyleSheetResourceClient {
public:
static PassRefPtr<ProcessingInstruction> create(Document*, const String& target, const String& data);
virtual ~ProcessingInstruction();
const String& target() const { return m_target; }
- const String& data() const { return m_data; }
- void setData(const String&);
void setCreatedByParser(bool createdByParser) { m_createdByParser = createdByParser; }
@@ -54,15 +52,12 @@ public:
bool isLoading() const;
private:
+ friend class CharacterData;
ProcessingInstruction(Document*, const String& target, const String& data);
virtual String nodeName() const;
virtual NodeType nodeType() const;
- virtual String nodeValue() const;
- virtual void setNodeValue(const String&);
virtual PassRefPtr<Node> cloneNode(bool deep = true);
- virtual bool offsetInCharacters() const;
- virtual int maxCharacterOffset() const;
virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
virtual void removedFrom(ContainerNode*) OVERRIDE;
@@ -78,7 +73,6 @@ private:
void parseStyleSheet(const String& sheet);
String m_target;
- String m_data;
String m_localHref;
String m_title;
String m_media;
@@ -91,6 +85,12 @@ private:
bool m_isXSL;
};
+inline ProcessingInstruction* toProcessingInstruction(Node* node)
+{
+ ASSERT_WITH_SECURITY_IMPLICATION(!node || node->nodeType() == Node::PROCESSING_INSTRUCTION_NODE);
+ return static_cast<ProcessingInstruction*>(node);
+}
+
} //namespace
#endif
« no previous file with comments | « Source/core/dom/CharacterData.cpp ('k') | Source/core/dom/ProcessingInstruction.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698