Ignore:
Timestamp:
Oct 19, 2013, 12:55:40 PM (12 years ago)
Author:
[email protected]
Message:

Move m_lineBoxes from RenderBlock to RenderBlockFlow (Part 2)
https://bugs.webkit.org/show_bug.cgi?id=122969

Reviewed by Antti Koivisto.

  • Move truncation (e.g. line clamp and ellipse) support to RenderBlockFlow.
  • rendering/EllipsisBox.cpp:

(WebCore::EllipsisBox::EllipsisBox):
(WebCore::EllipsisBox::paint):
(WebCore::EllipsisBox::markupBox):
(WebCore::EllipsisBox::selectionRect):
(WebCore::EllipsisBox::paintSelection):
(WebCore::EllipsisBox::nodeAtPoint):

  • rendering/EllipsisBox.h:
  • rendering/RenderBlock.cpp:
  • rendering/RenderBlock.h:
  • rendering/RenderBlockFlow.cpp:

(WebCore::shouldCheckLines):
(WebCore::RenderBlockFlow::lineAtIndex):
(WebCore::RenderBlockFlow::lineCount):
(WebCore::getHeightForLineCount):
(WebCore::RenderBlockFlow::heightForLineCount):
(WebCore::RenderBlockFlow::clearTruncation):

  • rendering/RenderBlockFlow.h:
  • rendering/RenderDeprecatedFlexibleBox.cpp:

(WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
(WebCore::RenderDeprecatedFlexibleBox::clearLineClamp):

  • rendering/RootInlineBox.cpp:

(WebCore::RootInlineBox::placeEllipsis):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp

    r157408 r157674  
    955955        child->clearOverrideSize();
    956956        if (relayoutChildren || (child->isReplaced() && (child->style()->width().isPercent() || child->style()->height().isPercent()))
    957             || (child->style()->height().isAuto() && child->isRenderBlock())) {
     957            || (child->style()->height().isAuto() && child->isRenderBlockFlow())) {
    958958            child->setChildNeedsLayout(MarkOnlyThis);
    959959
    960960            // Dirty all the positioned objects.
    961             if (child->isRenderBlock()) {
    962                 toRenderBlock(child)->markPositionedObjectsForLayout();
    963                 toRenderBlock(child)->clearTruncation();
     961            if (child->isRenderBlockFlow()) {
     962                toRenderBlockFlow(child)->markPositionedObjectsForLayout();
     963                toRenderBlockFlow(child)->clearTruncation();
    964964            }
    965965        }
    966966        child->layoutIfNeeded();
    967         if (child->style()->height().isAuto() && child->isRenderBlock())
    968             maxLineCount = max(maxLineCount, toRenderBlock(child)->lineCount());
     967        if (child->style()->height().isAuto() && child->isRenderBlockFlow())
     968            maxLineCount = max(maxLineCount, toRenderBlockFlow(child)->lineCount());
    969969    }
    970970
     
    977977
    978978    for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
    979         if (childDoesNotAffectWidthOrFlexing(child) || !child->style()->height().isAuto() || !child->isRenderBlock())
     979        if (childDoesNotAffectWidthOrFlexing(child) || !child->style()->height().isAuto() || !child->isRenderBlockFlow())
    980980            continue;
    981981
    982         RenderBlock* blockChild = toRenderBlock(child);
     982        RenderBlockFlow* blockChild = toRenderBlockFlow(child);
    983983        int lineCount = blockChild->lineCount();
    984984        if (lineCount <= numVisibleLines)
     
    10231023
    10241024        // See if this width can be accommodated on the last visible line
    1025         RenderBlock& destBlock = toRenderBlock(lastVisibleLine->renderer());
    1026         RenderBlock& srcBlock = toRenderBlock(lastLine->renderer());
     1025        RenderBlockFlow& destBlock = lastVisibleLine->blockFlow();
     1026        RenderBlockFlow& srcBlock = lastLine->blockFlow();
    10271027
    10281028        // FIXME: Directions of src/destBlock could be different from our direction and from one another.
     
    10581058            child->setChildNeedsLayout();
    10591059
    1060             if (child->isRenderBlock()) {
    1061                 toRenderBlock(child)->markPositionedObjectsForLayout();
    1062                 toRenderBlock(child)->clearTruncation();
     1060            if (child->isRenderBlockFlow()) {
     1061                toRenderBlockFlow(child)->markPositionedObjectsForLayout();
     1062                toRenderBlockFlow(child)->clearTruncation();
    10631063            }
    10641064        }
Note: See TracChangeset for help on using the changeset viewer.