[Webkit-unassigned] [Bug 79274] Fix <msubsup> formatting

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Feb 23 10:35:34 PST 2012


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





--- Comment #6 from Eric Seidel <eric at webkit.org>  2012-02-23 10:35:34 PST ---
(From update of attachment 128286)
View in context: https://bugs.webkit.org/attachment.cgi?id=128286&action=review

> Source/WebCore/rendering/mathml/RenderMathMLSubSup.cpp:159
> +    LineDirectionMode lineDirection = style()->isHorizontalWritingMode() ? HorizontalLine : VerticalLine;
> +    LayoutUnit baseAscent = base->baselinePosition(AlphabeticBaseline, true, lineDirection);
> +    LayoutUnit baseDescent = getBoxModelObjectHeight(base) - baseAscent;
> +    LayoutUnit axis = style()->fontMetrics().xHeight() / 2;
> +    LayoutUnit supHeight = getBoxModelObjectHeight(sup);
> +    LayoutUnit subHeight = getBoxModelObjectHeight(sub);
> +    // Don't let the superscript be below the axis (half x-height), or the subscript above it.
> +    // Also m_scripts has setVerticalAlign(TOP), and don't let the subscript bottom be above the base bottom.
> +    LayoutUnit basePaddingTop = supHeight + axis - baseAscent;
> +    LayoutUnit supPaddingBottom = max<LayoutUnit>(baseDescent + axis - subHeight, 0);
> +    if (basePaddingTop < 0) {
> +        supPaddingBottom += - basePaddingTop;
> +        basePaddingTop = 0;

Could we break some of this out into helper functions with nice names?  I feel like we may be moving slightly backwards in terms of readability of this ::layout() function.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list