[Laszlo-dev] For Review: Change 20090603-hqm-U Summary: fix for text selection in DHTML

Max Carlson max at laszlosystems.com
Wed Jun 24 08:57:11 PDT 2009


Please wrap the onselectstart stuff in a quirk instead of testing for 
lz.embed.browser.isIE, e.g. from LzInputTextSprite.js:

   if (lz.embed.browser.isIE) {
         //this.__LZdiv.onselectstart = null;
         this.__LZdiv.onselectstart = null;
     }

Henry Minsky wrote:
> Change 20090603-hqm-U by hqm at badtzmaru.home on 2009-06-03 22:27:28 EDT
>     in /Users/hqm/openlaszlo/trunk5
>     for http://svn.openlaszlo.org/openlaszlo/trunk
> 
> Summary:  fix for text selection in DHTML
> 
> New Features:
> 
> Bugs Fixed: LPP-8200
> 
> Technical Reviewer: max
> QA Reviewer: andre
> Doc Reviewer: (pending)
> 
> Documentation:
> 
> Release Notes:
> 
> Details:
> 
> +  LzSprite.js: only toggle the focus in focus_on_mouseover quirk when 
> there is some text selected.
> 
> + LzKeyboardKernel.js: Instead of cancelling a mouse event completely,
>   just cancel bubbling. This lets the div handle the event, and allows
>   text selection to work, but should disable it from propagating to
>   global handlers.
> 
> + LzMouseKernel.js: don't cancel event with keyCode == 0 entirely, just 
> cancel bubbling.
> 
> + LzTextSprite.js: use correct CSS properties for toggling 
> selectability, in Safari
> 
> + LzInputTextSprite.js: do not bind the global document.onselectstart 
> handler, that prevents
> text selection from working in some browsers
> 
> + LzText.lzs: add the 'onselectable' event, not required for this
> patch, but I noticed it was missing when writing a test case
> 
> Tests:
> 
> + added lpp-8200.lzx test, try selecting a region in each the text
> fields, except for the last (non-selectable) one.
> 
> + text selection should work in DHTML on selectable text or input text, all
> browsers
> 
> + NOTE: there is a bug in IE7 text selection [maybe related to
> (LPP-8249) "IE7 DHTML text letter spacing looks bad"], where in the
> test case lpp-8200, if you try to drag the mouse to select the text in
> the <text> view which says "This is selectable text", you cannot use
> the mouse to select the last word ('text'). I think that maybe the
> letter spacing setting causes the browser to miscalulate the text
> width?
> 
> Files:
> A      test/lfc/lpp-8200.lzx
> M      WEB-INF/lps/lfc/kernel/dhtml/LzKeyboardKernel.js
> 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
> M      WEB-INF/lps/lfc/views/LzText.lzs
> 
> Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20090603-hqm-U.tar

-- 
Regards,
Max Carlson
OpenLaszlo.org


More information about the Laszlo-dev mailing list