Last Comment Bug 233451 - white-space at end of line doesn't collapse when followed by out-of-flow element
: white-space at end of line doesn't collapse when followed by out-of-flow element
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Layout: Block and Inline (show other bugs)
: Trunk
: x86 Linux
: P2 normal (vote)
: mozilla1.7alpha
Assigned To: Boris Zbarsky [:bz] (Out June 25-July 6)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-02-08 15:42 PST by Boris Zbarsky [:bz] (Out June 25-July 6)
Modified: 2004-02-08 18:23 PST (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Testcase (486 bytes, text/html)
2004-02-08 15:42 PST, Boris Zbarsky [:bz] (Out June 25-July 6)
no flags Details
Or we could do this... (3.75 KB, patch)
2004-02-08 16:51 PST, Boris Zbarsky [:bz] (Out June 25-July 6)
dbaron: review+
dbaron: superreview+
Details | Diff | Review

Description Boris Zbarsky [:bz] (Out June 25-July 6) 2004-02-08 15:42:29 PST
Testcase coming up.  The problem is that the text frames get rendered if there
is a placeholder after them.
Comment 1 Boris Zbarsky [:bz] (Out June 25-July 6) 2004-02-08 15:42:54 PST
Created attachment 140894 [details]
Testcase
Comment 2 Boris Zbarsky [:bz] (Out June 25-July 6) 2004-02-08 16:07:50 PST
Happens in standards mode too.

Ian, is that the right behavior?
Comment 3 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2004-02-08 16:30:37 PST
This is a whitespace collapsing bug.  If you remove the whitespace before the
out-of-flow element, the bug goes away.
Comment 4 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2004-02-08 16:35:05 PST
It's probably worth starting with the loop in
nsLineLayout::TrimTrailingWhiteSpaceIn, but fixing this probably requires
returning additional status from nsIFrame::TrimTrailingWhiteSpace.
Comment 5 Boris Zbarsky [:bz] (Out June 25-July 6) 2004-02-08 16:51:07 PST
Created attachment 140899 [details] [diff] [review]
Or we could do this...
Comment 6 Boris Zbarsky [:bz] (Out June 25-July 6) 2004-02-08 16:52:17 PST
Comment on attachment 140899 [details] [diff] [review]
Or we could do this...

I suppose we could also use return values from nsIFrame::TrimTrailingWhiteSpace
and override it in textframes and placeholder frames to return "continue" or
something, but this seems simpler given how this code currently works.
Comment 7 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2004-02-08 16:55:48 PST
Oh, right.  I guess we already solve elsewhere the problem of collapsing
whitespace between text frames across placeholders, so PFD_NONEMPTYTEXTFRAME
won't be set -- I was thinking it would be.
Comment 8 Boris Zbarsky [:bz] (Out June 25-July 6) 2004-02-08 18:23:12 PST
Fixed.

Note You need to log in before you can comment on or make changes to this bug.