Bug 1011020 - Add the ability to fall back to not snapping, if snapping results in a zero area rect r=roc - relanding with correct bug number on a CLOSED TREE

This commit is contained in:
James Kitchener 2015-10-05 05:00:00 +02:00
Родитель 903a88eacc
Коммит 590b916a4a
23 изменённых файлов: 920 добавлений и 8 удалений

Просмотреть файл

@ -352,9 +352,14 @@ extern UserDataKey sDisablePixelSnapping;
* boundaries.) If on the other hand you stroking the rect with an odd valued
* stroke width then the edges of the stroke will be antialiased (assuming an
* AntialiasMode that does antialiasing).
*
* Empty snaps are those which result in a rectangle of 0 area. If they are
* disallowed, an axis is left unsnapped if the rounding process results in a
* length of 0.
*/
inline bool UserToDevicePixelSnapped(Rect& aRect, const DrawTarget& aDrawTarget,
bool aAllowScaleOr90DegreeRotate = false)
bool aAllowScaleOr90DegreeRotate = false,
bool aAllowEmptySnaps = true)
{
if (aDrawTarget.GetUserData(&sDisablePixelSnapping)) {
return false;
@ -383,8 +388,18 @@ inline bool UserToDevicePixelSnapped(Rect& aRect, const DrawTarget& aDrawTarget,
// We actually only need to check one of p2 and p4, since an affine
// transform maps parallelograms to parallelograms.
if (p2 == Point(p1.x, p3.y) || p2 == Point(p3.x, p1.y)) {
p1.Round();
p3.Round();
Point p1r = p1;
Point p3r = p3;
p1r.Round();
p3r.Round();
if (aAllowEmptySnaps || p1r.x != p3r.x) {
p1.x = p1r.x;
p3.x = p3r.x;
}
if (aAllowEmptySnaps || p1r.y != p3r.y) {
p1.y = p1r.y;
p3.y = p3r.y;
}
aRect.MoveTo(Point(std::min(p1.x, p3.x), std::min(p1.y, p3.y)));
aRect.SizeTo(Size(std::max(p1.x, p3.x) - aRect.X(),
@ -400,10 +415,11 @@ inline bool UserToDevicePixelSnapped(Rect& aRect, const DrawTarget& aDrawTarget,
* aRect is not transformed to device space.
*/
inline bool MaybeSnapToDevicePixels(Rect& aRect, const DrawTarget& aDrawTarget,
bool aAllowScaleOr90DegreeRotate = false)
bool aAllowScaleOr90DegreeRotate = false,
bool aAllowEmptySnaps = true)
{
if (UserToDevicePixelSnapped(aRect, aDrawTarget,
aAllowScaleOr90DegreeRotate)) {
aAllowScaleOr90DegreeRotate, aAllowEmptySnaps)) {
// Since UserToDevicePixelSnapped returned true we know there is no
// rotation/skew in 'mat', so we can just use TransformBounds() here.
Matrix mat = aDrawTarget.GetTransform();

Просмотреть файл

@ -8101,6 +8101,20 @@ Rect NSRectToSnappedRect(const nsRect& aRect, double aAppUnitsPerPixel,
MaybeSnapToDevicePixels(rect, aSnapDT, true);
return rect;
}
// Similar to a snapped rect, except an axis is left unsnapped if the snapping
// process results in a length of 0.
Rect NSRectToNonEmptySnappedRect(const nsRect& aRect, double aAppUnitsPerPixel,
const gfx::DrawTarget& aSnapDT)
{
// Note that by making aAppUnitsPerPixel a double we're doing floating-point
// division using a larger type and avoiding rounding error.
Rect rect(Float(aRect.x / aAppUnitsPerPixel),
Float(aRect.y / aAppUnitsPerPixel),
Float(aRect.width / aAppUnitsPerPixel),
Float(aRect.height / aAppUnitsPerPixel));
MaybeSnapToDevicePixels(rect, aSnapDT, true, false);
return rect;
}
void StrokeLineWithSnapping(const nsPoint& aP1, const nsPoint& aP2,
int32_t aAppUnitsPerDevPixel,

Просмотреть файл

@ -2860,6 +2860,17 @@ gfx::Rect NSRectToRect(const nsRect& aRect, double aAppUnitsPerPixel);
gfx::Rect NSRectToSnappedRect(const nsRect& aRect, double aAppUnitsPerPixel,
const gfx::DrawTarget& aSnapDT);
/**
* Converts, where possible, an nsRect in app units to a Moz2D Rect in pixels
* (whether those are device pixels or CSS px depends on what the caller
* chooses to pass as aAppUnitsPerPixel).
*
* If snapping results in a rectangle with zero width or height, the affected
* coordinates are left unsnapped
*/
gfx::Rect NSRectToNonEmptySnappedRect(const nsRect& aRect, double aAppUnitsPerPixel,
const gfx::DrawTarget& aSnapDT);
void StrokeLineWithSnapping(const nsPoint& aP1, const nsPoint& aP2,
int32_t aAppUnitsPerDevPixel,
gfx::DrawTarget& aDrawTarget,

Просмотреть файл

@ -363,7 +363,8 @@ void nsDisplayMathMLBar::Paint(nsDisplayListBuilder* aBuilder,
{
// paint the bar with the current text color
DrawTarget* drawTarget = aCtx->GetDrawTarget();
Rect rect = NSRectToSnappedRect(mRect + ToReferenceFrame(),
Rect rect =
NSRectToNonEmptySnappedRect(mRect + ToReferenceFrame(),
mFrame->PresContext()->AppUnitsPerDevPixel(),
*drawTarget);
ColorPattern color(ToDeviceColor(

Просмотреть файл

@ -0,0 +1,48 @@
<!doctype html>
<html>
<head>
<!-- Default to invisible text -->
<style type="text/css" media="screen, print">
.hidden {
color: white;
}
.visible {
color: black;
}
</style>
</head>
<body>
<!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
Because the comparison is for inequality with about:blank, at most one can be visible -->
<math>
<mrow>
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="visible">
<mspace width="20em" height="1em" />
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</mrow>
</math>
<!-- Block out all but the horizontal bar of the visible radical -->
<div style="position: absolute; top: 5px; left: 0px;
width: 20em; height: 10em; background: white;"></div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,48 @@
<!doctype html>
<html reftest-zoom=".5">
<head>
<!-- Default to invisible text -->
<style type="text/css" media="screen, print">
.hidden {
color: white;
}
.visible {
color: black;
}
</style>
</head>
<body>
<!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
Because the comparison is for inequality with about:blank, at most one can be visible -->
<math>
<mrow>
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="visible">
<mspace width="20em" height="1em" />
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</mrow>
</math>
<!-- Block out all but the horizontal bar of the visible radical -->
<div style="position: absolute; top: 5px; left: 0px;
width: 20em; height: 10em; background: white;"></div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,48 @@
<!doctype html>
<html reftest-zoom=".4">
<head>
<!-- Default to invisible text -->
<style type="text/css" media="screen, print">
.hidden {
color: white;
}
.visible {
color: black;
}
</style>
</head>
<body>
<!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
Because the comparison is for inequality with about:blank, at most one can be visible -->
<math>
<mrow>
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="visible">
<mspace width="20em" height="1em" />
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</mrow>
</math>
<!-- Block out all but the horizontal bar of the visible radical -->
<div style="position: absolute; top: 5px; left: 0px;
width: 20em; height: 10em; background: white;"></div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,48 @@
<!doctype html>
<html reftest-zoom=".3">
<head>
<!-- Default to invisible text -->
<style type="text/css" media="screen, print">
.hidden {
color: white;
}
.visible {
color: black;
}
</style>
</head>
<body>
<!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
Because the comparison is for inequality with about:blank, at most one can be visible -->
<math>
<mrow>
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="visible">
<mspace width="20em" height="1em" />
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</mrow>
</math>
<!-- Block out all but the horizontal bar of the visible radical -->
<div style="position: absolute; top: 5px; left: 0px;
width: 20em; height: 10em; background: white;"></div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,48 @@
<!doctype html>
<html reftest-zoom=".2">
<head>
<!-- Default to invisible text -->
<style type="text/css" media="screen, print">
.hidden {
color: white;
}
.visible {
color: black;
}
</style>
</head>
<body>
<!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
Because the comparison is for inequality with about:blank, at most one can be visible -->
<math>
<mrow>
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="visible">
<mspace width="20em" height="1em" />
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</mrow>
</math>
<!-- Block out all but the horizontal bar of the visible radical -->
<div style="position: absolute; top: 5px; left: 0px;
width: 20em; height: 10em; background: white;"></div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,48 @@
<!doctype html>
<html reftest-zoom=".1">
<head>
<!-- Default to invisible text -->
<style type="text/css" media="screen, print">
.hidden {
color: white;
}
.visible {
color: black;
}
</style>
</head>
<body>
<!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
Because the comparison is for inequality with about:blank, at most one can be visible -->
<math>
<mrow>
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="visible">
<mspace width="20em" height="1em" />
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</mrow>
</math>
<!-- Block out all but the horizontal bar of the visible radical -->
<div style="position: absolute; top: 5px; left: 0px;
width: 20em; height: 10em; background: white;"></div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,47 @@
<!doctype html>
<html>
<head>
<!-- Default to invisible text -->
<style type="text/css" media="screen, print">
.hidden {
color: white;
}
.visible {
color: black;
}
</style>
</head>
<body>
<!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
Because the comparison is for inequality with about:blank, at most one can be visible -->
<math>
<mrow>
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="visible">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="20em" height="1em" />
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</mrow>
</math>
<!-- Block out all but the horizontal bar of the visible radical -->
<div style="position: absolute; top: 5px; left: 0px;
width: 20em; height: 10em; background: white;"></div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,47 @@
<!doctype html>
<html reftest-zoom="0.5">
<head>
<!-- Default to invisible text -->
<style type="text/css" media="screen, print">
.hidden {
color: white;
}
.visible {
color: black;
}
</style>
</head>
<body>
<!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
Because the comparison is for inequality with about:blank, at most one can be visible -->
<math>
<mrow>
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="visible">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="20em" height="1em" />
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</mrow>
</math>
<!-- Block out all but the horizontal bar of the visible radical -->
<div style="position: absolute; top: 5px; left: 0px;
width: 20em; height: 10em; background: white;"></div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,47 @@
<!doctype html>
<html reftest-zoom="0.4">
<head>
<!-- Default to invisible text -->
<style type="text/css" media="screen, print">
.hidden {
color: white;
}
.visible {
color: black;
}
</style>
</head>
<body>
<!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
Because the comparison is for inequality with about:blank, at most one can be visible -->
<math>
<mrow>
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="visible">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="20em" height="1em" />
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</mrow>
</math>
<!-- Block out all but the horizontal bar of the visible radical -->
<div style="position: absolute; top: 5px; left: 0px;
width: 20em; height: 10em; background: white;"></div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,47 @@
<!doctype html>
<html reftest-zoom="0.3">
<head>
<!-- Default to invisible text -->
<style type="text/css" media="screen, print">
.hidden {
color: white;
}
.visible {
color: black;
}
</style>
</head>
<body>
<!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
Because the comparison is for inequality with about:blank, at most one can be visible -->
<math>
<mrow>
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="visible">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="20em" height="1em" />
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</mrow>
</math>
<!-- Block out all but the horizontal bar of the visible radical -->
<div style="position: absolute; top: 5px; left: 0px;
width: 20em; height: 10em; background: white;"></div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,47 @@
<!doctype html>
<html reftest-zoom="0.2">
<head>
<!-- Default to invisible text -->
<style type="text/css" media="screen, print">
.hidden {
color: white;
}
.visible {
color: black;
}
</style>
</head>
<body>
<!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
Because the comparison is for inequality with about:blank, at most one can be visible -->
<math>
<mrow>
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="visible">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="20em" height="1em" />
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</mrow>
</math>
<!-- Block out all but the horizontal bar of the visible radical -->
<div style="position: absolute; top: 5px; left: 0px;
width: 20em; height: 10em; background: white;"></div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,47 @@
<!doctype html>
<html reftest-zoom="0.1">
<head>
<!-- Default to invisible text -->
<style type="text/css" media="screen, print">
.hidden {
color: white;
}
.visible {
color: black;
}
</style>
</head>
<body>
<!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
Because the comparison is for inequality with about:blank, at most one can be visible -->
<math>
<mrow>
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="visible">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="20em" height="1em" />
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</mrow>
</math>
<!-- Block out all but the horizontal bar of the visible radical -->
<div style="position: absolute; top: 5px; left: 0px;
width: 20em; height: 10em; background: white;"></div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,47 @@
<!doctype html>
<html>
<head>
<!-- Default to invisible text -->
<style type="text/css" media="screen, print">
.hidden {
color: white;
}
.visible {
color: black;
}
</style>
</head>
<body>
<!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
Because the comparison is for inequality with about:blank, at most one can be visible -->
<math>
<mrow>
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="visible">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="20em" height="1em" />
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</mrow>
</math>
<!-- Block out all but the horizontal bar of the visible radical -->
<div style="position: absolute; top: 5px; left: 0px;
width: 20em; height: 10em; background: white;"></div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,47 @@
<!doctype html>
<html reftest-zoom="0.5">
<head>
<!-- Default to invisible text -->
<style type="text/css" media="screen, print">
.hidden {
color: white;
}
.visible {
color: black;
}
</style>
</head>
<body>
<!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
Because the comparison is for inequality with about:blank, at most one can be visible -->
<math>
<mrow>
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="visible">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="20em" height="1em" />
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</mrow>
</math>
<!-- Block out all but the horizontal bar of the visible radical -->
<div style="position: absolute; top: 5px; left: 0px;
width: 20em; height: 10em; background: white;"></div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,47 @@
<!doctype html>
<html reftest-zoom="0.4">
<head>
<!-- Default to invisible text -->
<style type="text/css" media="screen, print">
.hidden {
color: white;
}
.visible {
color: black;
}
</style>
</head>
<body>
<!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
Because the comparison is for inequality with about:blank, at most one can be visible -->
<math>
<mrow>
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="visible">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="20em" height="1em" />
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</mrow>
</math>
<!-- Block out all but the horizontal bar of the visible radical -->
<div style="position: absolute; top: 5px; left: 0px;
width: 20em; height: 10em; background: white;"></div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,47 @@
<!doctype html>
<html reftest-zoom="0.3">
<head>
<!-- Default to invisible text -->
<style type="text/css" media="screen, print">
.hidden {
color: white;
}
.visible {
color: black;
}
</style>
</head>
<body>
<!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
Because the comparison is for inequality with about:blank, at most one can be visible -->
<math>
<mrow>
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="visible">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="20em" height="1em" />
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</mrow>
</math>
<!-- Block out all but the horizontal bar of the visible radical -->
<div style="position: absolute; top: 5px; left: 0px;
width: 20em; height: 10em; background: white;"></div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,47 @@
<!doctype html>
<html reftest-zoom="0.2">
<head>
<!-- Default to invisible text -->
<style type="text/css" media="screen, print">
.hidden {
color: white;
}
.visible {
color: black;
}
</style>
</head>
<body>
<!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
Because the comparison is for inequality with about:blank, at most one can be visible -->
<math>
<mrow>
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="visible">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="20em" height="1em" />
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</mrow>
</math>
<!-- Block out all but the horizontal bar of the visible radical -->
<div style="position: absolute; top: 5px; left: 0px;
width: 20em; height: 10em; background: white;"></div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,47 @@
<!doctype html>
<html reftest-zoom="0.1">
<head>
<!-- Default to invisible text -->
<style type="text/css" media="screen, print">
.hidden {
color: white;
}
.visible {
color: black;
}
</style>
</head>
<body>
<!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
Because the comparison is for inequality with about:blank, at most one can be visible -->
<math>
<mrow>
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="visible">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="1em" height="1em" />
<msqrt class="hidden">
<mspace width="20em" height="1em" />
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</msqrt>
</mrow>
</math>
<!-- Block out all but the horizontal bar of the visible radical -->
<div style="position: absolute; top: 5px; left: 0px;
width: 20em; height: 10em; background: white;"></div>
</body>
</html>

Просмотреть файл

@ -366,3 +366,21 @@ fails-if(winWidget) == mfrac-D-2.html mfrac-D-2-ref.html
test-pref(dom.webcomponents.enabled,true) == shadow-dom-1.html shadow-dom-1-ref.html
pref(font.size.inflation.emPerLine,25) == font-inflation-1.html font-inflation-1-ref.html
test-pref(font.minimum-size.x-math,40) == default-font.html default-font-ref.html
!= radicalbar-1.html about:blank
!= radicalbar-1a.html about:blank
!= radicalbar-1b.html about:blank
!= radicalbar-1c.html about:blank
!= radicalbar-1d.html about:blank
!= radicalbar-1e.html about:blank
!= radicalbar-2.html about:blank
!= radicalbar-2a.html about:blank
!= radicalbar-2b.html about:blank
!= radicalbar-2c.html about:blank
!= radicalbar-2d.html about:blank
!= radicalbar-2e.html about:blank
!= radicalbar-3.html about:blank
!= radicalbar-3a.html about:blank
!= radicalbar-3b.html about:blank
!= radicalbar-3c.html about:blank
!= radicalbar-3d.html about:blank
!= radicalbar-3e.html about:blank