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 c76642f61dd995eb592dc5bf45c00116d42a44ad..51c634b97c06438ad5a9496c91e535f0089371b2 100644 |
--- a/third_party/WebKit/Source/core/dom/Node.cpp |
+++ b/third_party/WebKit/Source/core/dom/Node.cpp |
@@ -79,6 +79,7 @@ |
#include "core/frame/LocalFrame.h" |
#include "core/html/HTMLDialogElement.h" |
#include "core/html/HTMLFrameOwnerElement.h" |
+#include "core/html/HTMLSlotElement.h" |
#include "core/input/EventHandler.h" |
#include "core/layout/LayoutBox.h" |
#include "core/page/ContextMenuController.h" |
@@ -960,7 +961,12 @@ bool Node::canStartSelection() const |
bool Node::canParticipateInComposedTree() const |
{ |
- return !isShadowRoot() && !isActiveInsertionPoint(*this); |
+ return !isShadowRoot() && !isSlotOrActiveInsertionPoint(); |
+} |
+ |
+bool Node::isSlotOrActiveInsertionPoint() const |
+{ |
+ return isHTMLSlotElement(*this) || isActiveInsertionPoint(*this); |
} |
Element* Node::shadowHost() const |
@@ -2203,6 +2209,19 @@ PassRefPtrWillBeRawPtr<StaticNodeList> Node::getDestinationInsertionPoints() |
return StaticNodeList::adopt(filteredInsertionPoints); |
} |
+HTMLSlotElement* Node::assignedSlot() const |
+{ |
+ ASSERT(!needsDistributionRecalc()); |
+ Element* parent = parentElement(); |
+ if (!parent) |
+ return nullptr; |
+ if (ElementShadow* shadow = parent->shadow()) { |
+ if (shadow->isV1()) |
+ return shadow->assignedSlotFor(*this); |
+ } |
+ return nullptr; |
+} |
+ |
void Node::setFocus(bool flag) |
{ |
document().userActionElements().setFocused(this, flag); |