[Webkit-unassigned] [Bug 170272] MathML: Extra left space for arrows inside <mo>

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Nov 12 14:31:34 PST 2017


https://bugs.webkit.org/show_bug.cgi?id=170272

--- Comment #11 from Minsheng Liu <lambda at liu.ms> ---
In fact, I think the centering process should be removed entirely. In RenderMathMLOperator::layoutBlock, we have

    if (useMathOperator()) {
        for (auto child = firstChildBox(); child; child = child->nextSiblingBox())
            child->layoutIfNeeded();
        setLogicalWidth(leadingSpaceValue + m_mathOperator.width() + trailingSpaceValue);
        setLogicalHeight(m_mathOperator.ascent() + m_mathOperator.descent());
    } else {
        // irrelevant, as the buggy code only concerns cases where `useMathOperator() = true`.
    }

So, logicalWidth, which is just width when we are in horizontal writing mode, is just the sum of operator width, leading space, and trailing space. Hence, it makes no sense to do centering. It is already centered!

    // Center horizontal operators.
    if (!isVertical())
        operatorTopLeft.move(-(m_mathOperator.width() - width()) / 2, 0);

I will just remove the code, which does not lead to any regression.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20171112/dfaa2a56/attachment-0001.html>


More information about the webkit-unassigned mailing list