Closed Bug 827227 Opened 11 years ago Closed 11 years ago

"ASSERTION: rounding error in width reduction???" with SVG, border-image

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla21

People

(Reporter: jruderman, Assigned: wchen)

References

Details

(Keywords: assertion, testcase)

Attachments

(2 files)

Attached image testcase
###!!! ASSERTION: rounding error in width reduction???: 'border.left + border.right <= borderImgArea.width && border.top + border.bottom <= borderImgArea.height', file layout/base/nsCSSRendering.cpp, line 3124

This assertion is part of the original code for border-image:

changeset:   dda1146d1ec3
user:        William Chen
date:        Thu Dec 22 18:34:45 2011 -0500
summary:     Bug 497995: Part 1 - Implement border-image revisions in latest css3-background spec. r=dbaron
Assignee: nobody → wchen
Comment on attachment 705948 [details] [diff] [review]
Fixed int overflow when scaling border-image-width.

>+  uint32_t combinedBorderWidth = border.left + border.right;

You should (for both width and height) cast these values to uint32_t before the addition rather than waiting until after.  And I think you should also add an assertion that the values are positive, which can probably be done in the code above, either right before or right after the assignment to border.Side(s).

r=dbaron with that
Attachment #705948 - Flags: review?(dbaron) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/4eed73abf01c
Flags: in-testsuite+
OS: Mac OS X → All
Hardware: x86_64 → All
https://hg.mozilla.org/mozilla-central/rev/4eed73abf01c
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: