[wpt-sync] Sync PR 22255 - Adds ability for slot to preserve order of its manually assigned nodes.
Categories
(Core :: DOM: Core & HTML, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox77 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 22255 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/22255
Details from upstream follow.
Yu Han <yuzhehan@chromium.org> wrote:
Adds ability for slot to preserve order of its manually assigned nodes.
Prior to this CL, the ordering of the manually assigned nodes is not
preserved. Nodes were assigned in tree-order. In addition, assignment
is not absolute. A slotable node can be assign to multiple slots, and
where it appears is when the assigned slot first appear in a tree-order
traversal, not the last slot the node is assigned to.This CL does two things. One, the order of manually assigned node is
preserved. Two, assignment is absolute. The implementation uses a
HeapHashMap, candidate_assigned_slot_map_, to keep track of
assignment node -> slot. It uses this map during node assignment to
find if another assigned slot exists. When found, the node is
removed from the previously assigned slot.Preserving the ordering of manually assigned nodes is done in
HTMLSlotElement::UpdateManuallyAssignedNodesOrdering(). This is called
at the end of SlotAssignment::RecalcAssignment(). RecalcAssignment()
walks the ShadowHost's children in tree-order, so the assigned node
could be out of order from how these nodes were assigned. I thought
about making a separate function for manually assigned nodes, looping
though assigned nodes instead. But I decided against it at this point
due to the complexity of the recalc function.For Reference: point 1 in this comment is addressed by this CL.
https://github.com/whatwg/html/issues/3534#issuecomment-537802687Bug:869308
Change-Id: Idc45cb593313b00f13cd5f29df8972bfe246ecceReviewed-on: https://chromium-review.googlesource.com/2103403
WPT-Export-Revision: f1cc33ed4fd0ec362397d77afa625771f58ec8b1
| Assignee | ||
Updated•6 years ago
|
| Assignee | ||
Comment 1•6 years ago
|
||
| Assignee | ||
Comment 3•6 years ago
|
||
Comment 4•6 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/a4bd51e91761
https://hg.mozilla.org/mozilla-central/rev/38b98e8539de
Description
•