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

Unified Diff: sky/engine/core/dom/ContainerNode.h

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/CharacterData.cpp ('k') | sky/engine/core/dom/ContainerNode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/ContainerNode.h
diff --git a/sky/engine/core/dom/ContainerNode.h b/sky/engine/core/dom/ContainerNode.h
index 82b02846ef0b86e562354ce603b74a33604c9614..73a2afea2bc7936427169b28515b2bb1596ee4c7 100644
--- a/sky/engine/core/dom/ContainerNode.h
+++ b/sky/engine/core/dom/ContainerNode.h
@@ -52,7 +52,6 @@ public:
bool hasOneChild() const { return m_firstChild && !m_firstChild->nextSibling(); }
bool hasOneTextChild() const { return hasOneChild() && m_firstChild->isTextNode(); }
- bool hasChildCount(unsigned) const;
unsigned countChildren() const;
@@ -71,7 +70,6 @@ public:
void parserAppendChild(PassRefPtr<Node>);
void parserRemoveChild(Node&);
void parserInsertBefore(PassRefPtr<Node> newChild, Node& refChild);
- void parserTakeAllChildrenFrom(ContainerNode&);
void removeChildren();
@@ -97,31 +95,23 @@ public:
{
ChildrenChange change = {
node.isElementNode() ? ElementInserted : NonElementInserted,
- node.previousSibling(),
- node.nextSibling(),
byParser
};
return change;
}
- static ChildrenChange forRemoval(Node& node, Node* previousSibling, Node* nextSibling, ChildrenChangeSource byParser)
+ static ChildrenChange forRemoval(Node& node, ChildrenChangeSource byParser)
{
ChildrenChange change = {
node.isElementNode() ? ElementRemoved : NonElementRemoved,
- previousSibling,
- nextSibling,
byParser
};
return change;
}
bool isChildInsertion() const { return type == ElementInserted || type == NonElementInserted; }
- bool isChildRemoval() const { return type == ElementRemoved || type == NonElementRemoved; }
- bool isChildElementChange() const { return type == ElementInserted || type == ElementRemoved; }
ChildrenChangeType type;
- RawPtr<Node> siblingBeforeChange;
- RawPtr<Node> siblingAfterChange;
ChildrenChangeSource byParser;
};
@@ -129,14 +119,10 @@ public:
// node that is of the type TEXT_NODE has changed its value.
virtual void childrenChanged(const ChildrenChange&);
- virtual void trace(Visitor*) override;
-
protected:
ContainerNode(TreeScope*, ConstructionType = CreateContainer);
-#if !ENABLE(OILPAN)
void removeDetachedChildren();
-#endif
void setFirstChild(Node* child) { m_firstChild = child; }
void setLastChild(Node* child) { m_lastChild = child; }
@@ -179,16 +165,6 @@ bool childAttachedAllowedWhenAttachingChildren(ContainerNode*);
DEFINE_NODE_TYPE_CASTS(ContainerNode, isContainerNode());
-inline bool ContainerNode::hasChildCount(unsigned count) const
-{
- Node* child = m_firstChild;
- while (count && child) {
- child = child->nextSibling();
- --count;
- }
- return !count && !child;
-}
-
inline ContainerNode::ContainerNode(TreeScope* treeScope, ConstructionType type)
: Node(treeScope, type)
, m_firstChild(nullptr)
« no previous file with comments | « sky/engine/core/dom/CharacterData.cpp ('k') | sky/engine/core/dom/ContainerNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698