Changeset 119227 in webkit


Ignore:
Timestamp:
Jun 1, 2012 7:14:07 AM (12 years ago)
Author:
mitz@apple.com
Message:

Layout not updated after setting -webkit-line-clamp to none
https://bugs.webkit.org/show_bug.cgi?id=88049

Reviewed by Abhishek Arya.

Source/WebCore:

Test: fast/flexbox/line-clamp-removed-dynamically.html

  • rendering/RenderDeprecatedFlexibleBox.cpp:

(WebCore::RenderDeprecatedFlexibleBox::styleWillChange): Added. Calls clearLineClamp if
line-clamp will change to none.
(WebCore::RenderDeprecatedFlexibleBox::clearLineClamp): Added. Marks possibly-clamped
children for layout and clears truncation from blocks.

  • rendering/RenderDeprecatedFlexibleBox.h:

LayoutTests:

  • fast/flexbox/line-clamp-removed-dynamically-expected.html: Added.
  • fast/flexbox/line-clamp-removed-dynamically.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r119221 r119227  
     12012-06-01  Dan Bernstein  <mitz@apple.com>
     2
     3        Layout not updated after setting -webkit-line-clamp to none
     4        https://bugs.webkit.org/show_bug.cgi?id=88049
     5
     6        Reviewed by Abhishek Arya.
     7
     8        * fast/flexbox/line-clamp-removed-dynamically-expected.html: Added.
     9        * fast/flexbox/line-clamp-removed-dynamically.html: Added.
     10
    1112012-06-01  Csaba Osztrogonác  <ossy@webkit.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r119226 r119227  
     12012-06-01  Dan Bernstein  <mitz@apple.com>
     2
     3        Layout not updated after setting -webkit-line-clamp to none
     4        https://bugs.webkit.org/show_bug.cgi?id=88049
     5
     6        Reviewed by Abhishek Arya.
     7
     8        Test: fast/flexbox/line-clamp-removed-dynamically.html
     9
     10        * rendering/RenderDeprecatedFlexibleBox.cpp:
     11        (WebCore::RenderDeprecatedFlexibleBox::styleWillChange): Added. Calls clearLineClamp if
     12        line-clamp will change to none.
     13        (WebCore::RenderDeprecatedFlexibleBox::clearLineClamp): Added. Marks possibly-clamped
     14        children for layout and clears truncation from blocks.
     15        * rendering/RenderDeprecatedFlexibleBox.h:
     16
    1172012-06-01  Sheriff Bot  <webkit.review.bot@gmail.com>
    218
  • trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp

    r117484 r119227  
    151151}
    152152
     153void RenderDeprecatedFlexibleBox::styleWillChange(StyleDifference diff, const RenderStyle* newStyle)
     154{
     155    RenderStyle* oldStyle = style();
     156    if (oldStyle && !oldStyle->lineClamp().isNone() && newStyle->lineClamp().isNone())
     157        clearLineClamp();
     158
     159    RenderBlock::styleWillChange(diff, newStyle);
     160}
     161
    153162void RenderDeprecatedFlexibleBox::calcHorizontalPrefWidths()
    154163{
     
    973982        lastVisibleLine->placeEllipsis(anchorBox ? ellipsisAndSpaceStr : ellipsisStr, leftToRight, blockLeftEdge, blockRightEdge, totalWidth, anchorBox);
    974983        destBlock->setHasMarkupTruncation(true);
     984    }
     985}
     986
     987void RenderDeprecatedFlexibleBox::clearLineClamp()
     988{
     989    FlexBoxIterator iterator(this);
     990    for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
     991        if (childDoesNotAffectWidthOrFlexing(child))
     992            continue;
     993
     994        if ((child->isReplaced() && (child->style()->width().isPercent() || child->style()->height().isPercent()))
     995            || (child->style()->height().isAuto() && child->isBlockFlow())) {
     996            child->setChildNeedsLayout(true);
     997
     998            if (child->isRenderBlock()) {
     999                toRenderBlock(child)->markPositionedObjectsForLayout();
     1000                toRenderBlock(child)->clearTruncation();
     1001            }
     1002        }
    9751003    }
    9761004}
  • trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.h

    r118711 r119227  
    4141    void calcVerticalPrefWidths();
    4242
     43    virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle) OVERRIDE;
     44
    4345    virtual void layoutBlock(bool relayoutChildren, LayoutUnit pageHeight = 0);
    4446    void layoutHorizontalBox(bool relayoutChildren);
     
    6567private:
    6668    void applyLineClamp(FlexBoxIterator&, bool relayoutChildren);
     69    void clearLineClamp();
    6770};
    6871
Note: See TracChangeset for help on using the changeset viewer.