Closed Bug 645142 Opened 13 years ago Closed 13 years ago

"ABORT: negative lengths and percents should be rejected by parser" with huge font size

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla6

People

(Reporter: jruderman, Assigned: MatsPalmgren_bugz)

References

Details

(Keywords: assertion, testcase)

Attachments

(3 files, 1 obsolete file)

###!!! ABORT: negative lengths and percents should be rejected by parser: 'sizeValue->IsCalcUnit()', file layout/style/nsRuleNode.cpp, line 2548
Attached file stack trace
Attached file fix (obsolete) —
Assignee: nobody → matspal
Attachment #522239 - Flags: review?(dbaron)
OS: Mac OS X → All
Hardware: x86_64 → All
Comment on attachment 522239 [details]
fix

Clearly wrong....
Attachment #522239 - Attachment is obsolete: true
Attachment #522239 - Attachment is patch: false
Attachment #522239 - Flags: review?(dbaron)
Attached patch fix v2Splinter Review
The value is already in app units so we only need to clamp it.
Attachment #522240 - Flags: review?(dbaron)
Whiteboard: [needs review]
Comment on attachment 522240 [details] [diff] [review]
fix v2

If you're going to cast anything to float(), you should cast the
result of aPresContext->DeviceContext()->AppUnitsPerPhysicalInch(),
that is, to make it:

+  return NSToCoordRoundWithClamp(inches *
+    float(aPresContext->DeviceContext()->AppUnitsPerPhysicalInch()));

I think you should also use NSToCoordFloorClamped instead of
NSToCoordRoundWithClamp

r=dbaron with that
Attachment #522240 - Flags: review?(dbaron) → review+
http://hg.mozilla.org/mozilla-central/rev/abe7b2a19824
http://hg.mozilla.org/mozilla-central/rev/e64b8000eff8
Status: NEW → RESOLVED
Closed: 13 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [needs review]
Target Milestone: --- → mozilla6
I see this in recent Aurora and Nightly on Linux, Windows, Mac at a NSFW url (next comment will be private).

###!!! ABORT: negative lengths and percents should be rejected by parser: 'sizeValue->IsCalcUnit()', file /work/mozilla/builds/nightly/mozilla/layout/style/nsRuleNode.cpp, line 2561

pseudo stack: mozalloc_abort | Abort | NS_DebugBreak_P | nsRuleNode::SetFontSize nsRuleNode::SetFont nsRuleNode::ComputeFontData nsRuleNode::WalkRuleTree nsRuleNode::GetStyleData

Should this be reopened or a new bug filed?
New bug, please. And NSFW URLs don't automatically need to be security-sensitive :)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: