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

Unified Diff: third_party/WebKit/Source/core/dom/Node.cpp

Issue 1872303002: Simplify slot assignments (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
Index: third_party/WebKit/Source/core/dom/Node.cpp
diff --git a/third_party/WebKit/Source/core/dom/Node.cpp b/third_party/WebKit/Source/core/dom/Node.cpp
index 12c26b7752626f68c6410eb4e0898526e9251e62..e1a3cf78f9db54cde0ce41e2961a83e55ad76341 100644
--- a/third_party/WebKit/Source/core/dom/Node.cpp
+++ b/third_party/WebKit/Source/core/dom/Node.cpp
@@ -995,6 +995,26 @@ bool Node::isSlotOrActiveInsertionPoint() const
return isHTMLSlotElement(*this) || isActiveInsertionPoint(*this);
}
+bool Node::slottable() const
+{
+ return isElementNode() || isTextNode();
kochi 2016/04/11 10:57:54 How about making this inline (defining in .h file)
hayato 2016/04/12 04:06:52 Done
+}
+
+AtomicString Node::slotName() const
+{
+ DCHECK(slottable());
+ if (isElementNode())
+ return normalizeSlotName(toElement(*this).fastGetAttribute(HTMLNames::slotAttr));
+ DCHECK(isTextNode());
+ return emptyAtom;
+}
+
+// static
+AtomicString Node::normalizeSlotName(const AtomicString& name)
+{
+ return (name.isNull() || name.isEmpty()) ? emptyAtom : name;
+}
+
bool Node::isInV1ShadowTree() const
{
ShadowRoot* shadowRoot = containingShadowRoot();

Powered by Google App Engine
This is Rietveld 408576698