Chromium Code Reviews| 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..a0615fd21c03f4ba201d37574d77e8b774555841 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,20 @@ 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()) { |
|
kochi
2015/12/09 08:57:34
No {} for this if.
hayato
2015/12/09 10:25:40
Done.
|
| + return shadow->assignedSlotFor(*this); |
| + } |
| + } |
| + return nullptr; |
| +} |
| + |
| void Node::setFocus(bool flag) |
| { |
| document().userActionElements().setFocused(this, flag); |