Changeset 271223 in webkit


Ignore:
Timestamp:
Jan 6, 2021 10:11:14 PM (3 years ago)
Author:
commit-queue@webkit.org
Message:

Fix aspect ratio handling in RenderBox::computeLogicalWidthInFragment
https://bugs.webkit.org/show_bug.cgi?id=220138

Patch by Rob Buis <rbuis@igalia.com> on 2021-01-06
Reviewed by Simon Fraser.

Source/WebCore:

The existing code does not respect min/max-height in the logical height
calculation, the computeLogicalWidthFromAspectRatio helper does, so use
it.

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::computeLogicalWidthInFragment const):

LayoutTests:

Enable some tests that pass now.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r271218 r271223  
     12021-01-06  Rob Buis  <rbuis@igalia.com>
     2
     3        Fix aspect ratio handling in RenderBox::computeLogicalWidthInFragment
     4        https://bugs.webkit.org/show_bug.cgi?id=220138
     5
     6        Reviewed by Simon Fraser.
     7
     8        Enable some tests that pass now.
     9
     10        * TestExpectations:
     11
    1122021-01-06  Aditya Keerthi  <akeerthi@apple.com>
    213
  • trunk/LayoutTests/TestExpectations

    r271146 r271223  
    44384438webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-023.html [ ImageOnlyFailure ]
    44394439webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-024.html [ ImageOnlyFailure ]
    4440 webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-025.html [ ImageOnlyFailure ]
    44414440webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-026.html [ ImageOnlyFailure ]
    44424441webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-027.html [ ImageOnlyFailure ]
     
    44494448webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-011.html [ ImageOnlyFailure ]
    44504449webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-012.html [ ImageOnlyFailure ]
    4451 webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-013.html [ ImageOnlyFailure ]
    44524450webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-014.html [ ImageOnlyFailure ]
    44534451webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-015.html [ ImageOnlyFailure ]
     
    44584456webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-021.html [ ImageOnlyFailure ]
    44594457webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-022.html [ ImageOnlyFailure ]
    4460 webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-024.html [ ImageOnlyFailure ]
    44614458webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/intrinsic-size-001.html [ ImageOnlyFailure ]
    44624459webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/intrinsic-size-002.html [ ImageOnlyFailure ]
  • trunk/Source/WebCore/ChangeLog

    r271220 r271223  
     12021-01-06  Rob Buis  <rbuis@igalia.com>
     2
     3        Fix aspect ratio handling in RenderBox::computeLogicalWidthInFragment
     4        https://bugs.webkit.org/show_bug.cgi?id=220138
     5
     6        Reviewed by Simon Fraser.
     7
     8        The existing code does not respect min/max-height in the logical height
     9        calculation, the computeLogicalWidthFromAspectRatio helper does, so use
     10        it.
     11
     12        * rendering/RenderBox.cpp:
     13        (WebCore::RenderBox::computeLogicalWidthInFragment const):
     14
    1152021-01-06  Fujii Hironori  <Hironori.Fujii@sony.com>
    216
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r271061 r271223  
    25002500        containerWidthInInlineDirection = perpendicularContainingBlockLogicalHeight();
    25012501
    2502     Optional<LayoutUnit> logicalHeight;
    2503     if (style().hasAspectRatio() && style().logicalWidth().isAuto() && (style().logicalHeight().isFixed() || style().logicalHeight().isPercentOrCalculated()))
    2504         logicalHeight = computeLogicalHeightUsing(MainOrPreferredSize, style().logicalHeight(), { });
    2505 
    25062502    // Width calculations
    2507     if (logicalHeight) {
    2508         LayoutUnit logicalWidth = inlineSizeFromAspectRatio(horizontalBorderAndPaddingExtent(), verticalBorderAndPaddingExtent(), style().logicalAspectRatio(), style().boxSizing(), *logicalHeight);
    2509         computedValues.m_extent = constrainLogicalWidthInFragmentByMinMax(logicalWidth, containerWidthInInlineDirection, cb, fragment);
     2503    if (shouldComputeLogicalWidthFromAspectRatio() && style().logicalWidth().isAuto()) {
     2504        computedValues.m_extent = computeLogicalWidthFromAspectRatio(fragment);
    25102505    } else if (treatAsReplaced) {
    25112506        computedValues.m_extent = logicalWidthLength.value() + borderAndPaddingLogicalWidth();
Note: See TracChangeset for help on using the changeset viewer.