Title: [275357] trunk/Source/WebCore
Revision
275357
Author
za...@apple.com
Date
2021-04-01 07:47:52 -0700 (Thu, 01 Apr 2021)

Log Message

Cleanup shouldComputeLogicalWidthFromAspectRatio and shouldComputeLogicalWidthFromAspectRatioAndInsets
https://bugs.webkit.org/show_bug.cgi?id=224044

Reviewed by Antti Koivisto.

Let's use "return foo()" (or "return !foo()") instead of
if (!foo())
  return true;
return false;

* rendering/RenderBox.cpp:
(WebCore::RenderBox::shouldComputeLogicalWidthFromAspectRatio const):
(WebCore::RenderBox::shouldComputeLogicalWidthFromAspectRatioAndInsets const):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (275356 => 275357)


--- trunk/Source/WebCore/ChangeLog	2021-04-01 14:02:09 UTC (rev 275356)
+++ trunk/Source/WebCore/ChangeLog	2021-04-01 14:47:52 UTC (rev 275357)
@@ -1,3 +1,19 @@
+2021-04-01  Zalan Bujtas  <za...@apple.com>
+
+        Cleanup shouldComputeLogicalWidthFromAspectRatio and shouldComputeLogicalWidthFromAspectRatioAndInsets
+        https://bugs.webkit.org/show_bug.cgi?id=224044
+
+        Reviewed by Antti Koivisto.
+
+        Let's use "return foo()" (or "return !foo()") instead of
+        if (!foo())
+          return true;
+        return false;
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::shouldComputeLogicalWidthFromAspectRatio const):
+        (WebCore::RenderBox::shouldComputeLogicalWidthFromAspectRatioAndInsets const):
+
 2021-04-01  Aditya Keerthi  <akeer...@apple.com>
 
         [iOS] '-webkit-appearance: none' is not respected for searchfield decorations

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (275356 => 275357)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2021-04-01 14:02:09 UTC (rev 275356)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2021-04-01 14:47:52 UTC (rev 275357)
@@ -5117,13 +5117,10 @@
     if (shouldIgnoreAspectRatio())
         return false;
 
-    auto isResolvablePercentageHeight = [this] () {
+    auto isResolvablePercentageHeight = [&] {
         return style().logicalHeight().isPercentOrCalculated() && (isOutOfFlowPositioned() || percentageLogicalHeightIsResolvable());
     };
-    if (!hasOverridingLogicalHeight() && !shouldComputeLogicalWidthFromAspectRatioAndInsets() && !style().logicalHeight().isFixed() && !isResolvablePercentageHeight())
-        return false;
-
-    return true;
+    return hasOverridingLogicalHeight() || shouldComputeLogicalWidthFromAspectRatioAndInsets() || style().logicalHeight().isFixed() || isResolvablePercentageHeight();
 }
 
 bool RenderBox::shouldComputeLogicalWidthFromAspectRatioAndInsets() const
@@ -5130,9 +5127,7 @@
 {
     if (!isOutOfFlowPositioned())
         return false;
-    if (style().width().isAuto() && style().height().isAuto() && !style().logicalTop().isAuto() && !style().logicalBottom().isAuto() && (style().logicalLeft().isAuto() || style().logicalRight().isAuto()))
-        return true;
-    return false;
+    return style().width().isAuto() && style().height().isAuto() && !style().logicalTop().isAuto() && !style().logicalBottom().isAuto() && (style().logicalLeft().isAuto() || style().logicalRight().isAuto());
 }
 
 LayoutUnit RenderBox::computeLogicalWidthFromAspectRatio(RenderFragmentContainer* fragment) const
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to