[Webkit-unassigned] [Bug 17475] Error with line break inside ?» pair of characters.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 25 17:32:07 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=17475


Darin Adler <darin at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #47371|review?                     |review+
               Flag|                            |




--- Comment #10 from Darin Adler <darin at apple.com>  2010-01-25 17:32:06 PST ---
(From update of attachment 47371)
> +static const unsigned char internetExplorerBreaksBetweenQuestionMarkAnd[] = {

I think it would be better to have a size of 0x80 on this array definition.

I think it's a bit curious to name this array with a verb as if it was a
function. A mathematical way of thinking about an array. Programmers tend to
think of them as objects instead.

> +        // Internet Explorer allows breaking afer a question mark preceding one of a subset of
> +        // characters in ASCII. For characters outside ASCII, defer to the Unicode algorithm by returning false.

This comment should somehow state that the array is used for enhanced speed as
well as to match IE. If all we cared about was matching IE, then the code could
say just:

    case '?':
        return nextCh == '|';

>          case '?':
> +            return nextCh <= 0x7f && internetExplorerBreaksBetweenQuestionMarkAnd[nextCh];

I prefer capital hex, myself. It would be nice if the check here was more tied
to the size of the array.

r=me

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list