<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[199869] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/199869">199869</a></dd>
<dt>Author</dt> <dd>fred.wang@free.fr</dd>
<dt>Date</dt> <dd>2016-04-21 22:56:39 -0700 (Thu, 21 Apr 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>More improvements and explanations regarding resetting CSS properties on the <math> element
https://bugs.webkit.org/show_bug.cgi?id=156840
Patch by Frederic Wang <fwang@igalia.com> on 2016-04-21
Reviewed by Darin Adler.
We some follow-up improvements regarding CSS rules on the <math> element, after bug 133603:
- We fix indenting to use 4 spaces.
- We explain why we set -webkit-line-box-contain and add references to related bugs.
- We explain why we reset some CSS spacing rules.
- We explain why the direction is set to ltr.
- We explain why font-family is set to a list of known math fonts and add reference
to the wiki.
- We mention the need to customize math fonts to get consistent style and add references to
a bug report and to the wiki.
- We described each of the math font listed and add some justification about their orders.
- We better explain the section about fonts that do not satisfy the requirements for good
mathematical rendering, reformulate why we still need them for iOS/Mac and we add some
references to a bug report and to the wiki. Some fonts that not pre-installed were removed
in <a href="http://trac.webkit.org/projects/webkit/changeset/199773">r199773</a>.
- We add a FIXME comments for potential changes of CSS properties on the <math> tag.
We make the following changes to the lists of font-family:
- We move "TeX Gyre Termes Math" into the Times group.
- We move "Asana Math" into the Palatino group.
- We remove iOS conditionals on "Symbol" and "Times New Roman".
No new tests, only order of math fonts that are not used by test framework is changed.
* css/mathml.css:
(math): We merge the two math selectors, reorder some font-families, remove iOS ifdef and
add more description.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssmathmlcss">trunk/Source/WebCore/css/mathml.css</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (199868 => 199869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-22 05:56:36 UTC (rev 199868)
+++ trunk/Source/WebCore/ChangeLog        2016-04-22 05:56:39 UTC (rev 199869)
</span><span class="lines">@@ -1,3 +1,37 @@
</span><ins>+2016-04-21 Frederic Wang <fwang@igalia.com>
+
+ More improvements and explanations regarding resetting CSS properties on the <math> element
+ https://bugs.webkit.org/show_bug.cgi?id=156840
+
+ Reviewed by Darin Adler.
+
+ We some follow-up improvements regarding CSS rules on the <math> element, after bug 133603:
+ - We fix indenting to use 4 spaces.
+ - We explain why we set -webkit-line-box-contain and add references to related bugs.
+ - We explain why we reset some CSS spacing rules.
+ - We explain why the direction is set to ltr.
+ - We explain why font-family is set to a list of known math fonts and add reference
+ to the wiki.
+ - We mention the need to customize math fonts to get consistent style and add references to
+ a bug report and to the wiki.
+ - We described each of the math font listed and add some justification about their orders.
+ - We better explain the section about fonts that do not satisfy the requirements for good
+ mathematical rendering, reformulate why we still need them for iOS/Mac and we add some
+ references to a bug report and to the wiki. Some fonts that not pre-installed were removed
+ in r199773.
+ - We add a FIXME comments for potential changes of CSS properties on the <math> tag.
+
+ We make the following changes to the lists of font-family:
+ - We move "TeX Gyre Termes Math" into the Times group.
+ - We move "Asana Math" into the Palatino group.
+ - We remove iOS conditionals on "Symbol" and "Times New Roman".
+
+ No new tests, only order of math fonts that are not used by test framework is changed.
+
+ * css/mathml.css:
+ (math): We merge the two math selectors, reorder some font-families, remove iOS ifdef and
+ add more description.
+
</ins><span class="cx"> 2016-04-21 Dean Jackson <dino@apple.com>
</span><span class="cx">
</span><span class="cx"> Backdrop Filter should not be visible if element has visibility:hidden
</span></span></pre></div>
<a id="trunkSourceWebCorecssmathmlcss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/mathml.css (199868 => 199869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/mathml.css        2016-04-22 05:56:36 UTC (rev 199868)
+++ trunk/Source/WebCore/css/mathml.css        2016-04-22 05:56:39 UTC (rev 199869)
</span><span class="lines">@@ -1,46 +1,103 @@
</span><span class="cx"> @namespace "http://www.w3.org/1998/Math/MathML";
</span><span class="cx">
</span><span class="cx"> math {
</span><ins>+ /*
+ We use the exact bounding boxes of glyphs to avoid excessive gaps in mathematical formulas.
+ FIXME: Should we replace this with a more general handling of ink/logical ascent/descent?
+ See http://webkit.org/b/130326, http://webkit.org/b/156841 and
+ http://www.mathml-association.org/MathMLinHTML5/S3.html#SS1.SSS1
+ */
</ins><span class="cx"> -webkit-line-box-contain: glyphs replaced;
</span><ins>+
+ /*
+ Inheriting the following properties can cause excessive spacing of mathematical formulas so we
+ just reset them to their default values.
+ */
</ins><span class="cx"> text-indent: 0;
</span><span class="cx"> line-height: normal;
</span><span class="cx"> word-spacing: normal;
</span><span class="cx"> letter-spacing: normal;
</span><ins>+
+ /*
+ In some countries and languages, text is written from right-to-left while mathematical formulas
+ are written from left-to-write. Hence it is wrong to inherit the direction and we reset that
+ property to left-to-write. Per the MathML specification, authors should explicitly use the "dir"
+ attribute on the <math> element if they want to force the overall direction of the mathematical
+ formulas.
+ */
</ins><span class="cx"> direction: ltr;
</span><ins>+
+ /* Fonts with appropriate Unicode coverage and OpenType features are required for good math
+ rendering. These requirements as well as the up-to-date list of known math fonts to fulfill
+ these requirements are listed on http://trac.webkit.org/wiki/MathML/Fonts.
+ Inheriting the font-family is likely to make MathML use text fonts that are not designed for
+ math layout and thus would cause very poor mathematical rendering. Consequently, the default
+ font-family on the <math> tag is set to a list of recommended math fonts.
+ For best rendering, authors and readers are encouraged to use text and math fonts with consistent
+ style (appearance, size...), see http://trac.webkit.org/wiki/MathML/Fonts#CustomizingMathFont
+ FIXME: Should we make math font properties configurable (http://webkit.org/b/156843)?
+ */
+ font-family:
+ /*
+ This font has Computer Modern style and is provided with most TeX & Linux distributions.
+ We put it as the default because its style is familiar to TeX, Wikipedia and math people.
+ */
+ "Latin Modern Math",
+
+ /*
+ The following fonts have Times style and are provided with most TeX & Linux distributions.
+ We put XITS & STIX as a second option because they have very good unicode coverage.
+ XITS is a fork of STIX with bug fixes and more Arabic/RTL features so we put it first.
+ */
+ "XITS Math",
+ "STIX Math",
+ "Libertinus Math",
+ "TeX Gyre Termes Math",
+
+ /*
+ These fonts respectively have style compatible with Bookman Old and Century Schoolbook.
+ They are provided with most TeX & Linux distributions.
+ */
+ "TeX Gyre Bonum Math",
+ "TeX Gyre Schola",
+
+ /*
+ The following fonts have Palatino style and are provided with most TeX & Linux distributions.
+ Asana Math has some rendering issues (e.g. missing italic correction) so we put it after.
+ */
+ "TeX Gyre Pagella Math",
+ "Asana Math",
+
+ /*
+ The following fonts are proprietary and have not much been tested so we put them at the end.
+ Cambria Math it is pre-installed on Windows 7 and higher.
+ */
+ "Cambria Math",
+ "Lucida Bright Math",
+ "Minion Math",
+
+ /*
+ The following fonts do not satisfy the requirements for good mathematical rendering.
+ These are pre-installed on Mac and iOS so we list them to provide minimal unicode-based
+ mathematical rendering. For more explanation of fallback mechanisms and missing features see
+ http://trac.webkit.org/wiki/MathML/Fonts#ObsoleteFontsandFallbackMechanisms.
+ STIX fonts have best unicode coverage so we put them first. */
+ STIXGeneral,
+ STIXSizeOneSym,
+ Symbol,
+ "Times New Roman",
+
+ /* Mathematical fonts generally use "serif" style. Hence we append the generic "serif" family
+ as a fallback in order to increase our chance to find a mathematical font. */
+ serif;
+
+ /* FIXME: Should we reset more CSS properties (http://webkit.org/b/156839)? */
</ins><span class="cx"> }
</span><span class="cx"> mtext {
</span><span class="cx"> line-height: 1.0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-/* Fonts with appropriate Unicode coverage and OpenType features are required for good math rendering.
- Consequently the default font-family on the <math> tag is not inherited but set to a list of known math fonts.
- See http://trac.webkit.org/wiki/MathML/Fonts.
- FIXME: OS X and iOS do not have such fonts pre-installed (bugs 17021145, 16841023 and 16843041 from Apple bug tracker).
- Hence we also append some system fonts to provide minimal Unicode coverage and limited operator stretching.
-*/
</del><span class="cx"> math {
</span><del>- font-family: "Latin Modern Math",
- "XITS Math",
- "STIX Math",
- "Libertinus Math",
- "TeX Gyre Bonum Math",
- "TeX Gyre Pagella Math",
- "TeX Gyre Schola",
- "TeX Gyre Termes Math",
- "Cambria Math",
- "Asana Math",
- "Lucida Bright Math",
- "Minion Math",
- STIXGeneral,
- STIXSizeOneSym,
-#if defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS
- Symbol,
- "Times New Roman",
-#endif
- serif;
-}
-
-math {
</del><span class="cx"> display: -webkit-inline-flex !important;
</span><span class="cx"> padding-left: 1px;
</span><span class="cx"> padding-right: 1px;
</span></span></pre>
</div>
</div>
</body>
</html>