Changeset 199771 in webkit


Ignore:
Timestamp:
Apr 20, 2016 6:25:39 AM (8 years ago)
Author:
fred.wang@free.fr
Message:

Refactor RenderMathMLSpace to avoid using flexbox
https://bugs.webkit.org/show_bug.cgi?id=155168

Patch by Frederic Wang <fwang@igalia.com> on 2016-04-20
Reviewed by Martin Robinson.

Source/WebCore:

No new tests, already covered by existing tests. The behavior of mspace-prefered-width-expected is not specified by the MathML recommendation, we update that test to match our new behavior.

  • rendering/mathml/RenderMathMLSpace.cpp: Implement layout functions without passing by flebox.

(WebCore::RenderMathMLSpace::computePreferredLogicalWidths): Implement this function.
(WebCore::RenderMathMLSpace::layoutBlock): Implement this function.
(WebCore::RenderMathMLSpace::computeIntrinsicLogicalWidths): Deleted.
(WebCore::RenderMathMLSpace::updateLogicalWidth): Deleted.
(WebCore::RenderMathMLSpace::updateLogicalHeight): Deleted.

  • rendering/mathml/RenderMathMLSpace.h: Update function declarations.

LayoutTests:

  • mathml/presentation/mspace-prefered-width-expected.html: Update the expectation so that the logical width and preferred width are both equal to the one specified by the width attribute.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r199770 r199771  
     12016-04-20  Frederic Wang  <fwang@igalia.com>
     2
     3        Refactor RenderMathMLSpace to avoid using flexbox
     4        https://bugs.webkit.org/show_bug.cgi?id=155168
     5
     6        Reviewed by Martin Robinson.
     7
     8        * mathml/presentation/mspace-prefered-width-expected.html: Update the expectation so that the logical width and preferred width are both equal to the one specified by the width attribute.
     9
    1102016-04-20  Carlos Garcia Campos  <cgarcia@igalia.com>
    211
  • trunk/LayoutTests/mathml/presentation/mspace-prefered-width-expected.html

    r152840 r199771  
    1515        </td>
    1616    <td>
    17          <span style="display: inline-block; width: 50px; height: 10px; background:green; margin-right: 50px;"></span>
     17         <span style="display: inline-block; width: 50px; height: 10px; background:green;"></span>
    1818        </td>
    1919    <td>
    20          <span style="display: inline-block; width: 50px; height: 10px; background:green; margin-right: -40px;"></span>
     20         <span style="display: inline-block; width: 50px; height: 10px; background:green;"></span>
    2121        </td>
    2222  </tr>
  • trunk/Source/WebCore/ChangeLog

    r199769 r199771  
     12016-04-20  Frederic Wang  <fwang@igalia.com>
     2
     3        Refactor RenderMathMLSpace to avoid using flexbox
     4        https://bugs.webkit.org/show_bug.cgi?id=155168
     5
     6        Reviewed by Martin Robinson.
     7
     8        No new tests, already covered by existing tests. The behavior of mspace-prefered-width-expected is not specified by the MathML recommendation, we update that test to match our new behavior.
     9
     10        * rendering/mathml/RenderMathMLSpace.cpp: Implement layout functions without passing by flebox.
     11        (WebCore::RenderMathMLSpace::computePreferredLogicalWidths): Implement this function.
     12        (WebCore::RenderMathMLSpace::layoutBlock): Implement this function.
     13        (WebCore::RenderMathMLSpace::computeIntrinsicLogicalWidths): Deleted.
     14        (WebCore::RenderMathMLSpace::updateLogicalWidth): Deleted.
     15        (WebCore::RenderMathMLSpace::updateLogicalHeight): Deleted.
     16        * rendering/mathml/RenderMathMLSpace.h: Update function declarations.
     17
    1182016-04-20  Carlos Garcia Campos  <cgarcia@igalia.com>
    219
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLSpace.cpp

    r194496 r199771  
    4545}
    4646
    47 void RenderMathMLSpace::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
     47void RenderMathMLSpace::computePreferredLogicalWidths()
    4848{
    49     minLogicalWidth = m_width;
    50     maxLogicalWidth = m_width;
     49    ASSERT(preferredLogicalWidthsDirty());
     50
     51    m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = m_width;
     52
     53    setPreferredLogicalWidthsDirty(false);
    5154}
    5255
     
    7679}
    7780
    78 void RenderMathMLSpace::updateLogicalWidth()
     81void RenderMathMLSpace::layoutBlock(bool relayoutChildren, LayoutUnit)
    7982{
     83    ASSERT(needsLayout());
     84
     85    if (!relayoutChildren && simplifiedLayout())
     86        return;
     87
    8088    setLogicalWidth(m_width);
    81 }
     89    setLogicalHeight(m_height + m_depth);
    8290
    83 void RenderMathMLSpace::updateLogicalHeight()
    84 {
    85     setLogicalHeight(m_height + m_depth);
     91    clearNeedsLayout();
    8692}
    8793
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLSpace.h

    r197563 r199771  
    4040
    4141private:
    42     const char* renderName() const override { return isAnonymous() ? "RenderMathMLSpace (anonymous)" : "RenderMathMLSpace"; }
    43     bool isRenderMathMLSpace() const override { return true; }
    44     void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
    45     bool isChildAllowed(const RenderObject&, const RenderStyle&) const override { return false; }
    46     void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const override;
    47     void updateFromElement() override;
    48     Optional<int> firstLineBaseline() const override;
    49     void updateLogicalWidth() override;
    50     void updateLogicalHeight() override;
     42    const char* renderName() const final { return isAnonymous() ? "RenderMathMLSpace (anonymous)" : "RenderMathMLSpace"; }
     43    bool isRenderMathMLSpace() const final { return true; }
     44    void styleDidChange(StyleDifference, const RenderStyle* oldStyle) final;
     45    bool isChildAllowed(const RenderObject&, const RenderStyle&) const final { return false; }
     46    void updateFromElement() final;
     47    void computePreferredLogicalWidths() final;
     48    void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0) final;
     49    Optional<int> firstLineBaseline() const final;
    5150
    5251    LayoutUnit m_width;
Note: See TracChangeset for help on using the changeset viewer.