Repository navigation
Take care of missing custom element reactions - #1412
Conversation
As discussed in WICG/webcomponents#186, there are certain scenarios where custom element reactions could be enqueued, but the custom element reactions stack is empty. The most prominent of these is editing operations. We solve this issue in two parts: - First, introduce the backup element queue (similar to the old "base element queue" concept; see WICG/webcomponents#457). This takes care of cases like editing which cannot be solved in any other way. - Also, we mandate that [CEReactions] be applied to nonstandard APIs that modify the DOM, including a list of what we've identified so far. Closes WICG/webcomponents#186.
doesn't sound like it covers editing, CSS OM, nor CSS Animations, but you mentioned editing in the original comment, so the intention is to wrap any such internal operations with something conceptually equal to the |
The intention is that IDL-based APIs are covered by [CEReactions], and things that are not IDL-based APIs, like editing, are not---they fall back to the backup element queue. It sounds like we should send a pull request to CSSOM to add [CEReactions](unless the previous consensus is overturned in WICG/webcomponents#521). I am not familiar with the issues involved in web animations, but my guess is that they involve changing the style attribute from event loop animation frames, not from IDL-based APIs, so they would use the backup element queue. There is no intention to wrap things that are not IDL-based APIs in some [CEReactions] equivalent. But every IDL-based API that could cause custom element reactions should get annotated with [CEReactions]---including nonstandard ones, like those listed in this patch, or ones that have been forgotten, like CSSOM. |
|
What about editing? Pressing ENTER, DEL, or Ctrl-V can clone, remove, or append elements without going through |
|
Hmm, I thought I was pretty clear. The entire purpose of the backup element queue is to take care of those cases. |
|
Ah, sorry, I didn't read that part carefully enough. Microtask invokes the backup queue, understood. Sorry for the trouble. |
|
Filed w3c/csswg-drafts#200 for CSSOM. |
| data-x="custom-element-upgrades">upgrades</span> as well.)</p> | ||
|
|
||
| <p>Each <span>custom element reactions stack</span> has an associated <dfn>backup element | ||
| queue</dfn>, which an initially-empty <span>element queue</span>. Elements are pushed onto the |
There was a problem hiding this comment.
I find it a little weird that a stack has an associated queue. Aren't they both bound to the unit of ...?
There was a problem hiding this comment.
Yes, that's an alternate way to phrase it. Keeping things together seemed clearer to me...
There was a problem hiding this comment.
It's just that this kind of thing will go away if we formalize more. E.g., if a stack becomes a formalized List or Set, we wouldn't really associate other things with it. We might create a Record that holds it and some other related information I suppose... Oh well. Up to you.
There was a problem hiding this comment.
Hmm I see what you mean. I'll give it a shot rewriting them as separate things and see how it feels...
|
LGTM editorially otherwise. |
|
LGTM, WIP patch in Blink for this change looks working good when |
|
Based on seeing how Blink implements this and on trying to separate out the stack from from its associated helpers (backup queue and flag) and the spec getting uglier, I think I prefer to stick with the current approach instead of separating them. However, the WIP Blink patch does not match the spec very much as far as I can tell (I commented over there), so maybe we should not merge this until I understand the reason for the mismatch. |
|
(CSSOM fixed in w3c/csswg-drafts@39be12a) |
|
Some discussion with @kojiishi and updates to the Blink patch later, it seems like this is good as-is \o/ |
As discussed in WICG/webcomponents#186, there
are certain scenarios where custom element reactions could be enqueued,
but the custom element reactions stack is empty. The most prominent of
these is editing operations.
We solve this issue in two parts:
element queue" concept; see
When does the base element queue matter? WICG/webcomponents#457). This takes care of
cases like editing which cannot be solved in any other way.
that modify the DOM, including a list of what we've identified so far.
Closes WICG/webcomponents#186.
Careful review appreciated. /cc @dominiccooney @kojiishi @rniwa @annevk