[webkit-reviews] review requested: [Bug 10338] When contentEditable, cursor doesn't change to hand - Need WebPreference : [Attachment 10416] patch for comment

bugzilla-request-daemon at opendarwin.org bugzilla-request-daemon at opendarwin.org
Wed Sep 6 06:42:53 PDT 2006


Graham Dennis <Graham.Dennis at gmail.com> has asked  for review:
Bug 10338: When contentEditable, cursor doesn't change to hand - Need
WebPreference
http://bugzilla.opendarwin.org/show_bug.cgi?id=10338

Attachment 10416: patch for comment
http://bugzilla.opendarwin.org/attachment.cgi?id=10416&action=edit

------- Additional Comments from Graham Dennis <Graham.Dennis at gmail.com>
I've had a stab at this, but I think my method is a bit hackish, and I'm
looking for comments. As such no changelog or testcase is included in this
patch.

To see why this is a bit hackish, consider the following sequence of events:
Say your current selection is either non-existent or outside of the editable
div with the link. Now you mouse down on the link. At this stage, the selection
is still what it was. Some time later (perhaps a really short time) you release
the mouse. At this point, the selection is now inside the editable div with the
link, and I'm not sure how to determine whether or not this link should be
followed based on information available at this point. 

To work around this, I've created an extra private variable in
HTMLAnchorElement, m_rootEditableElementForSelectionOnMouseDown, which is the
root editable element of the selection at the time of the mousedown event. This
variable is cleared on either a mouseout or a mouseclick event. Using the value
of this variable, during the mouseclick event, it is then possible to determine
whether or not the link should be followed.

Does anyone have any better ideas?

Also, this patch does not use WebPreferences as it is still an initial hack. Do
we want a preference for this, or is Dan's suggested behaviour OK to be
default?



More information about the webkit-reviews mailing list