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

RESOLVED FIXED

Status

()

Core
Layout
RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: Jesse Ruderman, Assigned: bz)

Tracking

(Blocks: 1 bug, {assertion, testcase})

Trunk
x86
Mac OS X
assertion, testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

10 years ago
Created attachment 317111 [details]
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.
Created attachment 329742 [details] [diff] [review]
Fix
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
Last Resolved: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.