Skip to content

Conversation

@dtapuska
Copy link
Contributor

No description provided.

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.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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();
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants