mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 893496: Avoid doing bogus infinity*0 multiplication when producing a flex weight from huge flex-shrink and 0 flex-basis. r=mats
This commit is contained in:
parent
b4da63a774
commit
15caa9885d
12
layout/generic/crashtests/893496-1.html
Normal file
12
layout/generic/crashtests/893496-1.html
Normal file
@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<meta charset="UTF-8">
|
||||
<body>
|
||||
|
||||
<div style="display: flex;">
|
||||
<div style="padding: calc(50%);"></div>
|
||||
<div style="padding: 4px; flex: 0 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999;"></div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -514,6 +514,7 @@ needs-focus pref(accessibility.browsewithcaret,true) load 868906.html
|
||||
load 866547-1.html
|
||||
asserts(1-4) load 876074-1.html # bug 876749
|
||||
load 885009-1.html
|
||||
load 893496-1.html
|
||||
load 893523.html
|
||||
test-pref(layout.css.sticky.enabled,true) load 914891.html
|
||||
test-pref(layout.css.sticky.enabled,true) load 915475.xhtml
|
||||
|
@ -335,9 +335,19 @@ public:
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
return aIsUsingFlexGrow ?
|
||||
mFlexGrow :
|
||||
mFlexShrink * mFlexBaseSize;
|
||||
if (aIsUsingFlexGrow) {
|
||||
return mFlexGrow;
|
||||
}
|
||||
|
||||
// We're using flex-shrink --> return mFlexShrink * mFlexBaseSize
|
||||
if (mFlexBaseSize == 0) {
|
||||
// Special-case for mFlexBaseSize == 0 -- we have no room to shrink, so
|
||||
// regardless of mFlexShrink, we should just return 0.
|
||||
// (This is really a special-case for when mFlexShrink is infinity, to
|
||||
// avoid performing mFlexShrink * mFlexBaseSize = inf * 0 = undefined.)
|
||||
return 0.0f;
|
||||
}
|
||||
return mFlexShrink * mFlexBaseSize;
|
||||
}
|
||||
|
||||
// Getters for margin:
|
||||
|
Loading…
Reference in New Issue
Block a user