Closed
Bug 310087
Opened 19 years ago
Closed 19 years ago
Be smarter about handling of newlines in pre and pre-wrap content
Categories
(Core :: Layout: Block and Inline, defect, P2)
Core
Layout: Block and Inline
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha1
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
Details
(Keywords: perf)
Attachments
(3 files)
126.88 KB,
text/html
|
Details | |
146.30 KB,
text/html
|
Details | |
1.82 KB,
patch
|
roc
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
See bug 240933 comment 9 and bug 240933 comment 10. The following are the
issues I see:
1) I'm not sure we set break types on lines appropriately based on \n in
preformatted content. At least part of the problem is that changing the
white-space handling just does a reflow and I believe break types survive across
reflows, right? If so, we'd need to deal with that. In any case, we return
this stuff correctly from nsTextFrame::Reflow, so at least some of this already
works. If we had this, working we could use it to optimize dirtying of lines
when content is changed while editing.
2) The check for BRFrame in nsBlockFrame::AddFrames should actually check
whether the prevsibling would cause a break-after, not check for a BRFrame.
3) It looks like we already call SetLineEndsInBR from nsTextFrame::Reflow, so
that should be ok (though perhaps we should rename this or clarify how it
interacts with the break-after stuff, or something?)
Assignee | ||
Comment 1•19 years ago
|
||
I can write some testcases if we need to test things, btw.
We could easily make changes to 'white-space' cause a reframe.
Assignee | ||
Comment 3•19 years ago
|
||
Does the reframe clear out info on lines somehow, then? If the info is not
stored between reflows, there's nothing to worry about, it seems...
What information are you talking about, exactly?
On line boxes, SetLineBreakBefore/After is only about clearance, so not relevant
here. SetLineWrapped gets recomputed every time we reflow the line.
Assignee | ||
Comment 5•19 years ago
|
||
Ah. I didn't realize the line break thing was just for clearance. I really
wish we had more docs in nsLineBox.h.... ;)
I guess the only relevant part then is the LineEndsInBR() thing, and that's
recomputed each time we reflow the line too.
Assignee | ||
Comment 6•19 years ago
|
||
Assignee | ||
Comment 7•19 years ago
|
||
The <br> testcase is actually slower. This has been happy ever since bug 229052 added that SetLineEndsInBR() call to nsTextFrame::Reflow.
So only item 2 is left, really. Should be easy to fix.
Assignee | ||
Comment 8•19 years ago
|
||
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Attachment #219100 -
Flags: superreview?(roc)
Attachment #219100 -
Flags: review?(roc)
Assignee | ||
Updated•19 years ago
|
Status: ASSIGNED → NEW
Priority: -- → P2
Target Milestone: --- → mozilla1.9alpha
Attachment #219100 -
Flags: superreview?(roc)
Attachment #219100 -
Flags: superreview+
Attachment #219100 -
Flags: review?(roc)
Attachment #219100 -
Flags: review+
Assignee | ||
Comment 9•19 years ago
|
||
Fixed on trunk.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•