mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 382105. Yet another word caret movement fix to ensure we stop at punctuation.
This commit is contained in:
parent
35bfb90b83
commit
250e787eff
@ -4748,7 +4748,7 @@ nsTextFrame::PeekOffsetWord(PRBool aForward, PRBool aWordSelectEatSpace, PRBool
|
||||
return PR_FALSE;
|
||||
|
||||
PRBool stopAfterPunctuation = nsTextTransformer::GetWordSelectStopAtPunctuation();
|
||||
PRBool stopBeforePunctuation = stopAfterPunctuation && aIsKeyboardSelect;
|
||||
PRBool stopBeforePunctuation = stopAfterPunctuation && !aIsKeyboardSelect;
|
||||
PRInt32 offset = mContentOffset + (*aOffset < 0 ? mContentLength : *aOffset);
|
||||
ClusterIterator cIter(this, offset, aForward ? 1 : -1);
|
||||
PRBool firstCluster = PR_TRUE;
|
||||
@ -4756,9 +4756,10 @@ nsTextFrame::PeekOffsetWord(PRBool aForward, PRBool aWordSelectEatSpace, PRBool
|
||||
while (cIter.NextCluster()) {
|
||||
if (aWordSelectEatSpace == cIter.IsWhitespace() && !*aSawBeforeType) {
|
||||
*aSawBeforeType = PR_TRUE;
|
||||
} else {
|
||||
if (!firstCluster && ((*aSawBeforeType && cIter.HaveWordBreakBefore()) ||
|
||||
(stopBeforePunctuation && cIter.IsPunctuation()))) {
|
||||
} else if (*aSawBeforeType) {
|
||||
if (!firstCluster &&
|
||||
(cIter.IsPunctuation() ? stopBeforePunctuation
|
||||
: cIter.HaveWordBreakBefore())) {
|
||||
*aOffset = cIter.GetBeforeOffset() - mContentOffset;
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user