Closed Bug 16176 Opened 25 years ago Closed 25 years ago

[DOGFOOD] need to annotate line frames with whitespace trimming info

Categories

(Core :: Layout, defect, P1)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: buster, Assigned: kinmoz)

References

Details

(Whiteboard: [PDT+])

To solve the problem on imaging a space at the end of a line in the editor (that
is, imaging the caret offset from the last character in a line when the last
character is a space), we need the line frame to be annotated with the result of
the whitespace trimming code.  Given that, the caret can be taught how to paint
itself to show the space.


Marked dogfood because this is required to fix a dogfood caret imaging bug
14573


Kipp, please assign back to me when your part is done.
Blocks: 14573
OS: other → All
Priority: P3 → P2
Hardware: Other → All
Target Milestone: M11
kipp claims this is trivial, so asking for M11.
Status: NEW → ASSIGNED
Fix is in my tree; waiting for a code review
Assignee: kipp → buster
Status: ASSIGNED → NEW
Code's in; nsILineIterator's GetLine method now returns "flags" for each line;
see the definitions at the top...
Whiteboard: [PDT+]
Putting on the [PDT+] radar.
Assignee: buster → sfraser
assigned to sfraser, cc kin.  Could one of you look at this as a high priority
dogfood item?  I hear lots of complaints about the editor not handling spaces
correctly, and it makes for some awkward editing without the visual feedback of
a space at the end of the line.
Assignee: sfraser → kin
Assigning to kin@netscape.com.
Status: NEW → ASSIGNED
Accepting bug.
Blocks: 12658
QA Contact: petersen → sujay
Changed QA contact from petersen@netscape.com to sujay@netscape.com per
beppe@netscape.com.
Blocks: 17432
Priority: P2 → P1
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Fix checked in to Mozilla 5.0 tip. This fix actually went a different route,
instead of using the line iterator's line flags, I modified
nsTextFrame::nsGetPointFromOffset() to check mFlags and tack on the width of the
missing space if it was trimmed.

    layout/base/src/nsCaret.cpp    revision 1.36
        - Modified DrawCaretWithContext so that we only
          adjust the caret position if we are within the
          frame's bounds.

    layout/html/base/src/nsTextFrame.cpp    revision 1.189
        - Modified GetPointFromOffset() to add the width
          of a space if the offset is after a trailing space
          and it was trimmed off the frame.

Fix was reviewed by sfraser@netscape.com.
QA Contact: sujay → petersen
re-assigning to petersen.
Steve, I'm not sure what I should do to verify this fix. Is there a test case I

could use to help me ?
Testing for this is easy.

Startup a blank composer, then type a word and hit the space bar. The caret
should advance by a space.

Before this bug was fixed, the caret would not advance till you hit the space
bar twice to enter 2 spaces.
Status: RESOLVED → VERIFIED
With the Dec 01 build (1999120108), this problem has been fixed.
No longer blocks: 17432
You need to log in before you can comment on or make changes to this bug.