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

Unified Diff: third_party/WebKit/Source/core/html/HTMLSlotElement.cpp

Issue 1530643003: Support slot element's fallback content feature (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed Created 4 years, 11 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
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLSlotElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLSlotElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp b/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp
index cf907c221c755daa2c33147e415d07648ad7d523..a3f1e37a55b40d6af3eecd960ff06567795d1f07 100644
--- a/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp
@@ -31,6 +31,8 @@
#include "core/html/HTMLSlotElement.h"
#include "core/HTMLNames.h"
+#include "core/dom/NodeTraversal.h"
+#include "core/dom/shadow/InsertionPoint.h"
namespace blink {
@@ -98,6 +100,21 @@ void HTMLSlotElement::detach(const AttachContext& context)
HTMLElement::detach(context);
}
+void HTMLSlotElement::updateDistributedNodesWithFallback()
+{
+ if (!m_distributedNodes.isEmpty())
+ return;
+ for (auto& child : NodeTraversal::childrenOf(*this)) {
+ // Insertion points are not supported as slots fallback
+ if (isActiveInsertionPoint(child))
+ continue;
+ if (isHTMLSlotElement(child))
+ appendDistributedNodes(toHTMLSlotElement(child).getDistributedNodes());
+ else
+ appendDistributedNode(child);
+ }
+}
+
DEFINE_TRACE(HTMLSlotElement)
{
visitor->trace(m_assignedNodes);
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLSlotElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698