Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Invisible Operators should not add space.
https://bugs.webkit.org/show_bug.cgi?id=115786 Reviewed by Chris Fleizach. Source/WebCore: This change adds special handling for invisible operator to ensure they really behave as empty box. We now ignore their glyph widths and do not paint them. Test: mathml/presentation/mo-invisible.html * rendering/mathml/RenderMathMLOperator.cpp: (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): (WebCore::RenderMathMLOperator::paint): * rendering/mathml/RenderMathMLOperator.h: LayoutTests: Add a reftest based on the examples of the MathML specification to verify that invisible operators do not add space. * mathml/presentation/mo-invisible-expected.html: Added. * mathml/presentation/mo-invisible.html: Added. Canonical link: https://commits.webkit.org/148076@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@165464 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
7 changed files
with
154 additions
and
3 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
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
@@ -0,0 +1,56 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>invisible operators</title> | ||
<meta charset="utf-8"/> | ||
</head> | ||
<body> | ||
|
||
<math> | ||
<mrow> | ||
<mi>f</mi> | ||
<mo lspace="0em" rspace="0em"></mo> | ||
<mrow> | ||
<mo>(</mo> | ||
<mi>x</mi> | ||
<mo>)</mo> | ||
</mrow> | ||
</mrow> | ||
</math> | ||
<math> | ||
<mrow> | ||
<mi>sin</mi> | ||
<mo lspace="0em" rspace="0em"></mo> | ||
<mi>x</mi> | ||
</mrow> | ||
</math> | ||
<math> | ||
<mrow> | ||
<mi>x</mi> | ||
<mo lspace="0em" rspace="0em"></mo> | ||
<mi>y</mi> | ||
</mrow> | ||
</math> | ||
<math> | ||
<msub> | ||
<mi>m</mi> | ||
<mrow> | ||
<mn>1</mn> | ||
<mo lspace="0em" rspace="0em"></mo> | ||
<mn>2</mn> | ||
</mrow> | ||
</msub> | ||
</math> | ||
<math> | ||
<mrow> | ||
<mn>2</mn> | ||
<mo lspace="0em" rspace="0em"></mo> | ||
<mfrac> | ||
<mn>3</mn> | ||
<mn>4</mn> | ||
</mfrac> | ||
</mrow> | ||
</math> | ||
|
||
</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
@@ -0,0 +1,58 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>invisible operators</title> | ||
<meta charset="utf-8"/> | ||
</head> | ||
<body> | ||
|
||
<!-- These examples are taken from http://www.w3.org/TR/MathML/chapter3.html#presm.invisibleops. | ||
The invisible operator glyphs should render as empty box and, per the operator dictionary, should not have space around them. --> | ||
<math> | ||
<mrow> | ||
<mi>f</mi> | ||
<mo>⁡<!--FUNCTION APPLICATION--></mo> | ||
<mrow> | ||
<mo>(</mo> | ||
<mi>x</mi> | ||
<mo>)</mo> | ||
</mrow> | ||
</mrow> | ||
</math> | ||
<math> | ||
<mrow> | ||
<mi>sin</mi> | ||
<mo>⁡<!--FUNCTION APPLICATION--></mo> | ||
<mi>x</mi> | ||
</mrow> | ||
</math> | ||
<math> | ||
<mrow> | ||
<mi>x</mi> | ||
<mo>⁢<!--INVISIBLE TIMES--></mo> | ||
<mi>y</mi> | ||
</mrow> | ||
</math> | ||
<math> | ||
<msub> | ||
<mi>m</mi> | ||
<mrow> | ||
<mn>1</mn> | ||
<mo>⁣<!--INVISIBLE SEPARATOR--></mo> | ||
<mn>2</mn> | ||
</mrow> | ||
</msub> | ||
</math> | ||
<math> | ||
<mrow> | ||
<mn>2</mn> | ||
<mo>⁤<!-- INVISIBLE PLUS --></mo> | ||
<mfrac> | ||
<mn>3</mn> | ||
<mn>4</mn> | ||
</mfrac> | ||
</mrow> | ||
</math> | ||
|
||
</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
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