The default bug view has changed. See this FAQ.

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

RESOLVED FIXED in mozilla6

Status

()

Core
CSS Parsing and Computation
--
critical
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Jesse Ruderman, Assigned: mats)

Tracking

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

Trunk
mozilla6
assertion, testcase
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments, 1 obsolete attachment)

(Reporter)

Description

6 years ago
Created attachment 521914 [details]
testcase (asserts fatally when loaded)

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

Comment 1

6 years ago
Created attachment 521917 [details]
stack trace
(Assignee)

Comment 2

6 years ago
Created attachment 522239 [details]
fix
Assignee: nobody → matspal
Attachment #522239 - Flags: review?(dbaron)
(Assignee)

Updated

6 years ago
OS: Mac OS X → All
Hardware: x86_64 → All
(Assignee)

Comment 3

6 years ago
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)
(Assignee)

Comment 4

6 years ago
Created attachment 522240 [details] [diff] [review]
fix v2

The value is already in app units so we only need to clamp it.
Attachment #522240 - Flags: review?(dbaron)
(Assignee)

Updated

6 years ago
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+
(Assignee)

Comment 6

6 years ago
http://hg.mozilla.org/mozilla-central/rev/abe7b2a19824
http://hg.mozilla.org/mozilla-central/rev/e64b8000eff8
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [needs review]
Target Milestone: --- → mozilla6

Comment 7

6 years ago
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?
(Reporter)

Comment 9

6 years ago
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.