-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bad position of large operators inside an munderover element
https://bugs.webkit.org/show_bug.cgi?id=151916 Reviewed by Alejandro G. Castro. Source/WebCore: Test: mathml/opentype/large-operators-munderover.html * rendering/mathml/RenderMathMLOperator.h: (WebCore::RenderMathMLOperator::isVertical): Expose the direction of the operator. * rendering/mathml/RenderMathMLUnderOver.cpp: (WebCore::RenderMathMLUnderOver::layout): Remove call to horizontal stretching for vertical operators. LayoutTests: * mathml/opentype/large-operators-munderover-expected.txt: Added. * mathml/opentype/large-operators-munderover.html: Added. Add a test to verify the position and size of a large operator used as an munderover base. Canonical link: https://commits.webkit.org/170204@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@193829 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
6 changed files
with
92 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
LayoutTests/mathml/opentype/large-operators-munderover-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
This test passes if you see a large black square with a green bar overscript and a red bar underscript. | ||
|
||
largeop width: PASS | ||
largeop height: PASS | ||
green bar is above: PASS | ||
red bar is below: PASS | ||
|
54 changes: 54 additions & 0 deletions
54
LayoutTests/mathml/opentype/large-operators-munderover.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>Large Operator Munderover</title> | ||
<meta charset="utf-8"/> | ||
<style type="text/css"> | ||
/* This font is taken from Mozilla's test suite. */ | ||
@font-face { | ||
font-family: stretchy; | ||
src: url("stretchy.woff"); | ||
} | ||
math { | ||
font-family: stretchy; | ||
} | ||
</style> | ||
<script> | ||
var result; | ||
var epsilon = 1; | ||
function almostEqual(x, y) { | ||
return Math.abs(x - y) < epsilon; | ||
} | ||
function assert(text, condition) { | ||
result += text + ": " + (condition ? "PASS" : "FAIL") + "\n"; | ||
} | ||
function test() { | ||
result = ""; | ||
// font em is 1024, size of glyph L8 is 8389 and font-size is 16px | ||
var largeop = document.getElementById("largeop").getBoundingClientRect(); | ||
var green = document.getElementById("green").getBoundingClientRect(); | ||
var red = document.getElementById("red").getBoundingClientRect(); | ||
var size = (8389/1024)*16; | ||
|
||
assert("largeop width", almostEqual(largeop.width, size)); | ||
assert("largeop height", almostEqual(largeop.height, size)); | ||
assert("green bar is above", green.bottom <= largeop.top); | ||
assert("red bar is below", red.top >= largeop.bottom); | ||
document.getElementById("result").innerText = result; | ||
if (window.testRunner) | ||
testRunner.dumpAsText(); | ||
} | ||
</script> | ||
</head> | ||
<body onload="test()"> | ||
<p>This test passes if you see a large black square with a green bar overscript and a red bar underscript.</p> | ||
<math display="block"> | ||
<munderover> | ||
<mo id="largeop" lspace="0px" rspace="0px" style="font-size: 16px;" >⨜</mo> | ||
<mspace id="red" width="200px" height="10px" depth="10px" mathbackground="red"/> | ||
<mspace id="green" width="250px" height="10px" depth="10px" mathbackground="green"/> | ||
</munderover> | ||
</math> | ||
<div id="result"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters