[webkit-dev] HTMLInput issue

David Kilzer ddkilzer at webkit.org
Wed Feb 20 09:18:13 PST 2008


Hi Sriram,

Thanks for the patch!  In order for this patch to be committed to WebKit,
please open a bug on <http://bugs.webkit.org/>, attach the patch to it, and set
the "review?" flag to make sure it's seen.

Also, please review the contributor guidelines before reposting the patch:

http://webkit.org/coding/contributing.html

Specifically, please note that your patch will need a ChangeLog entry.

Also, we don't commit patches with fprintf() statements.  Please use the
appropriate LOG() macro instead.  (You may wish to consider using the
ASSERT_WITH_MESSAGE() macro as well.)

Thanks again!

Dave


Sriram Neelakandan <sriram.neelakandan at gmail.com> wrote:

> Hi folks,
> 
> I had a HTMLInput issue with gtk-webkit :  input text box wont work at all
> on HTML pages at all.
> 
> Interestingly, If i add a JavaScript handler, then the key press is
> processed and captured by the JS, but not by the HTMLInputElement.
> 
> I debugged the issue in HTMLInputElement::constrainValue calls
> numCharactersInGraphemeClusters(), which in turn creates a
> TextBreakIterator.
> 
> The TextBreakIterator would not create for me .. and always return NULL !
> 
> The issue was finally with icu's ubrk_open failing to initialize !
> 
> The reason was this :    U_FILE_ACCESS_ERROR       =  4,     /**< The
> requested file cannot be found */
> 
> ICU was unable to find its data file , in my case *icudt36l.dat*
> 
> I copied the file to my target, export ICU_DATA and things just started
> working ! great !
> 
> Thanks to Mike (mike.emmel at gmail.com) for pointing me in the right direction
> !
> 
> May be this is obvious for people familiar with ICU, but a dumbo like me,
> took 2 weeks to trace myself through the webkit code and to get the
> openStatus ERROR !
> 
> So, why not add a printf atleast (if not ASSERT) in debug mode, and indicate
> that the characterBreakIterator failed to initalize. This will save some
> else' 2 weeks and frustration  as well.
> 
> Kindly accept the patch
> 
> Here is a patch for file :
> 
>  WebCore/platform/text/TextBreakIteratorICU.cpp
> 
> ***************
> *** 25,30 ****
> --- 25,34 ----
>   #include "TextBreakIteratorInternalICU.h"
> 
>   #include <unicode/ubrk.h>
> + #include <wtf/Assertions.h>
> + #include <stdio.h>
> +
> + using namespace std;
> 
>   namespace WebCore {
> 
> *************** static TextBreakIterator* setUpIterator(
> *** 34,46 ****
>       if (!string)
>           return 0;
> 
>       if (!createdIterator) {
> -         UErrorCode openStatus = U_ZERO_ERROR;
>           iterator = static_cast<TextBreakIterator*>(ubrk_open(type,
> currentTextBreakLocaleID(), 0, 0, &openStatus));
>           createdIterator = true;
>       }
>       if (!iterator)
>           return 0;
> 
>       UErrorCode setTextStatus = U_ZERO_ERROR;
>       ubrk_setText(iterator, string, length, &setTextStatus);
> --- 38,54 ----
>       if (!string)
>           return 0;
> 
> +     UErrorCode openStatus = U_ZERO_ERROR;
>       if (!createdIterator) {
>           iterator = static_cast<TextBreakIterator*>(ubrk_open(type,
> currentTextBreakLocaleID(), 0, 0, &openStatus));
>           createdIterator = true;
>       }
>       if (!iterator)
> +     {
> +         fprintf(stderr,"Could not create iterator instance @ %s:%d,
> ICU_ERROR=%d\n",__FILE__,__LINE__,openStatus);
> +         ASSERT(iterator);
>           return 0;
> +     }
> 
>       UErrorCode setTextStatus = U_ZERO_ERROR;
>       ubrk_setText(iterator, string, length, &setTextStatus);
> 
> 
> 
> 
> 
> 
> 
> -- 
> Sriram Neelakandan
> Author - Embedded Linux System Design And Development (
> http://tinyurl.com/2doosu)
> > _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
> 



More information about the webkit-dev mailing list