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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 11 16:59:49 PDT 2011


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


Ryosuke Niwa <rniwa at webkit.org> changed:

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




--- Comment #4 from Ryosuke Niwa <rniwa at webkit.org>  2011-07-11 16:59:49 PST ---
(From update of attachment 98417)
View in context: https://bugs.webkit.org/attachment.cgi?id=98417&action=review

r- due to various nits.

> Source/WebCore/ChangeLog:9
> +        Fix 2 --webkit-visual-word crashes:
> +        --webkit-visual-word crash on mixed editability and
> +        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

Nit: We normally just list two bug title + bug url separated by a blank line.

> Source/WebCore/editing/visible_units.cpp:1305
> +    bool positionInBox = positionIsInBox(wordBreak, box, offsetOfWordBreak);
> +    if (positionInBox && (previousOffset == invalidOffset || previousOffset < offsetOfWordBreak))

There's no need to declare a boolean here you can call positionIsInBox inside the if statement.  For that matter, this entire if statement is unnecessary.  You should just do:
return positionIsInBox(wordBreak, box, offsetOfWordBreak) && (previousOffset == invalidOffset || previousOffset < offsetOfWordBreak).

> Source/WebCore/editing/visible_units.cpp:1516
> +    bool positionInBox = positionIsInBox(wordBreak, box, offsetOfWordBreak);
> +    return positionInBox && offsetOfWordBreak != box->caretMaxOffset() && offsetOfWordBreak != box->caretMinOffset();

Ditto about the boolean.

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