Changeset 160073 in webkit


Ignore:
Timestamp:
Dec 3, 2013 11:56:26 PM (10 years ago)
Author:
zoltan@webkit.org
Message:

Remove BreakingContext's friendship from RenderBlockFlow
<https://webkit.org/b/124958>

Reviewed by David Hyatt.

BreakingContext uses only 2 functions from RenderBlockFlow: insertFloatingObject/positionNewFloatOnLine. I added helper
functions to LineBreaker, what is already a friend of RenderBlockFlow, so BreakingContext doesn't need to be anymore.

No new tests, no behavior change.

  • rendering/RenderBlockFlow.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleFloat):

  • rendering/line/LineBreaker.h:

(WebCore::LineBreaker::insertFloatingObject):
(WebCore::LineBreaker::positionNewFloatOnLine):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r160072 r160073  
     12013-12-03  Zoltan Horvath  <zoltan@webkit.org>
     2
     3        Remove BreakingContext's friendship from RenderBlockFlow
     4        <https://webkit.org/b/124958>
     5
     6        Reviewed by David Hyatt.
     7
     8        BreakingContext uses only 2 functions from RenderBlockFlow: insertFloatingObject/positionNewFloatOnLine. I added helper
     9        functions to LineBreaker, what is already a friend of RenderBlockFlow, so BreakingContext doesn't need to be anymore.
     10 
     11        No new tests, no behavior change.
     12
     13        * rendering/RenderBlockFlow.h:
     14        * rendering/line/BreakingContextInlineHeaders.h:
     15        (WebCore::BreakingContext::handleFloat):
     16        * rendering/line/LineBreaker.h:
     17        (WebCore::LineBreaker::insertFloatingObject):
     18        (WebCore::LineBreaker::positionNewFloatOnLine):
     19
    1202013-12-03  Ryosuke Niwa  <rniwa@webkit.org>
    221
  • trunk/Source/WebCore/rendering/RenderBlockFlow.h

    r159575 r160073  
    532532    std::unique_ptr<SimpleLineLayout::Layout> m_simpleLineLayout;
    533533
    534     friend class BreakingContext;
    535534    friend class LineBreaker;
    536535    friend class LineWidth; // Needs to know FloatingObject
  • trunk/Source/WebCore/rendering/line/BreakingContextInlineHeaders.h

    r159860 r160073  
    457457{
    458458    RenderBox& floatBox = toRenderBox(*m_current.renderer());
    459     FloatingObject* floatingObject = m_block.insertFloatingObject(floatBox);
     459    FloatingObject* floatingObject = m_lineBreaker.insertFloatingObject(floatBox);
    460460    // check if it fits in the current line.
    461461    // If it does, position it now, otherwise, position
     
    463463    // FIXME: Bug 110372: Properly position multiple stacked floats with non-rectangular shape outside.
    464464    if (m_floatsFitOnLine && m_width.fitsOnLineExcludingTrailingWhitespace(m_block.logicalWidthForFloat(floatingObject))) {
    465         m_block.positionNewFloatOnLine(floatingObject, m_lastFloatFromPreviousLine, m_lineInfo, m_width);
     465        m_lineBreaker.positionNewFloatOnLine(floatingObject, m_lastFloatFromPreviousLine, m_lineInfo, m_width);
    466466        if (m_lineBreak.renderer() == m_current.renderer()) {
    467467            ASSERT(!m_lineBreak.m_pos);
  • trunk/Source/WebCore/rendering/line/LineBreaker.h

    r159354 r160073  
    6868    void skipLeadingWhitespace(InlineBidiResolver&, LineInfo&, FloatingObject* lastFloatFromPreviousLine, LineWidth&);
    6969
     70    FloatingObject* insertFloatingObject(RenderBox& floatBox) { return m_block.insertFloatingObject(floatBox); }
     71    bool positionNewFloatOnLine(FloatingObject* newFloat, FloatingObject* lastFloatFromPreviousLine, LineInfo& lineInfo, LineWidth& width)
     72    {
     73        return m_block.positionNewFloatOnLine(newFloat, lastFloatFromPreviousLine, lineInfo, width);
     74    }
     75
    7076    RenderBlockFlow& m_block;
    7177    bool m_hyphenated;
Note: See TracChangeset for help on using the changeset viewer.