Closed
Bug 345709
Opened 20 years ago
Closed 20 years ago
A better fix for bug 291702 (crash when flex is summing up to zero) is needed
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha1
People
(Reporter: martijn.martijn, Assigned: bzbarsky)
References
Details
(Keywords: fixed1.8.1)
Attachments
(3 files)
|
10.43 KB,
application/vnd.mozilla.xul+xml
|
Details | |
|
1.88 KB,
patch
|
Details | Diff | Splinter Review | |
|
3.87 KB,
patch
|
neil
:
review+
roc
:
superreview+
beltzner
:
approval1.8.1+
|
Details | Diff | Splinter Review |
The fix for bug 291702 is not good, although it fixes the crash in that bug.
See bug 291702, comment 16:
"
I'm still not sure what the check against nscoord_MAX is doing....
sr=bzbarsky, but what we should _really_ do, imo is:
1) Not parse negative flex values in CSS (use ParsePositiveVariant instead of
ParseVariant).
2) Not allow negative values from attributes.
3) Deal with some of flexes overflow somehow (perhaps the nscoord_MAX check
here does that?)
"
| Reporter | ||
Comment 1•20 years ago
|
||
Arghh! I was too quick with checking in the patch from bug 291702. It doesn't protect agains this testcase, so it's clearly not the right patch.
| Reporter | ||
Comment 2•20 years ago
|
||
Well, this makes it not crash, but I don't think that's the good way of dealing with it, is it?
| Assignee | ||
Comment 3•20 years ago
|
||
I'd say we want to treat flexes that add up to 0 due to overflow as not being set at all, preferably...
Alternately, we could only apply flexes up to the point when we'd overflow, then nothing. Neil, thoughts?
Realistically, pretty much any non-crashing behavior for that testcase would be good.
Comment 4•20 years ago
|
||
Well, i'd prefer for nscoord to be float. In the interim, assuming not too many call sites are involved, should we change flex from an nscoord to a float?
Failing that, is there any way we can limit the flex to something reasonable - as 0xFFFF isn't, how about 0xFFFFFFFF / GetChildCount() ?
| Assignee | ||
Comment 5•20 years ago
|
||
If it's an nscoord it should be nscoord_MAX / GetChildCount(). When nscoord becomes a float, this will just be a Very Big Number.
| Reporter | ||
Comment 6•20 years ago
|
||
I'm afraid I don't have time nor the knowledge to make a better patch, atm.
Fwiw, the patch seems to fix the crash and doesn't seem to regress anything, afaics.
| Assignee | ||
Comment 7•20 years ago
|
||
Attachment #231194 -
Flags: review?(neil)
Comment 8•20 years ago
|
||
Comment on attachment 231194 [details] [diff] [review]
Neil, something like this?
I was trying to work out whether floats make our life easier but in fact they make it harder as we assume we can exactly add and subtract flexes.
Attachment #231194 -
Flags: review?(neil) → review+
| Assignee | ||
Updated•20 years ago
|
Attachment #231194 -
Flags: superreview?(roc)
Attachment #231194 -
Flags: superreview?(roc) → superreview+
| Assignee | ||
Comment 9•20 years ago
|
||
Fixed for 1.9a.
Assignee: nobody → bzbarsky
Target Milestone: --- → mozilla1.9alpha
| Assignee | ||
Updated•20 years ago
|
Status: NEW → RESOLVED
Closed: 20 years ago
OS: Windows XP → All
Hardware: PC → All
Resolution: --- → FIXED
Comment 10•20 years ago
|
||
would be nice to see this in 1.8.1-branch, the testcase crashes branch hard.
| Assignee | ||
Comment 11•20 years ago
|
||
Comment on attachment 231194 [details] [diff] [review]
Neil, something like this?
Yeah, might not be a bad idea.
Attachment #231194 -
Flags: approval1.8.1?
Comment 12•20 years ago
|
||
Comment on attachment 231194 [details] [diff] [review]
Neil, something like this?
a=beltzner on behalf of drivers for the mozilla_1_8_branch
Attachment #231194 -
Flags: approval1.8.1? → approval1.8.1+
You need to log in
before you can comment on or make changes to this bug.
Description
•