Change 20100921-maxcarlson-L by maxcarl...@friendly on 2010-09-21 13:14:17 PDT
in /Users/maxcarlson/openlaszlo/trunk2
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Simplify mouse events
Bugs Fixed: LPP-8470 - Simplify IE 7-specific mousehandling logic
Technical Reviewer: ptw
QA Reviewer: hminsky
Overview: This change uses a single (canvas) div for handling mouse events,
instead of registering on all click divs. A lot of simplification falls out of
this.
Details: LzSprite - Use LzSprite.__setClickable() to register for all mouse
events at root sprite init time. Move quirks.prevent_selection clause from
global scope of LzInputTextSprite. Remove __setClickable() calls, since
individual clickdivs are no longer made clickable. Unify (almost) all mouse
event handling logic in LzSprite.__clickDispatcher(), simplify __mouseEvent().
Improve __findParents() to return the first item found, use in __isMouseOver().
__globalmouseup() is simplified. Clean up setWidth/Height() and destroy()
logic. Test for quirks.fix_clickable in setCursor().
LzTextSprite - Update setSelectable() to use explicit handler for allowing
selection, to prevent event bubbling. Remove __setClickable() calls, since
individual clickdivs are no longer made clickable. Override __mouseEvent() to
return based on the value of selectable, to allow selection to happen.
LzMouseKernel - Eliminate __mouseupEvent() since global mosue up is handled by
LzSprite.__clickDispatcher(). Explicitly return true for real onmousemove
events to keep text selection working.
LzInputTextSprite - Wrap this.dragging property initialization in
quirks.autoscroll_textarea to show where it's used. Inputtexts are always
clickable, so call setClickable(true). Override setClickable() to cache the
value locally and ensure the inputtext remains clickable. Remove unused
__handlemouse() method. Use explicit handler for allowing selection, to
prevent event bubbling. Minimize events registered by __setTextEvents(), and
forward to __mouseEvent() when needed. Fix braino in setTextColor()
Tests: All apps run as before in DHTML on Firefox, Safari and IE.
test/lfc/legals/keyboardandmouse.lzx?lzr=dhtml&lzt=html comes much closer to
matching swf.
Files:
M WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
M WEB-INF/lps/lfc/kernel/dhtml/LzTextSprite.js
M WEB-INF/lps/lfc/kernel/dhtml/LzMouseKernel.js
M WEB-INF/lps/lfc/kernel/dhtml/LzInputTextSprite.js
Changeset:
http://svn.openlaszlo.org/openlaszlo/patches/20100921-maxcarlson-L.tar