mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 848725 - limited the scale factors at the end of nsMathMLChar::StretchInternal and added crashtests. r=fredw.
This commit is contained in:
parent
ce5226a69f
commit
146c702167
17
layout/mathml/crashtests/848725-1.html
Normal file
17
layout/mathml/crashtests/848725-1.html
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Bug 848725</title>
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div>
|
||||||
|
<math>
|
||||||
|
<mover>
|
||||||
|
<mo>↠</mo>
|
||||||
|
<mspace width="500px"></mspace>
|
||||||
|
</mover>
|
||||||
|
</math>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
17
layout/mathml/crashtests/848725-2.html
Normal file
17
layout/mathml/crashtests/848725-2.html
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Bug 848725</title>
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div>
|
||||||
|
<math>
|
||||||
|
<mover>
|
||||||
|
<mo>↡</mo>
|
||||||
|
<mspace height="500px"></mspace>
|
||||||
|
</mover>
|
||||||
|
</math>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -60,3 +60,5 @@ load 713606-1.html
|
|||||||
load 716349-1.html
|
load 716349-1.html
|
||||||
load 947557-1.html
|
load 947557-1.html
|
||||||
test-pref(layout.css.sticky.enabled,true) load 973322-1.xhtml
|
test-pref(layout.css.sticky.enabled,true) load 973322-1.xhtml
|
||||||
|
load 848725-1.html
|
||||||
|
load 848725-2.html
|
||||||
|
@ -34,6 +34,10 @@ using namespace mozilla;
|
|||||||
|
|
||||||
//#define NOISY_SEARCH 1
|
//#define NOISY_SEARCH 1
|
||||||
|
|
||||||
|
// BUG 848725 Drawing failure with stretchy horizontal parenthesis when no fonts
|
||||||
|
// are installed. "kMaxScaleFactor" is required to limit the scale for the
|
||||||
|
// vertical and horizontal stretchy operators.
|
||||||
|
static const float kMaxScaleFactor = 20.0;
|
||||||
static const float kLargeOpFactor = float(M_SQRT2);
|
static const float kLargeOpFactor = float(M_SQRT2);
|
||||||
static const float kIntegralFactor = 2.0;
|
static const float kIntegralFactor = 2.0;
|
||||||
|
|
||||||
@ -1663,8 +1667,8 @@ nsMathMLChar::StretchInternal(nsPresContext* aPresContext,
|
|||||||
if (stretchy) {
|
if (stretchy) {
|
||||||
if (isVertical) {
|
if (isVertical) {
|
||||||
float scale =
|
float scale =
|
||||||
float(aContainerSize.ascent + aContainerSize.descent) /
|
std::min(kMaxScaleFactor, float(aContainerSize.ascent + aContainerSize.descent) /
|
||||||
(aDesiredStretchSize.ascent + aDesiredStretchSize.descent);
|
(aDesiredStretchSize.ascent + aDesiredStretchSize.descent));
|
||||||
if (!largeop || scale > 1.0) {
|
if (!largeop || scale > 1.0) {
|
||||||
// make the character match the desired height.
|
// make the character match the desired height.
|
||||||
if (!maxWidth) {
|
if (!maxWidth) {
|
||||||
@ -1675,8 +1679,8 @@ nsMathMLChar::StretchInternal(nsPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
float scale =
|
float scale =
|
||||||
float(aContainerSize.rightBearing - aContainerSize.leftBearing) /
|
std::min(kMaxScaleFactor, float(aContainerSize.rightBearing - aContainerSize.leftBearing) /
|
||||||
(aDesiredStretchSize.rightBearing - aDesiredStretchSize.leftBearing);
|
(aDesiredStretchSize.rightBearing - aDesiredStretchSize.leftBearing));
|
||||||
if (!largeop || scale > 1.0) {
|
if (!largeop || scale > 1.0) {
|
||||||
// make the character match the desired width.
|
// make the character match the desired width.
|
||||||
if (!maxWidth) {
|
if (!maxWidth) {
|
||||||
|
Loading…
Reference in New Issue
Block a user