[mathml] Refine when legacy/NG layout is forced
This is a refinement of [1] [2] [3] [4]: 1. MathML elements should not try to force NG layout when using a non-math display. 2. Really make ShouldForceNGLayout() override ShouldForceLegacyLayout() ([1] was only doing that for the inherited child context). 3. Make MathML elements class keep handling the case of a forced legacy layout, but only on non-math display values. Note that this check is not necessary in LayoutObjectFactory::CreateMath which is only called for math display values. 4. Allow to override the display of the <math> tag too (it's unclear why [3] had a special case and that does not match the spec). Ideally, 3. can be removed when we completely switch to NG layout for all displays. New tests are added to verify related crashes found by clusterfuzz and check overriding of the layout MathML elements with various display values. [1] https://chromium-review.googlesource.com/c/chromium/src/+/2398702 [2] https://chromium-review.googlesource.com/c/chromium/src/+/2397949 [3] https://chromium-review.googlesource.com/c/chromium/src/+/1985766 [4] https://chromium-review.googlesource.com/c/chromium/src/+/1917207 Bug: 6606, 1127628, 1127407, 1127222 Change-Id: I62b0ef4de623f4eb93184a1cecce598905160dad Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2409957 Commit-Queue: Frédéric Wang <fwang@igalia.com> Reviewed-by:Morten Stenshorne <mstensho@chromium.org> Reviewed-by:
Ian Kilpatrick <ikilpatrick@chromium.org> Cr-Commit-Position: refs/heads/master@{#806771}
Showing
Please register or sign in to comment