[Webkit-unassigned] [Bug 61978] --webkit-visual-word crash on mixed editability

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 14 14:31:27 PDT 2011


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


Ryosuke Niwa <rniwa at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #100400|review?                     |review-
               Flag|                            |




--- Comment #6 from Ryosuke Niwa <rniwa at webkit.org>  2011-07-14 14:31:27 PST ---
(From update of attachment 100400)
View in context: https://bugs.webkit.org/attachment.cgi?id=100400&action=review

Due to various nits and missing null check.

> Source/WebCore/ChangeLog:10
> +        Fix 2 --webkit-visual-word crashes:
> +        --webkit-visual-word crash on mixed editability and
> +        --webkit-visual-word crashes (VisiblePosition.getInlineBoxAndOffset could return null box)
> +
> +        https://bugs.webkit.org/show_bug.cgi?id=61978
> +        https://bugs.webkit.org/show_bug.cgi?id=62814

Nit: should be:
--webkit-visual-word crash on mixed editability
https://bugs.webkit.org/show_bug.cgi?id=61978

--webkit-visual-word crashes (VisiblePosition.getInlineBoxAndOffset could return null box)
https://bugs.webkit.org/show_bug.cgi?id=62814

> Source/WebCore/editing/visible_units.cpp:1230
> +    if (positionIsInBox(wordBreak, box, offsetOfWordBreak))
> +        return wordBreak;
> +    return VisiblePosition();

Seems like we should have a version of positionIsInBox that doesn't take offsetOfWordBreak.  Also I'd use tertiary here.

> Source/WebCore/editing/visible_units.cpp:1305
> +    if (positionIsInBox(wordBreak, box, offsetOfWordBreak))
>          return wordBreak;
>      return VisiblePosition();    

Ditto about using tertiary.

> Source/WebCore/editing/visible_units.cpp:1312
> +           && (previousOffset == invalidOffset || previousOffset < offsetOfWordBreak);

Nit: && should be intended by 4 spaces, and should NOT be aligned with positionIsInBox.

> Source/WebCore/editing/visible_units.cpp:1521
> +           && offsetOfWordBreak != box->caretMaxOffset() && offsetOfWordBreak != box->caretMinOffset();

Ditto about indentation.

> Source/WebCore/editing/visible_units.cpp:1604
> +    // FIXME: do I need to check visiblePosition.isNotNull() ?

Yes, you should.

-- 
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