Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Issue 10915102: Merge 125635 (Closed)

Created:
8 years, 3 months ago by Chris Evans
Modified:
8 years, 3 months ago
Reviewers:
ojan
CC:
chromium-reviews
Base URL:
http://svn.webkit.org/repository/webkit/branches/chromium/1229/
Visibility:
Public.

Description

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+26 lines, -8 lines) Patch
A + LayoutTests/fast/overflow/line-clamp-and-columns.html View 0 chunks +-1 lines, --1 lines 0 comments Download
A + LayoutTests/fast/overflow/line-clamp-and-columns-expected.html View 0 chunks +-1 lines, --1 lines 0 comments Download
M Source/WebCore/rendering/EllipsisBox.h View 2 chunks +3 lines, -2 lines 0 comments Download
M Source/WebCore/rendering/EllipsisBox.cpp View 1 chunk +23 lines, -7 lines 0 comments Download
M Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp View 3 chunks +2 lines, -1 line 0 comments Download

Messages

Total messages: 2 (0 generated)
Chris Evans
8 years, 3 months ago (2012-09-05 19:14:56 UTC) #1
ojan
8 years, 3 months ago (2012-09-05 20:14:17 UTC) #2
LGTM


On Wed, Sep 5, 2012 at 12:14 PM, <cevans@chromium.org> wrote:

