Changeset 189538 in webkit


Ignore:
Timestamp:
Sep 9, 2015 4:23:07 AM (9 years ago)
Author:
Manuel Rego Casasnovas
Message:

[css-grid] Percentage columns shouldn't include border and padding
https://bugs.webkit.org/show_bug.cgi?id=148978

Reviewed by Sergio Villar Senin.

Source/WebCore:

Subtract border and padding when we're calculating the breadth of the
columns in LayoutGrid::computeUsedBreadthOfSpecifiedLength().

Added test to check the behavior for both columns and rows.

Test: fast/css-grid-layout/grid-percent-track-margin-border-padding.html

  • rendering/RenderGrid.cpp:

(WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):

LayoutTests:

  • fast/css-grid-layout/grid-percent-track-margin-border-padding-expected.txt: Added.
  • fast/css-grid-layout/grid-percent-track-margin-border-padding.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r189537 r189538  
     12015-09-09  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        [css-grid] Percentage columns shouldn't include border and padding
     4        https://bugs.webkit.org/show_bug.cgi?id=148978
     5
     6        Reviewed by Sergio Villar Senin.
     7
     8        * fast/css-grid-layout/grid-percent-track-margin-border-padding-expected.txt: Added.
     9        * fast/css-grid-layout/grid-percent-track-margin-border-padding.html: Added.
     10
    1112015-09-09  Chris Dumez  <cdumez@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r189537 r189538  
     12015-09-09  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        [css-grid] Percentage columns shouldn't include border and padding
     4        https://bugs.webkit.org/show_bug.cgi?id=148978
     5
     6        Reviewed by Sergio Villar Senin.
     7
     8        Subtract border and padding when we're calculating the breadth of the
     9        columns in LayoutGrid::computeUsedBreadthOfSpecifiedLength().
     10
     11        Added test to check the behavior for both columns and rows.
     12
     13        Test: fast/css-grid-layout/grid-percent-track-margin-border-padding.html
     14
     15        * rendering/RenderGrid.cpp:
     16        (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
     17
    1182015-09-09  Chris Dumez  <cdumez@apple.com>
    219
  • trunk/Source/WebCore/rendering/RenderGrid.cpp

    r189536 r189538  
    452452    ASSERT(trackLength.isSpecified());
    453453    if (direction == ForColumns)
    454         return valueForLength(trackLength, logicalWidth());
     454        return valueForLength(trackLength, logicalWidth() - borderAndPaddingLogicalWidth());
    455455    return valueForLength(trackLength, computeContentLogicalHeight(MainOrPreferredSize, style().logicalHeight(), Nullopt).valueOr(0));
    456456}
Note: See TracChangeset for help on using the changeset viewer.