Changeset 276228 in webkit
- Timestamp:
- Apr 18, 2021, 5:45:33 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/RenderReplaced.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r276216 r276228 1 2021-04-18 Cathie Chen <cathiechen@igalia.com> 2 3 The implicit aspect-ratio from width and height attributes with float value is not accurate enough 4 https://bugs.webkit.org/show_bug.cgi?id=224664 5 6 Reviewed by Darin Adler. 7 8 The aspect ratio test case with width "0.8" and height "0.2" in img-aspect-ratio.html has passed. This patch doesn't change the behavior of 9 the original aspect ratio test case(`assert_ratio(images[5], 133/106)`) which is related to bug 206161. 10 11 * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio-expected.txt: 12 1 13 2021-04-17 Tim Nguyen <ntim@apple.com> 2 14 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio-expected.txt
r267646 r276228 1 1 2 2 3 FAIL Image width and height attributes are used to infer aspect-ratio assert_approx_equals: expected 4 +/- 0.001 but got 4.1666666666666673 FAIL Image width and height attributes are used to infer aspect-ratio assert_approx_equals: expected 1.2547169811320755 +/- 0.001 but got 1.25 4 4 -
trunk/Source/WebCore/ChangeLog
r276225 r276228 1 2021-04-18 Cathie Chen <cathiechen@igalia.com> 2 3 The implicit aspect-ratio from width and height attributes with float value is not accurate enough 4 https://bugs.webkit.org/show_bug.cgi?id=224664 5 6 Reviewed by Darin Adler. 7 8 The width and height attributes should impact the aspect ratio only not the intrinsic size which should be from the content. 9 Since computeAspectRatioInformationForRenderBox doesn't change the intrinsic size now, so we can remove it from computePreferredLogicalWidths. 10 11 * rendering/RenderReplaced.cpp: 12 (WebCore::RenderReplaced::computeIntrinsicRatioInformation const): Width and height attributes change intrinsicRatio only, not intrinsicSize. 13 (WebCore::RenderReplaced::computePreferredLogicalWidths): computeAspectRatioInformationForRenderBox doesn't change intrinsicSize now, so we can remove this. 14 1 15 2021-04-17 Yusuke Suzuki <ysuzuki@apple.com> 2 16 -
trunk/Source/WebCore/rendering/RenderReplaced.cpp
r275772 r276228 503 503 return; 504 504 505 intrinsicSize.setWidth(parseValidHTMLFloatingPointNumber(node->getAttribute(HTMLNames::widthAttr)).valueOr(0)); 506 intrinsicSize.setHeight(parseValidHTMLFloatingPointNumber(node->getAttribute(HTMLNames::heightAttr)).valueOr(0)); 507 if (intrinsicSize.isEmpty()) 508 return; 505 double attributeWidth = parseValidHTMLFloatingPointNumber(node->getAttribute(HTMLNames::widthAttr)).valueOr(0); 506 double attributeHeight = parseValidHTMLFloatingPointNumber(node->getAttribute(HTMLNames::heightAttr)).valueOr(0); 507 if (attributeWidth > 0 && attributeHeight > 0) 508 intrinsicRatio = attributeWidth / attributeHeight; 509 return; 509 510 } 510 511 … … 673 674 // We cannot resolve any percent logical width here as the available logical 674 675 // width may not be set on our containing block. 675 if (style().logicalWidth().isPercentOrCalculated()) { 676 double intrinsicRatio = 0; 677 FloatSize constrainedSize; 678 // For images with explicit width/height this updates the instrinsic size as a side effect. 679 computeAspectRatioInformationForRenderBox(embeddedContentBox(), constrainedSize, intrinsicRatio); 680 676 if (style().logicalWidth().isPercentOrCalculated()) 681 677 computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth); 682 }else678 else 683 679 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = computeReplacedLogicalWidth(ComputePreferred); 684 680
Note:
See TracChangeset
for help on using the changeset viewer.