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

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..ecd955ee4ecef4166e6da1956cab6bc85d59d377 100644
--- a/third_party/WebKit/Source/core/dom/Node.cpp
+++ b/third_party/WebKit/Source/core/dom/Node.cpp
@@ -995,6 +995,21 @@ bool Node::isSlotOrActiveInsertionPoint() const
return isHTMLSlotElement(*this) || isActiveInsertionPoint(*this);
}
+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();
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.h ('k') | third_party/WebKit/Source/core/dom/shadow/SlotAssignment.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698