Changeset 199548 in webkit


Ignore:
Timestamp:
Apr 14, 2016 11:27:51 AM (8 years ago)
Author:
fred.wang@free.fr
Message:

RenderMathMLOperator: Add helper function to retrieve italic correction
https://bugs.webkit.org/show_bug.cgi?id=156572

Reviewed by Darin Adler.

No new tests, the helper function will only be used in bug 153918.

  • rendering/mathml/RenderMathMLOperator.cpp:

(WebCore::RenderMathMLOperator::italicCorrection): Return the italic correction from the MATH table if it's a large operator.

  • rendering/mathml/RenderMathMLOperator.h: Declare italicCorrection.
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r199547 r199548  
     12016-04-14  Frederic Wang  <fred.wang@free.fr>
     2
     3        RenderMathMLOperator: Add helper function to retrieve italic correction
     4        https://bugs.webkit.org/show_bug.cgi?id=156572
     5
     6        Reviewed by Darin Adler.
     7
     8        No new tests, the helper function will only be used in bug 153918.
     9
     10        * rendering/mathml/RenderMathMLOperator.cpp:
     11        (WebCore::RenderMathMLOperator::italicCorrection): Return the italic correction from the MATH table if it's a large operator.
     12        * rendering/mathml/RenderMathMLOperator.h: Declare italicCorrection.
     13
    1142016-04-14  Frederic Wang  <fwang@igalia.com>
    215
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp

    r199547 r199548  
    203203}
    204204
     205LayoutUnit RenderMathMLOperator::italicCorrection() const
     206{
     207    if (isLargeOperatorInDisplayStyle()) {
     208        const auto& primaryFont = style().fontCascade().primaryFont();
     209        if (auto* mathData = primaryFont.mathData()) {
     210            StretchyData largeOperator = getDisplayStyleLargeOperator(m_textContent);
     211            return mathData->getItalicCorrection(primaryFont, largeOperator.variant().glyph);
     212        }
     213    }
     214    return 0;
     215}
     216
    205217void RenderMathMLOperator::stretchTo(LayoutUnit heightAboveBaseline, LayoutUnit depthBelowBaseline)
    206218{
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h

    r199547 r199548  
    5252    bool isLargeOperatorInDisplayStyle() const { return !hasOperatorFlag(MathMLOperatorDictionary::Stretchy) && hasOperatorFlag(MathMLOperatorDictionary::LargeOp); }
    5353    bool isVertical() const { return m_isVertical; }
     54    LayoutUnit italicCorrection() const;
    5455
    5556    void styleDidChange(StyleDifference, const RenderStyle* oldStyle) final;
Note: See TracChangeset for help on using the changeset viewer.