Changeset 271129 in webkit


Ignore:
Timestamp:
Jan 4, 2021 3:27:44 AM (19 months ago)
Author:
svillar@igalia.com
Message:

Intrinsic size not correctly stored for SVG images
https://bugs.webkit.org/show_bug.cgi?id=219981

Reviewed by Darin Adler.

Source/WebCore:

Intrinsic sizes were only stored in case the replaced element had an intrinsic size for both height and width.
However it's pretty common for SVG images to only specify one of them and an aspect ratio. We should store it
in those cases too as it'd be useful for some layout systems like flexbox.

  • rendering/RenderReplaced.cpp:

(WebCore::RenderReplaced::computeAspectRatioInformationForRenderBox const): Replace isEmpty() by isZero() calls to allow
incomplete intrinsic sizes to be stored.

LayoutTests:

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r271127 r271129  
     12020-12-17  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        Intrinsic size not correctly stored for SVG images
     4        https://bugs.webkit.org/show_bug.cgi?id=219981
     5
     6        Reviewed by Darin Adler.
     7
     8        * TestExpectations: Removed two flexbox aspect ratio tests that are now passing.
     9
    1102021-01-03  Rob Buis  <rbuis@igalia.com>
    211
  • trunk/LayoutTests/TestExpectations

    r271061 r271129  
    39193919
    39203920webkit.org/b/219343 imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-column-012.html [ ImageOnlyFailure ]
    3921 webkit.org/b/219343 imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-column-013.html [ ImageOnlyFailure ]
    39223921webkit.org/b/219343 imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-column-015.html [ ImageOnlyFailure ]
    39233922webkit.org/b/219343 imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-column-017.html [ ImageOnlyFailure ]
    39243923webkit.org/b/219343 imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-row-007.html [ ImageOnlyFailure ]
    3925 webkit.org/b/219343 imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-row-009.html [ ImageOnlyFailure ]
    39263924webkit.org/b/219343 imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-row-010.html [ ImageOnlyFailure ]
    39273925webkit.org/b/219343 imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-row-013.html [ ImageOnlyFailure ]
  • trunk/Source/WebCore/ChangeLog

    r271128 r271129  
     12020-12-17  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        Intrinsic size not correctly stored for SVG images
     4        https://bugs.webkit.org/show_bug.cgi?id=219981
     5
     6        Reviewed by Darin Adler.
     7
     8        Intrinsic sizes were only stored in case the replaced element had an intrinsic size for both height and width.
     9        However it's pretty common for SVG images to only specify one of them and an aspect ratio. We should store it
     10        in those cases too as it'd be useful for some layout systems like flexbox.
     11
     12        * rendering/RenderReplaced.cpp:
     13        (WebCore::RenderReplaced::computeAspectRatioInformationForRenderBox const): Replace isEmpty() by isZero() calls to allow
     14        incomplete intrinsic sizes to be stored.
     15
    1162021-01-04  Alicia Boya García  <aboya@igalia.com>
    217
  • trunk/Source/WebCore/rendering/RenderReplaced.cpp

    r271003 r271129  
    405405        // constrain the size below, the correct intrinsic size will be obtained for comparison against
    406406        // min and max widths.
    407         if (intrinsicRatio && !intrinsicSize.isEmpty())
     407        if (intrinsicRatio && !intrinsicSize.isZero())
    408408            m_intrinsicSize = LayoutSize(intrinsicSize);
    409409
     
    415415    } else {
    416416        computeIntrinsicRatioInformation(intrinsicSize, intrinsicRatio);
    417         if (intrinsicRatio && !intrinsicSize.isEmpty())
     417        if (intrinsicRatio && !intrinsicSize.isZero())
    418418            m_intrinsicSize = LayoutSize(isHorizontalWritingMode() ? intrinsicSize : intrinsicSize.transposedSize());
    419419    }
Note: See TracChangeset for help on using the changeset viewer.