Title: [271648] trunk/Source/WebCore
Revision
271648
Author
commit-qu...@webkit.org
Date
2021-01-20 08:02:01 -0800 (Wed, 20 Jan 2021)

Log Message

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

Patch by Rob Buis <rb...@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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (271647 => 271648)


--- trunk/Source/WebCore/ChangeLog	2021-01-20 15:59:41 UTC (rev 271647)
+++ trunk/Source/WebCore/ChangeLog	2021-01-20 16:02:01 UTC (rev 271648)
@@ -1,3 +1,15 @@
+2021-01-20  Rob Buis  <rb...@igalia.com>
+
+        Support transferred min/max block size for aspect-ratio
+        https://bugs.webkit.org/show_bug.cgi?id=220224
+
+        Reviewed by Darin Adler.
+
+        Use std::clamp for clarity. Also use structured bindings where possible.
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::constrainLogicalWidthInFragmentByMinMax const):
+
 2021-01-20  Sam Weinig  <wei...@apple.com>
 
         "Remove remaining non-standard CMYKA support from Canvas"

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (271647 => 271648)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2021-01-20 15:59:41 UTC (rev 271647)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2021-01-20 16:02:01 UTC (rev 271648)
@@ -648,9 +648,8 @@
     const RenderStyle& styleToUse = style();
 
     if (shouldComputeLogicalHeightFromAspectRatio()) {
-        LayoutUnit logicalMinWidth, logicalMaxWidth;
-        std::tie(logicalMinWidth, logicalMaxWidth) = computeMinMaxLogicalWidthFromAspectRatio();
-        logicalWidth = std::max(logicalMinWidth, std::min(logicalWidth, logicalMaxWidth));
+        auto [logicalMinWidth, logicalMaxWidth] = computeMinMaxLogicalWidthFromAspectRatio();
+        logicalWidth = std::clamp(logicalWidth, logicalMinWidth, logicalMaxWidth);
     }
 
     if (!styleToUse.logicalMaxWidth().isUndefined())
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to