[Webkit-unassigned] [Bug 57543] -webkit-visual-word does not work on words separated by multiple spaces

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri May 6 17:39:43 PDT 2011


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





--- Comment #7 from Ryosuke Niwa <rniwa at webkit.org>  2011-05-06 17:39:43 PST ---
(From update of attachment 92380)
View in context: https://bugs.webkit.org/attachment.cgi?id=92380&action=review

> Source/WebCore/editing/visible_units.cpp:1160
> +static VisiblePosition visuallyFirstWordBreakInBoxInsideBlockWithSameDirectionality(const InlineBox* box, const VisiblePosition& wordBreak, int& offsetOfWordBreak) 

I'm not sure if "visuallyFirstWordBreak" is descriptive here.  How about something like beforeVisuallyFirstWordInBoxInsideBlockWithSameDirectionality?

Also, it may not be worth adding this function at all since it's called at exactly one place.  Can we just put this all in previousWordBreakInBoxInsideBlockWithSameDirectionality?

> Source/WebCore/editing/visible_units.cpp:1162
> +    VisiblePosition nextWord = nextWordPosition(wordBreak);

Nit: s/nextWord/positionAfterCurrentWord/

> Source/WebCore/editing/visible_units.cpp:1163
> +    VisiblePosition wordPosition = previousWordPosition(nextWord);

Nit: s/wordPosition/positionBeforeCurrentWord/

> Source/WebCore/editing/visible_units.cpp:1186
> +        && ((box->isLeftToRightDirection() && box->nextLeafChild()) 
> +        || (!box->isLeftToRightDirection() && box->prevLeafChild()))) {

I'm not following here.  Shouldn't we be checking box->isLeftToRightDirection() && !box->prevLeafChild() instead?

> Source/WebCore/editing/visible_units.cpp:1296
> +    VisiblePosition wordBreak = Position(box->renderer()->node(), box->caretMaxOffset(), Position::PositionIsOffsetInAnchor);
> +
> +    VisiblePosition nextWord = previousWordPosition(wordBreak);
> +    wordBreak = nextWordPosition(nextWord);

Ditto about these variable names.

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