Changeset 140290 in webkit


Ignore:
Timestamp:
Jan 20, 2013 6:40:03 PM (11 years ago)
Author:
tkent@chromium.org
Message:

Re-layout child blocks when border/padding of the box-sizing:border-box parent is updated
https://bugs.webkit.org/show_bug.cgi?id=104997

Reviewed by Tony Chang.

Source/WebCore:

When padding or border is updated for a parent block with
box-sizing:border-box and width, the width of its child block was not
updated.

Tests: fast/css/box-sizing-border-box-dynamic-padding-border-update.html

fast/forms/text/text-padding-dynamic-change.html

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::styleDidChange):
If box-sizing of the old style and/or the new style is border-box and
padding or border is changed, apply setChildNeedsLayout(true) for child
boxes.

LayoutTests:

  • fast/css/box-sizing-border-box-dynamic-padding-border-update-expected.txt: Added.
  • fast/css/box-sizing-border-box-dynamic-padding-border-update.html: Added.
  • fast/forms/text/text-padding-dynamic-change-expected.html: Added.
  • fast/forms/text/text-padding-dynamic-change.html: Added.
Location:
trunk
Files:
5 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r140287 r140290  
     12013-01-20  Kent Tamura  <tkent@chromium.org>
     2
     3        Re-layout child blocks when border/padding of the box-sizing:border-box parent is updated
     4        https://bugs.webkit.org/show_bug.cgi?id=104997
     5
     6        Reviewed by Tony Chang.
     7
     8        * fast/css/box-sizing-border-box-dynamic-padding-border-update-expected.txt: Added.
     9        * fast/css/box-sizing-border-box-dynamic-padding-border-update.html: Added.
     10        * fast/forms/text/text-padding-dynamic-change-expected.html: Added.
     11        * fast/forms/text/text-padding-dynamic-change.html: Added.
     12
    1132013-01-20  Shinya Kawanaka  <shinyak@chromium.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r140288 r140290  
     12013-01-20  Kent Tamura  <tkent@chromium.org>
     2
     3        Re-layout child blocks when border/padding of the box-sizing:border-box parent is updated
     4        https://bugs.webkit.org/show_bug.cgi?id=104997
     5
     6        Reviewed by Tony Chang.
     7
     8        When padding or border is updated for a parent block with
     9        box-sizing:border-box and width, the width of its child block was not
     10        updated.
     11
     12        Tests: fast/css/box-sizing-border-box-dynamic-padding-border-update.html
     13               fast/forms/text/text-padding-dynamic-change.html
     14
     15        * rendering/RenderBox.cpp:
     16        (WebCore::RenderBox::styleDidChange):
     17        If box-sizing of the old style and/or the new style is border-box and
     18        padding or border is changed, apply setChildNeedsLayout(true) for child
     19        boxes.
     20
    1212013-01-20  Kentaro Hara  <haraken@chromium.org>
    222
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r140286 r140290  
    306306    updateExclusionShapeOutsideInfoAfterStyleChange(style()->shapeOutside(), oldStyle ? oldStyle->shapeOutside() : 0);
    307307#endif
     308
     309    if (oldStyle && (newStyle->boxSizing() == BORDER_BOX || oldStyle->boxSizing() == BORDER_BOX)
     310        && (newStyle->paddingBox() != oldStyle->paddingBox() || newStyle->border() != oldStyle->border())) {
     311        for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox())
     312            child->setChildNeedsLayout(true, MarkOnlyThis);
     313    }
    308314}
    309315
Note: See TracChangeset for help on using the changeset viewer.