Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ This is what the spec says:
updateStyle();
updateLayout();
}
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.

paint();
}
}
Expand Down Expand Up @@ -142,6 +145,14 @@ of the event loop. If a discrete event is received, all continuous events
in the task queue should run immediately to prevent the discrete event
from being delayed.

## 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.
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...


## What really happens

We've built a [test page]( https://rawgit.com/atotic/event-loop/master/shell.html). The page simultaneously generates (listed in order):
Expand Down