Open Bug 521875 Opened 15 years ago Updated 2 years ago

Collapsed margins do not uncollapse properly in this dynamic case

Categories

(Core :: Layout, defect)

x86
macOS
defect

Tracking

()

People

(Reporter: jruderman, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

(Keywords: testcase)

Attachments

(2 files)

Attached file testcase (dynamic)
No description provided.
Attached file reference (static)
Based on layout/reftests/margin-collapsing/block-sibling-1a.html.
This bug gets in refdyn's way fairly often.
Hmm. So that first change is just there to force textframe creation. Then the second marks the line with that textframe as dirty... but not the block line after it. And then in ReflowDirtyLines, this code: 1934 if (line.next() != end_lines()) { 1935 PRBool maybeWasEmpty = oldY == line.next()->mBounds.y; 1936 PRBool isEmpty = line->CachedIsEmpty(); 1937 if (maybeReflowingForFirstTime /*1*/ || 1938 (isEmpty || maybeWasEmpty) /*2/3/4*/) { 1939 line.next()->MarkPreviousMarginDirty(); doesn't reach line 1939 because maybeWasEmpty is false. And its false because oldY is 1800 but line.next()->mBounds.y is 2400. And that happens because oldY includes the margin of the block above.... but not that of the block below. But the old position of the second line includes both margins. So we end up maybeWasEmpty false when in fact the line used to be empty. Since isEmpty is false, and we're not reflowing for the first time, we skip the MarkPreviousMarginDirty call we actually need to make in this case.
Perhaps we should do: PRBool maybeWasEmpty = oldY == oldYMost || oldY == line.next()->mBounds.y; ? Or would that miss some cases in which oldYMost is bigger than oldY but the line was still empty for margin-collapsing purposes?
Yeah, it seems like we'd have a combination of bug 393655 and this bug that could still happen. The right approach is probably to have a state bit for line boxes that records whether the line was empty last time we reflowed it.
That seems relatively low-pain....
Blocks: 549926
Depends on: 50959
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: