The setSelectionRange() method silently failing seems like a bad idea to me. If we cannot support it on Firefox, wouldn't it be better to alert the user of that with a java exception?
On Thu, Sep 18, 2008 at 2:43 PM, John LaBanca <[EMAIL PROTECTED]> wrote: > +gwtContrib > Thanks, > John LaBanca > [EMAIL PROTECTED] > > > On Thu, Sep 18, 2008 at 2:21 PM, John LaBanca <[EMAIL PROTECTED]> wrote: > >> Emily - >> Please do a code review on this two-for patch for TextBox. >> >> Description: >> ======== >> Calling TextBoxBase.setSelectionRange(elem, int, int) throws an exception >> in FF if the element is either unattached or not visible (ie. display:none). >> Also, getSelectedText() can throw an exception if the cursorPos is reported >> as -1, which it can be in IE. >> >> Fix: >> ==== >> TextBoxBase.setSelectionRange() now checks if an exception occurs and >> ignores it. getSelectedText() now checks if the cursorPos is -1. >> >> Testing: >> ====== >> Created unit test for the setSelectionRage() case, and verified the >> following methods on all main browsers (IE versions of them): >> selectAll() >> getSelectionLength() >> getSelectedText() >> getCursorPos() >> setCursorPos() >> >> >> Thanks, >> John LaBanca >> [EMAIL PROTECTED] >> > > -- "There are only 10 types of people in the world: Those who understand binary, and those who don't" --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
