Make the line list doubly linked and access it through a list class and iterators.
Stop recomputing margins on all of the children of each block in the reflow chain (which causes O(N^2) state recovery during incremental reflow). Instead, add a second dirty bit to the lines and walk backwards through the line list to recompute vertical margins only when either dirty bit is set and the previous line was not reflowed. Add nsIFrame::IsEmpty to identify frames through which margins collapse.
Fix O(N^2) propagation of float damage by maintaining a set of intervals damaged by floats (bug 61962) and be sure to damage the correct areas (bug 48138).
Introduce nsCollapsingMargin to do correct collapsing of combinations of positive and negative margins (bug 50142).
Clean up some odds and ends and fix another smaller O(N^2) problem in nsBlockFrame::AddFrames.
r=attinasi, rbs sr=waterson
r=sfraser
a=waterson
We now invalidate the line explicitly if text-align:right is set, because
our incremental painting is biased towards frames that grow to L2R. This
is a heavy-handed workaround, but it ends up doing very little extra invalidation,
and uses an already existing mechanism by just setting an existing flag.
nsTextTransformer.cpp.
I moved where we translate the nbsp to a (ascii 32 space character) until after the i18n routines are called, so they can properly account
for the space as non-breaking and therefore part of the first word in the block.
bug 39901 and 38396
nsHTMLImageLoader.*, nsImageFrame.cpp
I backed out the bad fix for 38396, and put in a new fix where I store a little state in the image loader flags for cases where the image
gets an unconstrained reflow and has %-based width. This does not handle %-based min-width or max-width, that would be a separate
bug that I'll file shortly. But this fixes the vast majority of real cases out there.
bug 18754
nsHRFrame.cpp, quirks.css, nsCSSFrameConstructor.cpp, last part of nsLineLayout.cpp
in quirks mode, I changed HR from a block element to a replaced inline element that acts like a block, using generated content to get
newlines before and after the HR. This isn't ideal, but it gets us backwards compatibility, and ian and dbaron have blessed the approach.
bug 50257
nsLineLayout.cpp
Did a couple of things in here:
* The actual fix is controlled by FIX_BUG_50257 #define symbol. This basically says that an break (BR) will always fit on a line.
A more general solution would probably be to round up to the nearest pixel, and if the thing is less than a pixel make it fit on a
line. This is a wimpier, safer solution.
* I noticed that the way we got the compatibility mode was way out of date, very wasteful. So I fixed that.
* I noticed that there were a bunch of redundant SetFlag calls. Since the flag variable is initialized to 0, setting a flag to 0 on a newly
created object is a waste.
nsBlockFrame.cpp -- just added a comment to some odd looking code, to make sure no one comes along later and breaks it
r=karnaze
The problem was we were over-eager in optimizing away a resize reflow for lines
that contain %-aware children. We were only looking at the first-level children
of a line, not all the children. Now, we compute a bit for each inline container
based on it's children, true if any of them are %-aware wrt any width measurement.
We propogate this bit upwards to a bit on the line itself, and check this bit during reflow.
fixed by adding a flag in nsLineBox for the content of a line to mark it "forceInvalidate",
logic in nsLineLayout to set the line dirty for initial reflow of text frames,
and logic in block to check the new flag.
r=kin
r=buster
bug 18545 ([FLOAT] Problem Centering <TABLE> with <DIV> tag)
r=troy
bugs 18827, 19579, 22327 24782, 26512, 30124, 31849, 32846 (floater behavior wrong)
The primary change here is to determine if a block is impacted by a floater, and if so
mark the block's lines dirty when appropriate.
r=troy
no bug number. performance work. reduced the size of some reflow data structures by
collapsing multiple fields into a single bit field.
r=troy