> Reviewers: ojan,
>
> Description:
> Merge 125635
> BUG=137052
>
> Please review this at
https://chromiumcodereview.**appspot.com/10915102/<https://chromiumcodereview...
>
> SVN Base: http://svn.webkit.org/**repository/webkit/branches/**
>
chromium/1229/<http://svn.webkit.org/repository/webkit/branches/chromium/1229/>
>
> Affected files:
>   A  +  LayoutTests/fast/overflow/**line-clamp-and-columns-**expected.html
>   A  +  LayoutTests/fast/overflow/**line-clamp-and-columns.html
>   M     Source/WebCore/rendering/**EllipsisBox.h
>   M     Source/WebCore/rendering/**EllipsisBox.cpp
>   M     Source/WebCore/rendering/**RenderDeprecatedFlexibleBox.**cpp
>
>
> ### BEGIN SVN COPY METADATA
> #$ svn cp -r 125635
trunk/LayoutTests/fast/**overflow/line-clamp-and-**columns.html
> LayoutTests/fast/overflow/**line-clamp-and-columns.html ### WARNING: note
> non-trunk copy
> #$ cp
trunk/LayoutTests/fast/**overflow/line-clamp-and-**columns-expected.html
> LayoutTests/fast/overflow/**line-clamp-and-columns-**expected.html
> ### END SVN COPY METADATA
> Index: LayoutTests/fast/overflow/**line-clamp-and-columns-**expected.html
> Index: LayoutTests/fast/overflow/**line-clamp-and-columns.html
> Index: Source/WebCore/rendering/**EllipsisBox.cpp
> ==============================**==============================**=======
> --- Source/WebCore/rendering/**EllipsisBox.cpp    (revision 127625)
> +++ Source/WebCore/rendering/**EllipsisBox.cpp    (working copy)
> @@ -65,15 +65,31 @@
>      if (setShadow)
>          context->clearShadow();
>
> -    if (m_markupBox) {
> -        // Paint the markup box
> -        LayoutPoint adjustedPaintOffset = paintOffset;
> -        adjustedPaintOffset.move(x() + m_logicalWidth - m_markupBox->x(),
> -            y() + style->fontMetrics().ascent() - (m_markupBox->y() +
> m_markupBox->renderer()->**style(isFirstLineStyle())->**
> fontMetrics().ascent()));
> -        m_markupBox->paint(paintInfo, adjustedPaintOffset, lineTop,
> lineBottom);
> -    }
> +    paintMarkupBox(paintInfo, paintOffset, lineTop, lineBottom, style);
>  }
>
> +void EllipsisBox::paintMarkupBox(**PaintInfo& paintInfo, const
> LayoutPoint& paintOffset, LayoutUnit lineTop, LayoutUnit lineBottom,
> RenderStyle* style)
> +{
> +    if (!m_shouldPaintMarkupBox || !m_renderer->isRenderBlock())
> +        return;
> +
> +    RenderBlock* block = toRenderBlock(m_renderer);
> +    RootInlineBox* lastLine = block->lineAtIndex(block->**lineCount() -
> 1);
> +    if (!lastLine)
> +        return;
> +
> +    // If the last line-box on the last line of a block is a link,
> -webkit-line-clamp paints that box after the ellipsis.
> +    // It does not actually move the link.
> +    InlineBox* anchorBox = lastLine->lastChild();
> +    if (!anchorBox || !anchorBox->renderer()->style(**)->isLink())
> +        return;
> +
> +    LayoutPoint adjustedPaintOffset = paintOffset;
> +    adjustedPaintOffset.move(x() + m_logicalWidth - anchorBox->x(),
> +        y() + style->fontMetrics().ascent() - (anchorBox->y() +
> anchorBox->renderer()->style(**isFirstLineStyle())->**
> fontMetrics().ascent()));
> +    anchorBox->paint(paintInfo, adjustedPaintOffset, lineTop, lineBottom);
> +}
> +
>  IntRect EllipsisBox::selectionRect()
>  {
>      RenderStyle* style = m_renderer->style(**isFirstLineStyle());
> Index: Source/WebCore/rendering/**EllipsisBox.h
> ==============================**==============================**=======
> --- Source/WebCore/rendering/**EllipsisBox.h      (revision 127625)
> +++ Source/WebCore/rendering/**EllipsisBox.h      (working copy)
> @@ -32,9 +32,9 @@
>      EllipsisBox(RenderObject* obj, const AtomicString& ellipsisStr,
> InlineFlowBox* parent,
>                  int width, int height, int y, bool firstLine, bool
> isVertical, InlineBox* markupBox)
>          : InlineBox(obj, FloatPoint(0, y), width, firstLine, true, false,
> false, isVertical, 0, 0, parent)
> +        , m_shouldPaintMarkupBox(**markupBox)
>          , m_height(height)
>          , m_str(ellipsisStr)
> -        , m_markupBox(markupBox)
>          , m_selectionState(RenderObject:**:SelectionNone)
>      {
>      }
> @@ -45,13 +45,14 @@
>      IntRect selectionRect();
>
>  private:
> +    void paintMarkupBox(PaintInfo&, const LayoutPoint& paintOffset,
> LayoutUnit lineTop, LayoutUnit lineBottom, RenderStyle*);
>      virtual int height() const { return m_height; }
>      virtual RenderObject::SelectionState selectionState() { return
> m_selectionState; }
>      void paintSelection(**GraphicsContext*, const LayoutPoint&,
> RenderStyle*, const Font&);
>
> +    bool m_shouldPaintMarkupBox;
>      int m_height;
>      AtomicString m_str;
> -    InlineBox* m_markupBox;
>      RenderObject::SelectionState m_selectionState;
>  };
>
> Index: Source/WebCore/rendering/**RenderDeprecatedFlexibleBox.**cpp
> ==============================**==============================**=======
> --- Source/WebCore/rendering/**RenderDeprecatedFlexibleBox.**cpp
>  (revision 127625)
> +++ Source/WebCore/rendering/**RenderDeprecatedFlexibleBox.**cpp
>  (working copy)
> @@ -885,6 +885,7 @@
>          if (**childDoesNotAffectWidthOrFlexi**ng(child))
>              continue;
>
> +        child->clearOverrideSize();
>          if (relayoutChildren || (child->isReplaced() &&
> (child->style()->width().**isPercent() || child->style()->height().**
> isPercent()))
>              || (child->style()->height().**isAuto() &&
> child->isBlockFlow())) {
>              child->setChildNeedsLayout(**true, MarkOnlyThis);
> @@ -925,7 +926,6 @@
>          m_flexingChildren = true;
>          child->layoutIfNeeded();
>          m_flexingChildren = false;
> -        child->clearOverrideSize();
>
>          // FIXME: For now don't support RTL.
>          if (style()->direction() != LTR)
> @@ -988,6 +988,7 @@
>          if (**childDoesNotAffectWidthOrFlexi**ng(child))
>              continue;
>
> +        child->clearOverrideSize();
>          if ((child->isReplaced() && (child->style()->width().**isPercent()
> || child->style()->height().**isPercent()))
>              || (child->style()->height().**isAuto() &&
> child->isBlockFlow())) {
>              child->setChildNeedsLayout(**true);
>
>
>

Powered by Google App Engine
This is Rietveld 408576698