[Webkit-unassigned] [Bug 57806] continue experiment with moving caret by word in visual order
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Apr 7 09:29:41 PDT 2011
https://bugs.webkit.org/show_bug.cgi?id=57806
--- Comment #16 from Ryosuke Niwa <rniwa at webkit.org> 2011-04-07 09:29:41 PST ---
(From update of attachment 88540)
View in context: https://bugs.webkit.org/attachment.cgi?id=88540&action=review
> Source/WebCore/editing/visible_units.cpp:1188
> + return Position(node, 0, Position::PositionIsOffsetInAnchor);
What if there was node extended for multiple lines? Would this be still correct?
> Source/WebCore/editing/visible_units.cpp:1230
> +static VisiblePosition lastWordBreakInBox(const InlineBox* box, int& offsetOfWordBreak)
> +{
> + // Add the leftmost word break for RTL box or rightmost word break for LTR box.
> + InlineBox* previousLeaf = box->prevLeafChild();
> + InlineBox* nextLeaf = box->nextLeafChild();
> + VisiblePosition boundaryPosition;
> + if (box->direction() == RTL && (!previousLeaf || previousLeaf->isLeftToRightDirection()))
> + boundaryPosition = leftmostPositionInRTLBoxInLTRBlock(box);
> + else if (box->direction() == LTR && (!nextLeaf || !nextLeaf->isLeftToRightDirection()))
> + boundaryPosition = rightmostPositionInLTRBoxInRTLBlock(box);
> + if (boundaryPosition.isNull())
> + return VisiblePosition();
> + VisiblePosition wordBreak = nextWordPosition(boundaryPosition);
> + if (wordBreak != boundaryPosition)
> + wordBreak = previousWordPosition(wordBreak);
> + InlineBox* boxOfWordBreak;
> + wordBreak.getInlineBoxAndOffset(boxOfWordBreak, offsetOfWordBreak);
> + if (boxOfWordBreak == box)
> + return wordBreak;
> + return VisiblePosition();
> +}
Please insert blank lines as appropriate.
> Source/WebCore/editing/visible_units.cpp:1281
> + WordBoundaryEntry(): visiblePosition(VisiblePosition()), offset(invalidOffset) {}
> + WordBoundaryEntry(const VisiblePosition& position, int offset): visiblePosition(position), offset(offset) {}
Please follow WebKit style for constructors here.
--
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