Comment 31 for bug 327863

Revision history for this message
In , Zack Weinberg (zackw) wrote :

(In reply to comment #26)
> Here's another plan: instead of iterating through the kids of the scrollframe
> in BuildDisplayList, just explicitly do
> if (mHScrollbarBox && mHasHorizontalScrollbar) {
> rv = mOuter->BuildDisplayListForChild(aBuilder, mHScrollbarBox, aDirtyRect,
> aLists);
> NS_ENSURE_SUCCESS(rv, rv);
> }
> etc

That will fix the bad painting but not the assertions; as I say in comment 23, we've broken frame tree invariants as early as nsCSSOffsetState::InitOffsets() [when called on a collapsed scrollbar which happens to be a dirty reflow root, with a theme that specifies a border for it]. To fix that, either we have to stop these collapsed scrollbars from being treated as dirty reflow roots in the first place, or we have to figure out some way of communicating to InitOffsets that it should ignore the border specified by the theme.

It occurred to me yesterday that we could just clamp the various margins computed by InitOffsets to the stated size of the border-box (zero in this case). That might be enough to make PresShell::DoReflow happy, and might even eliminate the need for your trick in BuildDisplayList. Can you think of any reason that won't work?