Bug 115787

Summary: Implement MathML spacing around operators
Product: WebKit Reporter: Frédéric Wang (:fredw) <fred.wang>
Component: MathMLAssignee: Frédéric Wang (:fredw) <fred.wang>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, buildbot, cfleizach, commit-queue, dbarton, esprehn+autocc, glenn, gyuyoung.kim, kondapallykalyan, macpherson, menard, mrobinson, rniwa
Priority: P2 Keywords: WebExposed
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on: 99620, 124838    
Bug Blocks: 84019, 115786, 115789, 129366    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
buildbot: commit-queue-
Archive of layout-test-results from webkit-ews-16 for mac-mountainlion-wk2
none
Patch cfleizach: review+

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:

http://www.w3.org/TR/MathML/appendixc.html#oper-dict.entries-table

which are multiple of 1/18em:

http://www.w3.org/TR/MathML/appendixc.html#oper-dict.space

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

http://www.w3.org/TR/MathML/chapter3.html#presm.mo.attrs

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]
Patch

The following tests are still failing:

mathml/presentation/mo-form-minus-plus.html
mathml/presentation/mo-form.html
mathml/presentation/mo-lspace-rspace.html
Comment 4 Frédéric Wang (:fredw) 2014-02-21 15:11:34 PST
Created attachment 224915 [details]
Patch

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]
Patch

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]
Patch
Comment 8 Build Bot 2014-03-11 02:04:02 PDT
Comment on attachment 226395 [details]
Patch

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

New failing tests:
mathml/presentation/mo-stretch.html
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]
Patch

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

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>