Commit 75d661af authored by Hayato Ito's avatar Hayato Ito Committed by Commit Bot

Remove abstraction which is no longer necessary

Use AssignedNodes() directly. The abstraction here is no longer
necessary since we removed IncrementalShadowDOM flag.

Bug: 887827
Change-Id: Id5c7e4139ad89ce2ade6efd62bdfc1cbb50c0340
Reviewed-on: https://chromium-review.googlesource.com/1249467Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Commit-Queue: Hayato Ito <hayato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594976}
parent 57f98fb5
......@@ -314,7 +314,7 @@ void HTMLSlotElement::AttachLayoutTree(AttachContext& context) {
if (SupportsAssignment()) {
AttachContext children_context(context);
for (auto& node : ChildrenInFlatTreeIfAssignmentIsSupported()) {
for (auto& node : AssignedNodes()) {
if (node->NeedsAttach())
node->AttachLayoutTree(children_context);
}
......@@ -323,14 +323,6 @@ void HTMLSlotElement::AttachLayoutTree(AttachContext& context) {
}
}
// TODO(hayato): Rename this function once we enable IncrementalShadowDOM
// by default because this function doesn't consider fallback elements in case
// of IncementalShadowDOM.
const HeapVector<Member<Node>>&
HTMLSlotElement::ChildrenInFlatTreeIfAssignmentIsSupported() {
return AssignedNodes();
}
void HTMLSlotElement::DetachLayoutTree(const AttachContext& context) {
if (SupportsAssignment()) {
const HeapVector<Member<Node>>& flat_tree_children = assigned_nodes_;
......@@ -345,13 +337,11 @@ void HTMLSlotElement::RebuildDistributedChildrenLayoutTrees(
if (!SupportsAssignment())
return;
const HeapVector<Member<Node>>& flat_tree_children =
ChildrenInFlatTreeIfAssignmentIsSupported();
const HeapVector<Member<Node>>& assigned_nodes = AssignedNodes();
// This loop traverses the nodes from right to left for the same reason as the
// one described in ContainerNode::RebuildChildrenLayoutTrees().
for (auto it = flat_tree_children.rbegin(); it != flat_tree_children.rend();
++it) {
for (auto it = assigned_nodes.rbegin(); it != assigned_nodes.rend(); ++it) {
RebuildLayoutTreeForChild(*it, whitespace_attacher);
}
}
......
......@@ -128,8 +128,6 @@ class CORE_EXPORT HTMLSlotElement final : public HTMLElement {
bool HasSlotableChild() const;
const HeapVector<Member<Node>>& ChildrenInFlatTreeIfAssignmentIsSupported();
void LazyReattachNodesIfNeeded(const HeapVector<Member<Node>>& nodes1,
const HeapVector<Member<Node>>& nodes2);
static void LazyReattachNodesNaive(const HeapVector<Member<Node>>& nodes1,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment