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

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

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/ProcessingInstruction.h ('k') | Source/core/dom/ProcessingInstruction.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ProcessingInstruction.cpp
diff --git a/Source/core/dom/ProcessingInstruction.cpp b/Source/core/dom/ProcessingInstruction.cpp
index cf915dc2dc781b5fa7d8153617cf5e2470e95930..033c0435ef62531e5c92ef5b73814c6f298db0b1 100644
--- a/Source/core/dom/ProcessingInstruction.cpp
+++ b/Source/core/dom/ProcessingInstruction.cpp
@@ -37,9 +37,8 @@
namespace WebCore {
inline ProcessingInstruction::ProcessingInstruction(Document* document, const String& target, const String& data)
- : Node(document, CreateOther)
+ : CharacterData(document, data, CreateOther)
, m_target(target)
- , m_data(data)
, m_resource(0)
, m_loading(false)
, m_alternate(false)
@@ -67,14 +66,6 @@ ProcessingInstruction::~ProcessingInstruction()
document()->styleSheetCollection()->removeStyleSheetCandidateNode(this);
}
-void ProcessingInstruction::setData(const String& data)
-{
- int oldLength = m_data.length();
- m_data = data;
- document()->textRemoved(this, 0, oldLength);
- checkStyleSheet();
-}
-
String ProcessingInstruction::nodeName() const
{
return m_target;
@@ -85,16 +76,6 @@ Node::NodeType ProcessingInstruction::nodeType() const
return PROCESSING_INSTRUCTION_NODE;
}
-String ProcessingInstruction::nodeValue() const
-{
- return m_data;
-}
-
-void ProcessingInstruction::setNodeValue(const String& nodeValue)
-{
- setData(nodeValue);
-}
-
PassRefPtr<Node> ProcessingInstruction::cloneNode(bool /*deep*/)
{
// FIXME: Is it a problem that this does not copy m_localHref?
@@ -254,16 +235,6 @@ void ProcessingInstruction::setCSSStyleSheet(PassRefPtr<CSSStyleSheet> sheet)
sheet->setDisabled(m_alternate);
}
-bool ProcessingInstruction::offsetInCharacters() const
-{
- return true;
-}
-
-int ProcessingInstruction::maxCharacterOffset() const
-{
- return static_cast<int>(m_data.length());
-}
-
void ProcessingInstruction::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) const
{
if (!sheet())
@@ -274,7 +245,7 @@ void ProcessingInstruction::addSubresourceAttributeURLs(ListHashSet<KURL>& urls)
Node::InsertionNotificationRequest ProcessingInstruction::insertedInto(ContainerNode* insertionPoint)
{
- Node::insertedInto(insertionPoint);
+ CharacterData::insertedInto(insertionPoint);
if (!insertionPoint->inDocument())
return InsertionDone;
document()->styleSheetCollection()->addStyleSheetCandidateNode(this, m_createdByParser);
@@ -284,7 +255,7 @@ Node::InsertionNotificationRequest ProcessingInstruction::insertedInto(Container
void ProcessingInstruction::removedFrom(ContainerNode* insertionPoint)
{
- Node::removedFrom(insertionPoint);
+ CharacterData::removedFrom(insertionPoint);
if (!insertionPoint->inDocument())
return;
@@ -306,7 +277,7 @@ void ProcessingInstruction::removedFrom(ContainerNode* insertionPoint)
void ProcessingInstruction::finishParsingChildren()
{
m_createdByParser = false;
- Node::finishParsingChildren();
+ CharacterData::finishParsingChildren();
}
} // namespace
« no previous file with comments | « Source/core/dom/ProcessingInstruction.h ('k') | Source/core/dom/ProcessingInstruction.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698