Changeset 278300 in webkit
- Timestamp:
- Jun 1, 2021, 3:52:26 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
rendering/RenderReplaced.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r278295 r278300 1 2021-05-27 Sergio Villar Senin <svillar@igalia.com> 2 3 Improve if condition in RenderReplaced::computeReplacedLogicalWidth 4 https://bugs.webkit.org/show_bug.cgi?id=226325 5 6 Reviewed by Darin Adler. 7 8 Removed the check for intrinsicRatio as we're already inside a block in which intrinsicRatio 9 is true. Also switched the position of the two conditions in the OR clause as it allows us 10 to remove the check for computedHeightIsAuto. Last but not least, used a ternary operator 11 to initialize the value of boxSizing instead of the if clause. 12 13 No new tests as there is no change in functionality. 14 15 * rendering/RenderReplaced.cpp: 16 (WebCore::RenderReplaced::computeReplacedLogicalWidth const): 17 1 18 2021-05-31 Dean Jackson <dino@apple.com> 2 19 -
trunk/Source/WebCore/rendering/RenderReplaced.cpp
r278253 r278300 562 562 // or if 'width' has a computed value of 'auto', 'height' has some other computed value, and the element does have an intrinsic ratio; then the used value 563 563 // of 'width' is: (used height) * (intrinsic ratio) 564 if ( intrinsicRatio && ((computedHeightIsAuto && !hasIntrinsicWidth && hasIntrinsicHeight) || !computedHeightIsAuto)) {564 if (!computedHeightIsAuto || (!hasIntrinsicWidth && hasIntrinsicHeight)) { 565 565 LayoutUnit estimatedUsedWidth = hasIntrinsicWidth ? LayoutUnit(constrainedSize.width()) : computeConstrainedLogicalWidth(shouldComputePreferred); 566 566 LayoutUnit logicalHeight = computeReplacedLogicalHeight(std::optional<LayoutUnit>(estimatedUsedWidth)); 567 BoxSizing boxSizing = BoxSizing::ContentBox; 568 if (style().hasAspectRatio()) 569 boxSizing = style().boxSizingForAspectRatio(); 567 BoxSizing boxSizing = style().hasAspectRatio() ? style().boxSizingForAspectRatio() : BoxSizing::ContentBox; 570 568 return computeReplacedLogicalWidthRespectingMinMaxWidth(resolveWidthForRatio(borderAndPaddingLogicalHeight(), borderAndPaddingLogicalWidth(), logicalHeight, intrinsicRatio, boxSizing), shouldComputePreferred); 571 569 } 572 570 573 574 571 // If 'height' and 'width' both have computed values of 'auto' and the 575 572 // element has an intrinsic ratio but no intrinsic height or width, then
Note:
See TracChangeset
for help on using the changeset viewer.