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

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

Issue 1489433002: Support the essential part of Shadow DOM v1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert Internals.* Created 5 years 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/dom/Node.h ('k') | third_party/WebKit/Source/core/dom/NodeComputedStyle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.h ('k') | third_party/WebKit/Source/core/dom/NodeComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698