Changeset 222321 in webkit


Ignore:
Timestamp:
Sep 21, 2017 9:28:35 AM (7 years ago)
Author:
commit-queue@webkit.org
Message:

In regular block layout, the width of a child's margin box should always be equal to that of its containing block
Merge from Blink https://bugs.chromium.org/p/chromium/issues/detail?id=708751
https://bugs.webkit.org/show_bug.cgi?id=176620

Patch by Zhifei FANG <facetothefate@gmail.com> on 2017-09-21
Reviewed by Zalan Bujtas.

Source/WebCore:

Test: fast/block/over-constrained-auto-margin.html

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::computeLogicalWidthInRegion const):

LayoutTests:

  • fast/block/over-constrained-auto-margin-expected.txt: Added.
  • fast/block/over-constrained-auto-margin.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r222319 r222321  
     12017-09-21  Zhifei FANG  <facetothefate@gmail.com>
     2
     3        In regular block layout, the width of a child's margin box should always be equal to that of its containing block
     4        Merge from Blink https://bugs.chromium.org/p/chromium/issues/detail?id=708751
     5        https://bugs.webkit.org/show_bug.cgi?id=176620
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        * fast/block/over-constrained-auto-margin-expected.txt: Added.
     10        * fast/block/over-constrained-auto-margin.html: Added.
     11
    1122017-09-21  Ms2ger  <Ms2ger@igalia.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r222317 r222321  
     12017-09-21  Zhifei FANG  <facetothefate@gmail.com>
     2
     3        In regular block layout, the width of a child's margin box should always be equal to that of its containing block
     4        Merge from Blink https://bugs.chromium.org/p/chromium/issues/detail?id=708751
     5        https://bugs.webkit.org/show_bug.cgi?id=176620
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        Test: fast/block/over-constrained-auto-margin.html
     10
     11        * rendering/RenderBox.cpp:
     12        (WebCore::RenderBox::computeLogicalWidthInRegion const):
     13
    1142017-09-21  Javier Fernandez  <jfernandez@igalia.com>
    215
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r222263 r222321  
    23902390        && !cb.isRenderGrid()
    23912391        ) {
    2392         LayoutUnit newMargin = containerLogicalWidth - computedValues.m_extent - cb.marginStartForChild(*this);
     2392        LayoutUnit newMarginTotal = containerLogicalWidth - computedValues.m_extent;
    23932393        bool hasInvertedDirection = cb.style().isLeftToRightDirection() != style().isLeftToRightDirection();
    23942394        if (hasInvertedDirection)
    2395             computedValues.m_margins.m_start = newMargin;
     2395            computedValues.m_margins.m_start = newMarginTotal - computedValues.m_margins.m_end;
    23962396        else
    2397             computedValues.m_margins.m_end = newMargin;
     2397            computedValues.m_margins.m_end = newMarginTotal - computedValues.m_margins.m_start;
    23982398    }
    23992399}
Note: See TracChangeset for help on using the changeset viewer.