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

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

Issue 772743004: Remove more Node API. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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/dom/Range.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 7eaad239f4be95dc769e6198b980b4e6d3eb05bd..982ffbc356e8bc137f1a252e8e922257ab396c17 100644
--- a/sky/engine/core/dom/Node.cpp
+++ b/sky/engine/core/dom/Node.cpp
@@ -595,22 +595,6 @@ bool Node::inActiveDocument() const
return inDocument() && document().isActive();
}
-Node* Node::focusDelegate()
-{
- return this;
-}
-
-bool Node::shouldHaveFocusAppearance() const
-{
- ASSERT(focused());
- return true;
-}
-
-bool Node::isInert() const
-{
- return false;
-}
-
unsigned Node::nodeIndex() const
{
Node *_tempNode = previousSibling();
@@ -704,25 +688,11 @@ void Node::attach(const AttachContext&)
clearNeedsStyleRecalc();
}
-#if ENABLE(ASSERT)
-static Node* detachingNode;
-
-bool Node::inDetach() const
-{
- return detachingNode == this;
-}
-#endif
-
void Node::detach(const AttachContext& context)
{
ASSERT(document().lifecycle().stateAllowsDetach());
DocumentLifecycle::DetachScope willDetach(document().lifecycle());
-#if ENABLE(ASSERT)
- ASSERT(!detachingNode);
- detachingNode = this;
-#endif
-
if (renderer())
renderer()->destroyAndCleanupAnonymousWrappers();
setRenderer(0);
@@ -742,10 +712,6 @@ void Node::detach(const AttachContext& context)
setStyleChange(NeedsReattachStyleChange);
setChildNeedsStyleRecalc();
-
-#if ENABLE(ASSERT)
- detachingNode = 0;
-#endif
}
void Node::reattachWhitespaceSiblings(Text* start)
@@ -931,41 +897,6 @@ Document* Node::ownerDocument() const
return doc == this ? 0 : doc;
}
-bool Node::isEqualNode(Node* other) const
-{
- if (!other)
- return false;
-
- NodeType nodeType = this->nodeType();
- if (nodeType != other->nodeType())
- return false;
-
- if (nodeName() != other->nodeName())
- return false;
-
- if (localName() != other->localName())
- return false;
-
- if (isElementNode() && !toElement(this)->hasEquivalentAttributes(toElement(other)))
- return false;
-
- Node* child = firstChild();
- Node* otherChild = other->firstChild();
-
- while (child) {
- if (!child->isEqualNode(otherChild))
- return false;
-
- child = child->nextSibling();
- otherChild = otherChild->nextSibling();
- }
-
- if (otherChild)
- return false;
-
- return true;
-}
-
static void appendTextContent(const Node* node, bool convertBRsToNewlines, StringBuilder& content)
{
if (node->nodeType() == Node::TEXT_NODE) {
@@ -1336,37 +1267,16 @@ void Node::didMoveToNewDocument(Document& oldDocument)
}
}
-static inline bool tryAddEventListener(Node* targetNode, const AtomicString& eventType, PassRefPtr<EventListener> listener, bool useCapture)
+bool Node::addEventListener(const AtomicString& eventType, PassRefPtr<EventListener> listener, bool useCapture)
{
- if (!targetNode->EventTarget::addEventListener(eventType, listener, useCapture))
+ if (!EventTarget::addEventListener(eventType, listener, useCapture))
return false;
- Document& document = targetNode->document();
- document.addListenerTypeIfNeeded(eventType);
+ document().addListenerTypeIfNeeded(eventType);
return true;
}
-bool Node::addEventListener(const AtomicString& eventType, PassRefPtr<EventListener> listener, bool useCapture)
-{
- return tryAddEventListener(this, eventType, listener, useCapture);
-}
-
-static inline bool tryRemoveEventListener(Node* targetNode, const AtomicString& eventType, PassRefPtr<EventListener> listener, bool useCapture)
-{
- return targetNode->EventTarget::removeEventListener(eventType, listener, useCapture);
-}
-
-bool Node::removeEventListener(const AtomicString& eventType, PassRefPtr<EventListener> listener, bool useCapture)
-{
- return tryRemoveEventListener(this, eventType, listener, useCapture);
-}
-
-void Node::removeAllEventListeners()
-{
- EventTarget::removeAllEventListeners();
-}
-
void Node::removeAllEventListenersRecursively()
{
for (Node* node = this; node; node = NodeTraversal::next(*node)) {
« no previous file with comments | « sky/engine/core/dom/Node.h ('k') | sky/engine/core/dom/Range.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698