Bug 157519

Summary: Use the MathOperator to handle some non-stretchy 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: alex, bfulgham, cfleizach, commit-queue, darin, dbarton, esprehn+autocc, glenn, kondapallykalyan, mrobinson, rego, svillar
Priority: P2    
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on: 152244, 156836    
Bug Blocks: 155018, 157521, 157568    
Attachments:
Description Flags
Patch
none
Patch for EWS testing
buildbot: commit-queue-
Archive of layout-test-results from ews123 for ios-simulator-wk2
none
Patch for EWS testing
buildbot: commit-queue-
Archive of layout-test-results from ews121 for ios-simulator-wk2
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch bfulgham: review+

Description Frédéric Wang (:fredw) 2016-05-10 08:39:44 PDT
This preliminary step for bug 155018. The goal is to get rid of the fact that RenderMathMLToken/RenderMathMLOperator destroy & recreate an anonymous text node. We will thus use MathOperator to handle the following cases:

    // 1) Stretchy and large operators, since they require special painting.
    // 2) The minus sign, since it can be obtained from a hyphen in the DOM.
    // 3) The anonymous operators created by mfenced, since they do not have text content in the DOM.

Note that for 3) this removes support for the edge cases of open/close operators with multiple characters like <mfenced open="ABC" close="DEF">. Not a big problem, since that case is not used at all in practice and we will probably have to remove/rewrite mfenced in the long term.
Comment 1 Frédéric Wang (:fredw) 2016-05-10 09:04:24 PDT
Created attachment 278498 [details]
Patch
Comment 2 Frédéric Wang (:fredw) 2016-05-11 01:13:12 PDT
Created attachment 278601 [details]
Patch for EWS testing
Comment 3 Build Bot 2016-05-11 02:11:01 PDT
Comment on attachment 278601 [details]
Patch for EWS testing

Attachment 278601 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/1302674

New failing tests:
mathml/radical-fallback.html
mathml/opentype/opentype-stretchy.html
mathml/presentation/roots.xhtml
mathml/opentype/horizontal-munderover.html
Comment 4 Build Bot 2016-05-11 02:11:03 PDT
Created attachment 278603 [details]
Archive of layout-test-results from ews123 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews123  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.4
Comment 5 Frédéric Wang (:fredw) 2016-05-11 05:04:40 PDT
Created attachment 278618 [details]
Patch for EWS testing
Comment 6 Build Bot 2016-05-11 06:02:12 PDT
Comment on attachment 278618 [details]
Patch for EWS testing

Attachment 278618 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/1303543

New failing tests:
mathml/radical-fallback.html
mathml/opentype/opentype-stretchy.html
mathml/opentype/horizontal-munderover.html
Comment 7 Build Bot 2016-05-11 06:02:15 PDT
Created attachment 278619 [details]
Archive of layout-test-results from ews121 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews121  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.4
Comment 8 Frédéric Wang (:fredw) 2016-05-11 06:06:28 PDT
Created attachment 278620 [details]
Patch
Comment 9 Frédéric Wang (:fredw) 2016-05-11 06:13:53 PDT
Created attachment 278621 [details]
Patch
Comment 10 Frédéric Wang (:fredw) 2016-05-11 09:45:33 PDT
Created attachment 278629 [details]
Patch
Comment 11 Frédéric Wang (:fredw) 2016-06-17 07:49:10 PDT
Created attachment 281564 [details]
Patch
Comment 12 Frédéric Wang (:fredw) 2016-06-17 07:55:21 PDT
It looks like we don't need to wait the RenderMathMLRoot refactoring before taking this patch.
Comment 13 Brent Fulgham 2016-06-17 09:19:04 PDT
Comment on attachment 281564 [details]
Patch

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

I think this change looks good, but I'm not sure if I understand the reasons multiple-character support was removed from mfenced. Could you please explain this a bit more completely?

Otherwise, this looks good.

> Source/WebCore/ChangeLog:8
> +        To prepare removal of anonymous text node from RenderMathMLOperator/RenderMathMLToken,

"To prepare for the removal of ..."

> Source/WebCore/ChangeLog:11
> +        edge case of mfenced operators with multiple characters.

I'm not sure I understand this change. Are mfenced operators not specified to support multiple characters?
(a) If we are breaking spec here, I don't think we should make this change.
(b) If the spec is unclear, we may be okay.
(c) If the intent is to re-add support for mfenced operators with multiple characters in a future patch, could you please reference the Bugzilla for that change here?

> Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp:362
> +        return Optional<int>(static_cast<int>(lroundf(m_mathOperator.ascent())));

I think we should use std::lround(m_mathOperator.ascent()). You might need to add an #include <cmath>.
Comment 14 Frédéric Wang (:fredw) 2016-06-20 05:03:57 PDT
Created attachment 281644 [details]
Patch
Comment 15 Brent Fulgham 2016-06-20 09:18:01 PDT
Comment on attachment 281644 [details]
Patch

Looks great! Thanks for all of this MathML work.
Comment 16 Frédéric Wang (:fredw) 2016-06-20 23:28:55 PDT
Committed r202271: <http://trac.webkit.org/changeset/202271>