Bug 115787 - Implement MathML spacing around operators
Summary: Implement MathML spacing around operators
Alias: None
Product: WebKit
Classification: Unclassified
Component: MathML (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Frédéric Wang (:fredw)
Keywords: WebExposed
: 118843 (view as bug list)
Depends on: 99620 124838
Blocks: mathml-in-mathjax 115786 115789 129366
  Show dependency treegraph
Reported: 2013-05-08 03:01 PDT by Frédéric Wang (:fredw)
Modified: 2014-03-11 23:47 PDT (History)
13 users (show)

See Also:

Patch (23.36 KB, patch)
2014-02-21 08:35 PST, Frédéric Wang (:fredw)
no flags Details | Formatted Diff | Diff
Patch (42.88 KB, patch)
2014-02-21 15:11 PST, Frédéric Wang (:fredw)
no flags Details | Formatted Diff | Diff
Patch (43.15 KB, patch)
2014-03-06 08:53 PST, Frédéric Wang (:fredw)
no flags Details | Formatted Diff | Diff
Patch (43.03 KB, patch)
2014-03-11 01:00 PDT, Frédéric Wang (:fredw)
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-16 for mac-mountainlion-wk2 (510.17 KB, application/zip)
2014-03-11 02:04 PDT, Build Bot
no flags Details
Patch (70.67 KB, patch)
2014-03-11 02:12 PDT, Frédéric Wang (:fredw)
cfleizach: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frédéric Wang (:fredw) 2013-05-08 03:01:50 PDT
The WebCore/css/mathml.css stylesheet contains the following comment:

/* FIXME: For a RenderMathMLOperator's margin-start and margin-end, or for a MathML "embellished operator", check the operator's lspace and rspace attributes,
   and the MathML operator dictionary. */
math > mo, mrow > mo, msqrt > mo, mtd > mo {
    -webkit-margin-start: 0.2em;
    -webkit-margin-end: 0.2em;

basically, we always add .2em before and after the <mo> element. We should use the default lspace/rspace values given in MathML operator dictionary instead:


which are multiple of 1/18em:


Also, the we could use the lspace/rspace attribute valus when specified:


In theory, the spacing should be added to around the whole embellished operators not necessarily to the core mo, but I'm not sure how much Webkit implements about the embellished operator hierarchy.
Comment 1 Frédéric Wang (:fredw) 2013-07-18 03:39:14 PDT
This should be fixed for mfenced too (bug 118843).
Comment 2 Frédéric Wang (:fredw) 2014-02-20 05:44:31 PST
Important: remember to take the tests from attachment 217787 [details] that were not included in the final patch of bug 99620.
Comment 3 Frédéric Wang (:fredw) 2014-02-21 08:35:27 PST
Created attachment 224871 [details]

The following tests are still failing:

Comment 4 Frédéric Wang (:fredw) 2014-02-21 15:11:34 PST
Created attachment 224915 [details]

This fixes the remaining test failures and adds new tests to verify dynamic changes.
Comment 5 Frédéric Wang (:fredw) 2014-02-21 15:12:19 PST
*** Bug 118843 has been marked as a duplicate of this bug. ***
Comment 6 Frédéric Wang (:fredw) 2014-03-06 08:53:51 PST
Created attachment 225995 [details]

Refreshing the patch and fixing a style error.
Comment 7 Frédéric Wang (:fredw) 2014-03-11 01:00:12 PDT
Created attachment 226395 [details]
Comment 8 Build Bot 2014-03-11 02:04:02 PDT
Comment on attachment 226395 [details]

Attachment 226395 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/5620794474364928

New failing tests:
Comment 9 Build Bot 2014-03-11 02:04:06 PDT
Created attachment 226398 [details]
Archive of layout-test-results from webkit-ews-16 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-16  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.5
Comment 10 Frédéric Wang (:fredw) 2014-03-11 02:12:34 PDT
Created attachment 226400 [details]

Updating the mac reference of op-stretch.html
Comment 11 chris fleizach 2014-03-11 09:33:00 PDT
Comment on attachment 226400 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=226400&action=review

> Source/WebCore/rendering/mathml/RenderMathMLRow.cpp:62
> +            auto renderOperator = toRenderMathMLBlock(child)->unembellishedOperator();

this can be inside the if block
if (auto renderOperator = toRenderMathMLBlock(child)->unembellishedOperator())
Comment 12 Frédéric Wang (:fredw) 2014-03-11 23:47:37 PDT
Committed r165461: <http://trac.webkit.org/changeset/165461>