[Webkit-unassigned] [Bug 101857] Updating mouse cursor on style changes without emitting fake mousemove event

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Dec 2 14:26:28 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=101857





--- Comment #37 from Aivo Paas <aivopaas at gmail.com>  2012-12-02 14:28:49 PST ---
(In reply to comment #23)
> (In reply to comment #22)
> > (In reply to comment #20)
> > > (In reply to comment #19)
> > > > (From update of attachment 174920 [details] [details] [details] [details])
> > > > View in context: https://bugs.webkit.org/attachment.cgi?id=174920&action=review
> > > > 
> > > > > Source/WebCore/rendering/RenderObject.cpp:1809
> > > > > +    if (oldStyle.get() && !areCursorsEqual(oldStyle.get(), this->style())) {
> > > > > +        if (Frame* frame = this->frame())
> > > > > +            frame->eventHandler()->updateCursor();
> > > > > +    }
> > > > > +
> > > > 
> > > > Would there be a problem in only updating the cursor when node is hovered?
> > > 
> > > I think that would be great. Is there a flag set when a node is hovered?
> > 
> > Yes, check Node::hovered().
> 
> Tried that, didn't work. Broke tests, probably related to text nodes, because those don't seem to get the hovered flag set. This optimization opportunity should be investigated in another bug, it's going out of the scope of this bug / patch.

I did now dig a little deeper. There were 3 problems with that:
1) Hovered flag is not set on text nodes.
2) Style change is propagated to text nodes sometime later and when hit test gets a text node, it won't have the correct cursor until its style is updated.
3) While holding mouse button down (having an element active), hovered flags are not changed on new hovered elements.

There's an easy workaround for (1) and (2) by getting the cursor from parent node when hit test gets a text node. (3) needs a change so that hovered flag is changed even when mouse button is down. I have checked and that's also how IE and FF behave - hover styles are shown also on those elements that were not pressed on, while on Chrome, hover styles are not applied to the elements that were not pressed down.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list