From 055360facb5d8d0e2db00897d6e1f75f68d1c86d Mon Sep 17 00:00:00 2001
From: Mason Freed
If the open flag is set and shadow's mode is
not "open
", then return null.
If shadow's slot assignment is "manual
",
+ then return the slot in shadow's descendants whose manually assigned nodes
+ contains slottable, if any, and null otherwise.
Return the first slot in tree order in shadow's descendants whose name is slottable's name, if any, and null otherwise.
Let result be an empty list.
If slot's root is not a shadow root, then return +
Let root be slot's root.
If root is not a shadow root, then return result.
Let host be root's host.
For each slottable child of host, slottable, in +
If root's slot assignment is "manual
",
+ then:
Let result be an empty list.
For each slottable in slot's manually assigned nodes, + if slottable's parent is host, add slottable to array.
Otherwise, for each slottable child of host, slottable, in tree order:
Otherwise, insert node into parent's children before child's index. -
If parent is a shadow host and node is a +
If parent is a shadow host whose shadow root's
+ slot assignment is "name
" and node is a
slottable, then assign a slot for node.
If parent's root is a shadow root, and
@@ -5706,11 +5724,13 @@ invoked, must return a new {{DocumentFragment}} node whose no
[Exposed=Window]
interface ShadowRoot : DocumentFragment {
readonly attribute ShadowRootMode mode;
+ readonly attribute SlotAssignmentMode slotAssignment;
readonly attribute Element host;
attribute EventHandler onslotchange;
};
enum ShadowRootMode { "open", "closed" };
+enum SlotAssignmentMode { "manual", "name" };
{{ShadowRoot}} nodes are simply known as
@@ -5729,6 +5749,9 @@ It is initially set to false. Shadow roots have an associated slot assignment
+(" A shadow root's get the parent algorithm, given an event, returns
null if event's composed flag is unset and shadow root is the
root of event's path's first struct's
@@ -5746,6 +5769,9 @@ null if event's composed flag is unset and shadow roo
The In shadow-including tree order is
@@ -5869,6 +5895,7 @@ interface Element : Node {
dictionary ShadowRootInit {
required ShadowRootMode mode;
boolean delegatesFocus = false;
+ SlotAssignmentMode slotAssignment = "name";
};
@@ -6753,6 +6780,9 @@ invoked, must run these steps:
" Set shadow's slot assignment to init's
+ {{ShadowRootInit/slotAssignment}}.
+
Set this's shadow root to shadow.
Return shadow.
@@ -10087,6 +10117,7 @@ Manish Tripathi,
Marcos Caceres,
Mark Miller,
Martijn van der Ven,
+Mason Freed,
Mats Palmgren,
Mounir Lamouri,
Michael Stramel,
@@ -10150,6 +10181,7 @@ Yehuda Katz,
Yoav Weiss,
Yoichi Osato,
Yoshinori Sano,
+Yu Han,
Yusuke Abe, and
Zack Weinberg
for being awesome!
From d45e54e2e55a6e59e27ea862b9e841fc6d1fa0b9 Mon Sep 17 00:00:00 2001
From: Mason Freed Let result be an empty list. For each slottable in slot's manually assigned nodes,
- if slottable's parent is host, add slottable to array.manual
" or "name
").onslotchange
event handler, whose
event handler event type is {{HTMLSlotElement/slotchange}}.
+slotAssignment
attribute's getter must
+return this's slot assignment.
custom
", then set shadow's
available to element internals to true.
+
If node is an {{HTMLSlotElement}}, set node's manually assigned nodes + to an empty set. +
If node is assigned, then run assign slottables for
node's assigned slot.
From 7915e2b40cd38b3ee563421dc19d34c3f598da21 Mon Sep 17 00:00:00 2001
From: Mason Freed
A slottable has an associated +manual slot assignment (null +or a slot). Unless stated otherwise, it is null. The manual slot assignment is +a weak reference to the slot, such that it can be garbage collected if not referenced elsewhere.
+To find a slot for a given slottable @@ -2683,9 +2688,6 @@ indicated in the remove algorithm below.
If node is an {{HTMLSlotElement}}, set node's manually assigned nodes - to an empty set. -
If node is assigned, then run assign slottables for
node's assigned slot.
From a0c69d93320c9740033aa2defc76ae3ef7f6e0e9 Mon Sep 17 00:00:00 2001
From: Mason Freed
A slottable has an associated manual slot assignment (null -or a slot). Unless stated otherwise, it is null. The manual slot assignment is -a weak reference to the slot, such that it can be garbage collected if not referenced elsewhere.
+or a slot). Unless stated otherwise, it is null. + +The manual slot assignment can be implemented using a weak reference +to the slot, because this variable is not directly accessible from script.
If parent is a shadow host whose shadow root's
- slot assignment is "name
" and node is a
+ slot assignment is "named
" and node is a
slottable, then assign a slot for node.
If parent's root is a shadow root, and @@ -5738,7 +5738,7 @@ interface ShadowRoot : DocumentFragment { }; enum ShadowRootMode { "open", "closed" }; -enum SlotAssignmentMode { "manual", "name" }; +enum SlotAssignmentMode { "manual", "named" };
{{ShadowRoot}} nodes are simply known as @@ -5758,7 +5758,7 @@ It is initially set to false.
consequences for innerHTML. -->Shadow roots have an associated slot assignment
-("manual
" or "name
").
manual
" or "named
").
A shadow root's get the parent algorithm, given an event, returns
null if event's composed flag is unset and shadow root is the
@@ -5903,7 +5903,7 @@ interface Element : Node {
dictionary ShadowRootInit {
required ShadowRootMode mode;
boolean delegatesFocus = false;
- SlotAssignmentMode slotAssignment = "name";
+ SlotAssignmentMode slotAssignment = "named";
};
From 39f9ba9c34c86f7e8fa4cbb6c7770fa9a2c37bda Mon Sep 17 00:00:00 2001
From: Anne van Kesteren
A slottable has an associated -manual slot assignment (null -or a slot). Unless stated otherwise, it is null.
+A slottable has an associated manual slot assignment (null +or a slot). Unless stated otherwise, it is null. -
The manual slot assignment can be implemented using a weak reference -to the slot, because this variable is not directly accessible from script.
+A slottable's manual slot assignment can be implemented using a weak +reference to the slot, because this variable is not directly accessible from script.
If the open flag is set and shadow's mode is
not "open
", then return null.
If shadow's slot assignment is "manual
",
- then return the slot in shadow's descendants whose manually assigned nodes
- contains slottable, if any, and null otherwise.
If shadow's slot assignment is "manual
", then
+ return the slot in shadow's descendants whose
+ manually assigned nodes contains slottable, if any, and null
+ otherwise.
Return the first slot in tree order in shadow's descendants whose name is slottable's @@ -2214,36 +2214,34 @@ for a given slot slot, run these steps:
Let result be an empty list.
Let root be slot's root.
Let root be slot's root. -
If root is not a shadow root, then return - result.
If root is not a shadow root, then return result. -
Let host be root's host.
Let host be root's host.
If root's slot assignment is "manual
",
- then:
If root's slot assignment is "manual
", then:
Let result be an empty list.
Let result be « ». -
For each slottable in slot's manually assigned nodes, - if slottable's parent is host, add slottable - to result.
For each slottable slottable of slot's + manually assigned nodes, if slottable's parent is + host, append slottable to result.
Otherwise, for each slottable child of host, slottable, in - tree order:
+Otherwise, for each slottable child slottable of + host, in tree order:
Let foundSlot be the result of finding a slot given - slottable.
If foundSlot is slot, then append slottable to - result.
If foundSlot is slot, then append + slottable to result.
onslotchange
event handler, whose
event handler event type is {{HTMLSlotElement/slotchange}}.
-The slotAssignment
attribute's getter must
-return this's slot assignment.
The slotAssignment
getter steps are to return
+this's slot assignment.
Let shadow be a new shadow root whose node document is this's node document, host is this, - and mode is init's {{ShadowRootInit/mode}}. + and mode is init["{{ShadowRootInit/mode}}"]. -
Set shadow's delegates focus to init's - {{ShadowRootInit/delegatesFocus}}. +
Set shadow's delegates focus to + init["{{ShadowRootInit/delegatesFocus}}"].
If this's custom element state is "precustomized
" or
"custom
", then set shadow's
available to element internals to true.
-
Set shadow's slot assignment to init's - {{ShadowRootInit/slotAssignment}}. +
Set shadow's slot assignment to + init["{{ShadowRootInit/slotAssignment}}"].
Set this's shadow root to shadow.
From dfc9b44563ab1b3349b5df19fe356b8fecc95dfc Mon Sep 17 00:00:00 2001
From: Anne van Kesteren
For each slottable slottable of slot's manually assigned nodes, if slottable's parent is - host, append slottable to result.
Otherwise, for each slottable child slottable of @@ -5756,7 +5755,7 @@ It is initially set to false.
consequences for innerHTML. -->Shadow roots have an associated slot assignment
-("manual
" or "named
").
manual
" or "named
").
A shadow root's get the parent algorithm, given an event, returns null if event's composed flag is unset and shadow root is the