Closed Bug 430352 Opened 16 years ago Closed 16 years ago

[FIX]"ASSERTION: width less than zero: 'aContainingBlockWidth >= 0'"

Categories

(Core :: Layout, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jruderman, Assigned: bzbarsky)

References

Details

(Keywords: assertion, testcase)

Attachments

(2 files)

Attached file testcase
###!!! ASSERTION: width less than zero: 'aContainingBlockWidth >= 0', file /Users/jruderman/trunk/mozilla/layout/base/nsLayoutUtils.cpp, line 1857
We're calling CalculateContainingBlockSizeForAbsolutes with an aReflowState which has:

  (gdb) p aReflowState.mStyleBorder->GetBorder()
  $12 = (const nsMargin &) @0xb144d558: {top = 60, right = 60,
                                         bottom = 60, left = 60}

but also has:

  (gdb) p aReflowState.mComputedBorderPadding
  $9 = {top = 0, right = 0, bottom = 0, left = 0}

aFrameSize is 0x0 in this case.  So CalculateContainingBlockSizeForAbsolutes is computing a negative cbSize.width (and same for height), which ends up propagating down to the child reflow state.  I assume the moz-appearance is what clobbers the computed border/padding here?

Is there a reason we're not using the mComputedBorderPadding - mComputedPadding here to find the border?  And should the moz-appearance really lead to a 0 mComputedBorderPadding in this case?
You're right, we should be using mComputedBorderPadding - mComputedPadding there.
Attached patch FixSplinter Review
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Attachment #329742 - Flags: superreview?(roc)
Attachment #329742 - Flags: review?(roc)
Summary: "ASSERTION: width less than zero: 'aContainingBlockWidth >= 0'" → [FIX]"ASSERTION: width less than zero: 'aContainingBlockWidth >= 0'"
Attachment #329742 - Flags: superreview?(roc)
Attachment #329742 - Flags: superreview+
Attachment #329742 - Flags: review?(roc)
Attachment #329742 - Flags: review+
Pushed to mozilla-central:
http://hg.mozilla.org/mozilla-central/index.cgi/rev/bee72059de15
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: