Fix for bug #16176: [DOGFOOD] need to annotate line frames with whitespace trim
layout/base/src/nsCaret.cpp
- Modified DrawCaretWithContext so that we only
adjust the caret position if we are within the
frame's bounds.
layout/html/base/src/nsTextFrame.cpp
- Modified GetPointFromOffset() to add the width
of a space if the offset is after a trailing space
and it was trimmed off the frame.
r=sfraser@netscape.com
git-svn-id: svn://10.0.0.236/trunk@52206 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -2159,6 +2159,18 @@ nsTextFrame::GetPointFromOffset(nsIPresContext* aPresContext,
|
||||
GetWidth(*inRendContext, ts,
|
||||
paintBuffer.mBuffer, ip[inOffset]-mContentOffset,
|
||||
&width);
|
||||
|
||||
if (inOffset > textLength && (TEXT_TRIMMED_WS & mState)){
|
||||
//
|
||||
// Offset must be after a space that has
|
||||
// been trimmed off the end of the frame.
|
||||
// Add the width of the trimmed space back
|
||||
// to the total width, so the caret appears
|
||||
// in the proper place!
|
||||
//
|
||||
width += ts.mSpaceWidth;
|
||||
}
|
||||
|
||||
outPoint->x = width;
|
||||
outPoint->y = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user