⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 236133 in webkit


Ignore:
Timestamp:
Sep 18, 2018, 8:39:47 AM (8 years ago)
Author:
Carlos Garcia Campos
Message:

Merge r235590 - REGRESSION (r191336): RenderFlexibleBox::adjustChildSizeForMinAndMax crashes in std::optional<>::value()
https://bugs.webkit.org/show_bug.cgi?id=189232
<rdar://problem/43886373>

Reviewed by Brent Fulgham.

Source/WebCore:

It's not guaranteed that RenderFlexibleBox::computeMainAxisExtentForChild() always returns with a valid value.

Test: fast/flexbox/crash-when-min-max-content-is-not-computed.html

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):

LayoutTests:

  • fast/flexbox/crash-when-min-max-content-is-not-computed-expected.txt: Added.
  • fast/flexbox/crash-when-min-max-content-is-not-computed.html: Added.
Location:
releases/WebKitGTK/webkit-2.22
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.22/LayoutTests/ChangeLog

    r236130 r236133  
     12018-09-02  Zalan Bujtas  <zalan@apple.com>
     2
     3        REGRESSION (r191336): RenderFlexibleBox::adjustChildSizeForMinAndMax crashes in std::optional<>::value()
     4        https://bugs.webkit.org/show_bug.cgi?id=189232
     5        <rdar://problem/43886373>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        * fast/flexbox/crash-when-min-max-content-is-not-computed-expected.txt: Added.
     10        * fast/flexbox/crash-when-min-max-content-is-not-computed.html: Added.
     11
    1122018-08-31  John Wilander  <wilander@apple.com>
    213
  • releases/WebKitGTK/webkit-2.22/Source/WebCore/ChangeLog

    r236131 r236133  
     12018-09-02  Zalan Bujtas  <zalan@apple.com>
     2
     3        REGRESSION (r191336): RenderFlexibleBox::adjustChildSizeForMinAndMax crashes in std::optional<>::value()
     4        https://bugs.webkit.org/show_bug.cgi?id=189232
     5        <rdar://problem/43886373>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        It's not guaranteed that RenderFlexibleBox::computeMainAxisExtentForChild() always returns with a valid value.
     10
     11        Test: fast/flexbox/crash-when-min-max-content-is-not-computed.html
     12
     13        * rendering/RenderFlexibleBox.cpp:
     14        (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
     15
    1162018-08-31  Jer Noble  <jer.noble@apple.com>
    217
  • releases/WebKitGTK/webkit-2.22/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r232018 r236133  
    10881088        // produces reasonable results. Tracking bug: https://crbug.com/581553
    10891089        // css-flexbox section 4.5
    1090         LayoutUnit contentSize = computeMainAxisExtentForChild(child, MinSize, Length(MinContent)).value();
     1090        // FIXME: If the min value is expected to be valid here, we need to come up with a non optional version of computeMainAxisExtentForChild and
     1091        // ensure it's valid through the virtual calls of computeIntrinsicLogicalContentHeightUsing.
     1092        LayoutUnit contentSize = computeMainAxisExtentForChild(child, MinSize, Length(MinContent)).value_or(0);
    10911093        ASSERT(contentSize >= 0);
    10921094        if (child.hasAspectRatio() && child.intrinsicSize().height() > 0)
     
    10961098        Length mainSize = isHorizontalFlow() ? child.style().width() : child.style().height();
    10971099        if (mainAxisLengthIsDefinite(child, mainSize)) {
    1098             LayoutUnit resolvedMainSize = computeMainAxisExtentForChild(child, MainOrPreferredSize, mainSize).value();
     1100            LayoutUnit resolvedMainSize = computeMainAxisExtentForChild(child, MainOrPreferredSize, mainSize).value_or(0);
    10991101            ASSERT(resolvedMainSize >= 0);
    11001102            LayoutUnit specifiedSize = std::min(resolvedMainSize, maxExtent.value_or(resolvedMainSize));
Note: See TracChangeset for help on using the changeset viewer.