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

Unified Diff: sky/engine/core/dom/Node.cpp

Issue 698123002: Remove more API from Node and ContainerNode. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/dom/Node.h ('k') | sky/engine/core/editing/markup.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/Node.cpp
diff --git a/sky/engine/core/dom/Node.cpp b/sky/engine/core/dom/Node.cpp
index c56762732f3a83ab15bbb0480cb555dd080afa24..bc6f2080b1f6d5cfc76e53c5ea13f90ebb81da52 100644
--- a/sky/engine/core/dom/Node.cpp
+++ b/sky/engine/core/dom/Node.cpp
@@ -88,7 +88,7 @@
namespace blink {
-struct SameSizeAsNode : NODE_BASE_CLASSES {
+struct SameSizeAsNode : public EventTarget, public TreeShared<Node> {
uint32_t m_nodeFlags;
void* m_pointer[5];
};
@@ -315,7 +315,6 @@ NodeRareData& Node::ensureRareData()
return *rareData();
}
-#if !ENABLE(OILPAN)
void Node::clearRareData()
{
ASSERT(hasRareData());
@@ -329,7 +328,6 @@ void Node::clearRareData()
m_data.m_renderer = renderer;
clearFlag(HasRareDataFlag);
}
-#endif
Node* Node::toNode()
{
@@ -341,16 +339,6 @@ short Node::tabIndex() const
return 0;
}
-String Node::nodeValue() const
-{
- return String();
-}
-
-void Node::setNodeValue(const String&)
-{
- // By default, setting nodeValue has no effect.
-}
-
PassRefPtr<Node> Node::insertBefore(PassRefPtr<Node> newChild, Node* refChild, ExceptionState& exceptionState)
{
if (isContainerNode())
@@ -1019,9 +1007,6 @@ bool Node::isEqualNode(Node* other) const
if (localName() != other->localName())
return false;
- if (nodeValue() != other->nodeValue())
- return false;
-
if (isElementNode() && !toElement(this)->hasEquivalentAttributes(toElement(other)))
return false;
@@ -1065,7 +1050,7 @@ void Node::setTextContent(const String& text)
{
switch (nodeType()) {
case TEXT_NODE:
- setNodeValue(text);
+ toText(this)->setData(text);
return;
case ELEMENT_NODE:
case DOCUMENT_FRAGMENT_NODE: {
@@ -1235,7 +1220,7 @@ void Node::showNode(const char* prefix) const
if (!prefix)
prefix = "";
if (isTextNode()) {
- String value = nodeValue();
+ String value = toText(this)->data();
value.replaceWithLiteral('\\', "\\\\");
value.replaceWithLiteral('\n', "\\n");
fprintf(stderr, "%s%s\t%p \"%s\"\n", prefix, nodeName().utf8().data(), this, value.utf8().data());
@@ -1509,12 +1494,10 @@ EventTargetData& Node::ensureEventTargetData()
return *data;
}
-#if !ENABLE(OILPAN)
void Node::clearEventTargetData()
{
eventTargetDataMap().remove(this);
}
-#endif
Vector<OwnPtr<MutationObserverRegistration> >* Node::mutationObserverRegistry()
{
@@ -1598,11 +1581,6 @@ void Node::unregisterMutationObserver(MutationObserverRegistration* registration
// before that, in case |this| is destroyed (see MutationObserverRegistration::m_registrationNodeKeepAlive).
// FIXME: Simplify the registration/transient registration logic to make this understandable by humans.
RefPtr<Node> protect(this);
-#if ENABLE(OILPAN)
- // The explicit dispose() is needed to have the registration
- // object unregister itself promptly.
- registration->dispose();
-#endif
registry->remove(index);
}
@@ -1894,23 +1872,6 @@ void Node::setCustomElementState(CustomElementState newState)
setNeedsStyleRecalc(SubtreeStyleChange); // :unresolved has changed
}
-void Node::trace(Visitor* visitor)
-{
-#if ENABLE(OILPAN)
- visitor->trace(m_parentOrShadowHostNode);
- visitor->trace(m_previous);
- visitor->trace(m_next);
- // rareData() and m_data.m_renderer share their storage. We have to trace
- // only one of them.
- if (hasRareData())
- visitor->trace(rareData());
- else
- visitor->trace(m_data.m_renderer);
- visitor->trace(m_treeScope);
-#endif
- EventTarget::trace(visitor);
-}
-
unsigned Node::lengthOfContents() const
{
// This switch statement must be consistent with that of Range::processContentsBetweenOffsets.
« no previous file with comments | « sky/engine/core/dom/Node.h ('k') | sky/engine/core/editing/markup.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698