Changeset 271648 in webkit


Ignore:
Timestamp:
Jan 20, 2021 8:02:01 AM (3 years ago)
Author:
commit-queue@webkit.org
Message:

Support transferred min/max block size for aspect-ratio
https://bugs.webkit.org/show_bug.cgi?id=220224

Patch by Rob Buis <rbuis@igalia.com> on 2021-01-20
Reviewed by Darin Adler.

Use std::clamp for clarity. Also use structured bindings where possible.

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::constrainLogicalWidthInFragmentByMinMax const):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r271646 r271648  
     12021-01-20  Rob Buis  <rbuis@igalia.com>
     2
     3        Support transferred min/max block size for aspect-ratio
     4        https://bugs.webkit.org/show_bug.cgi?id=220224
     5
     6        Reviewed by Darin Adler.
     7
     8        Use std::clamp for clarity. Also use structured bindings where possible.
     9
     10        * rendering/RenderBox.cpp:
     11        (WebCore::RenderBox::constrainLogicalWidthInFragmentByMinMax const):
     12
    1132021-01-20  Sam Weinig  <weinig@apple.com>
    214
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r271598 r271648  
    649649
    650650    if (shouldComputeLogicalHeightFromAspectRatio()) {
    651         LayoutUnit logicalMinWidth, logicalMaxWidth;
    652         std::tie(logicalMinWidth, logicalMaxWidth) = computeMinMaxLogicalWidthFromAspectRatio();
    653         logicalWidth = std::max(logicalMinWidth, std::min(logicalWidth, logicalMaxWidth));
     651        auto [logicalMinWidth, logicalMaxWidth] = computeMinMaxLogicalWidthFromAspectRatio();
     652        logicalWidth = std::clamp(logicalWidth, logicalMinWidth, logicalMaxWidth);
    654653    }
    655654
Note: See TracChangeset for help on using the changeset viewer.