Add some text around asynchronous mouse events and hover state.#2
Add some text around asynchronous mouse events and hover state.#2dtapuska wants to merge 1 commit intoatotic:masterfrom
Conversation
| current node since during a layout the position may have shifted from the | ||
| previous hover state. If the hover state changes the CSS hover rule will | ||
| be updated as well mouseout, mouseleave, mouseenter, mouseover will be | ||
| dispatched to the relevant nodes. |
There was a problem hiding this comment.
Event dispatch in general needs its own better written section. It is so underspecified in the spec, I've stayed away from trying to describe it.
The "Pending UI events" section was added after I wrote my doc, and now you are adding one more section. I do not feel like they really fit in well with the rest of the doc, but I can't think of a better place to put them.
Maybe merge these two sections together as:
Event dispatch details
Event dispatch is underspecified, this section needs more work.
Pending UI events
......
Asynchronously Update Hover State
After a layout has occurred the user agent will update the hover state of the
current node since during a layout the position may have shifted from the
previous hover state. If the hover state changes the CSS hover rule will
be updated as well mouseout, mouseleave, mouseenter, mouseover will be
dispatched to the relevant nodes.
What do you think about:
Event loop hover state update
Layout performed inside render() might cause the current hover target to change.
If the target changes, user agent will queue a task to update hover styles, and another task
to fire related mouse events.
I am trying to make this wording friendly to webdevs...
| } | ||
| if (updatedLayout) { | ||
| scheduleAsyncHoverUpdate(); | ||
| } |
There was a problem hiding this comment.
I read the original as: "send hover updates every time layout has been updated"
What you mean is "send hover updates if hover state has changed"
it might be clearer to webdevs to write it as:
if (hoverTargetChanged) {
queueHoverUpdateTask();
queueHoverMouseEventTasks();
}
This lets developers know that
- this only happens if hover state changes
- hover update (marking the style sheet/layout as dirty) happens before the mouse events are dispatched.
No description provided.