Bug 179681 - Cleanup code for RenderMathMLUnderOver::layoutBlock
Summary: Cleanup code for RenderMathMLUnderOver::layoutBlock
Alias: None
Product: WebKit
Classification: Unclassified
Component: MathML (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified All
: P2 Normal
Assignee: Minsheng Liu
Keywords: InRadar
Depends on:
Reported: 2017-11-14 11:16 PST by Minsheng Liu
Modified: 2018-01-04 01:58 PST (History)
4 users (show)

See Also:

Patch (3.12 KB, patch)
2017-11-26 12:59 PST, Minsheng Liu
no flags Details | Formatted Diff | Diff
Patch (3.27 KB, patch)
2017-11-26 13:04 PST, Minsheng Liu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Minsheng Liu 2017-11-14 11:16:41 PST
See the discussion of https://bugs.webkit.org/show_bug.cgi?id=170272.

> Checking the code, it seems that RenderMathMLUnderOver::computeOperatorsHorizontalStretch is actually only called in RenderMathMLUnderOver::layoutBlock, just before some calls to layoutIfNeeded() on the munderover children... but I believe these layoutIfNeeded calls are useless as we already do the layout in computeOperatorsHorizontalStretch. Also, computeOperatorsHorizontalStretch really does operator stretching and child layout, so the name is not good (I guess this was inherited from old implementation). So I propose you open a preliminary cleanup bug to rename "computeOperatorsHorizontalStretch" to "stretchHorizontalOperatorsAndLayoutChildren" and remove the useless layoutIfNeeded calls, so that things are a bit clearer. That won't require new tests and you would be able to experience the contribution process.
Comment 1 Frédéric Wang (:fredw) 2017-11-14 23:47:50 PST
So more precisely, I was proposing:

1. Rename "computeOperatorsHorizontalStretch" to "stretchHorizontalOperatorsAndLayoutChildren".
2. Replace layoutIfNeeded() calls in RenderMathMLUnderOver::layoutBlock() with:
   ASSERT(m_scriptType == Over || !under().needsLayout());
   ASSERT(m_scriptType == Under || !over().needsLayout());
Comment 2 Minsheng Liu 2017-11-26 12:59:44 PST
Created attachment 327588 [details]
Comment 3 EWS Watchlist 2017-11-26 13:01:44 PST
Attachment 327588 [details] did not pass style-queue:

ERROR: Source/WebCore/ChangeLog:8:  You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible.  [changelog/nonewtests] [5]
Total errors found: 1 in 3 files

If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Minsheng Liu 2017-11-26 13:04:25 PST
Created attachment 327589 [details]
Comment 5 Frédéric Wang (:fredw) 2017-11-26 13:53:37 PST
Comment on attachment 327589 [details]

Comment 6 WebKit Commit Bot 2017-11-26 14:13:12 PST
Comment on attachment 327589 [details]

Clearing flags on attachment: 327589

Committed r225148: <https://trac.webkit.org/changeset/225148>
Comment 7 WebKit Commit Bot 2017-11-26 14:13:13 PST
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2017-11-26 14:14:25 PST