Changeset 273958 in webkit


Ignore:
Timestamp:
Mar 5, 2021 2:54:42 AM (17 months ago)
Author:
svillar@igalia.com
Message:

[css-flexbox] Fix mainAxisLengthIsDefinite for orthogonal items with percentage sizes
https://bugs.webkit.org/show_bug.cgi?id=222684

Reviewed by Javier Fernandez.

Source/WebCore:

r260055 fixed a crash in flexbox code by not caching the definiteness of the logical height of the flexbox
container in case of having orthogonal items because in that case, the logical heights of the flex container
and the flex item are not in the same axis. That made a lot of sense, however we should still let the method
return whether or not the child main axis is definite instead of unconditionally return false.

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::childMainSizeIsDefinite const):

LayoutTests:

  • TestExpectations: Unskipped flexbox-basic-canvas-vert-001v.xhtml which is now passing.
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r273957 r273958  
     12021-03-03  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        [css-flexbox] Fix mainAxisLengthIsDefinite for orthogonal items with percentage sizes
     4        https://bugs.webkit.org/show_bug.cgi?id=222684
     5
     6        Reviewed by Javier Fernandez.
     7
     8        * TestExpectations: Unskipped flexbox-basic-canvas-vert-001v.xhtml which is now passing.
     9
    1102021-03-05  Imanol Fernandez  <ifernandez@igalia.com>
    211
  • trunk/LayoutTests/TestExpectations

    r273955 r273958  
    40644064webkit.org/b/221482 imported/w3c/web-platform-tests/css/css-flexbox/flexbox-paint-ordering-002.xhtml [ ImageOnlyFailure ]
    40654065
    4066 # Misc elements as flex items.
    4067 webkit.org/b/136754 imported/w3c/web-platform-tests/css/css-flexbox/flexbox-basic-canvas-vert-001v.xhtml [ ImageOnlyFailure ]
    4068 
    40694066# Test ASSERTing in Debug.
    40704067webkit.org/b/222711 [ Debug ] imported/w3c/web-platform-tests/css/css-flexbox/frameset-crash.html [ Skip ]
  • trunk/Source/WebCore/ChangeLog

    r273957 r273958  
     12021-03-03  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        [css-flexbox] Fix mainAxisLengthIsDefinite for orthogonal items with percentage sizes
     4        https://bugs.webkit.org/show_bug.cgi?id=222684
     5
     6        Reviewed by Javier Fernandez.
     7
     8        r260055 fixed a crash in flexbox code by not caching the definiteness of the logical height of the flexbox
     9        container in case of having orthogonal items because in that case, the logical heights of the flex container
     10        and the flex item are not in the same axis. That made a lot of sense, however we should still let the method
     11        return whether or not the child main axis is definite instead of unconditionally return false.
     12
     13        * rendering/RenderFlexibleBox.cpp:
     14        (WebCore::RenderFlexibleBox::childMainSizeIsDefinite const):
     15
    1162021-03-05  Imanol Fernandez  <ifernandez@igalia.com>
    217
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r273955 r273958  
    850850        if (m_hasDefiniteHeight == SizeDefiniteness::Indefinite)
    851851            return false;
    852         // Do not cache the definite height state when the child is perpendicular.
    853         // The height of a perpendicular child is resolved against the containing block's width which is not the main axis.
    854         if (child.isHorizontalWritingMode() != isHorizontalWritingMode())
    855             return false;
    856         bool definite = child.computePercentageLogicalHeight(flexBasis) != WTF::nullopt;
    857         if (m_inLayout) {
    858             // We can reach this code even while we're not laying ourselves out, such
    859             // as from mainSizeForPercentageResolution.
     852        bool definite = child.computePercentageLogicalHeight(flexBasis).hasValue();
     853        // Do not cache the definite height state with orthogonal children as in that case the logical height
     854        // of the child is not in the same axis as the logical height of the flex container. Also do not cache it
     855        // outside the layout process (we can reach this code as from mainSizeForPercentageResolution()).
     856        if (m_inLayout && (isHorizontalWritingMode() == child.isHorizontalWritingMode()))
    860857            m_hasDefiniteHeight = definite ? SizeDefiniteness::Definite : SizeDefiniteness::Indefinite;
    861         }
     858
    862859        return definite;
    863860    }
Note: See TracChangeset for help on using the changeset viewer.