Changeset 269921 in webkit


Ignore:
Timestamp:
Nov 17, 2020 1:14:04 PM (3 years ago)
Author:
Alan Bujtas
Message:

[LFC][Integration] Disable percentage type min/max-width/height
https://bugs.webkit.org/show_bug.cgi?id=219045

Reviewed by Antti Koivisto.

The integration layer code does not support them yet.

  • layout/integration/LayoutIntegrationCoverage.cpp:

(WebCore::LayoutIntegration::canUseForChild):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r269918 r269921  
     12020-11-17  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][Integration] Disable percentage type min/max-width/height
     4        https://bugs.webkit.org/show_bug.cgi?id=219045
     5
     6        Reviewed by Antti Koivisto.
     7
     8        The integration layer code does not support them yet.
     9
     10        * layout/integration/LayoutIntegrationCoverage.cpp:
     11        (WebCore::LayoutIntegration::canUseForChild):
     12
    1132020-11-17  Sihui Liu  <sihui_liu@apple.com>
    214
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp

    r269836 r269921  
    580580    }
    581581
     582#if ALLOW_IMAGES || ALLOW_ALL_REPLACED || ALLOW_INLINE_BLOCK
     583    auto isSupportedStyle = [] (const auto& style) {
     584        if (style.verticalAlign() == VerticalAlign::Sub || style.verticalAlign() == VerticalAlign::Super)
     585            return false;
     586        auto& width = style.width();
     587        auto& height = style.height();
     588        if (width.isPercent() || height.isPercent())
     589            return false;
     590        if (width.isAuto() && (style.minWidth().isPercent() || style.maxWidth().isPercent()))
     591            return false;
     592        if (height.isAuto() && (style.minHeight().isPercent() || style.maxHeight().isPercent()))
     593            return false;
     594        return true;
     595    };
     596#endif
    582597#if ALLOW_IMAGES || ALLOW_ALL_REPLACED
    583598    if (is<RenderReplaced>(child)) {
     
    589604            SET_REASON_AND_RETURN_IF_NEEDED(FlowHasNonSupportedChild, reasons, includeReasons);
    590605
    591         auto& style = replaced.style();
    592         if (style.width().isPercent() || style.height().isPercent())
    593             SET_REASON_AND_RETURN_IF_NEEDED(FlowHasNonSupportedChild, reasons, includeReasons);
    594 
    595         if (style.verticalAlign() == VerticalAlign::Sub || style.verticalAlign() == VerticalAlign::Super)
     606        if (!isSupportedStyle(replaced.style()))
    596607            SET_REASON_AND_RETURN_IF_NEEDED(FlowHasNonSupportedChild, reasons, includeReasons);
    597608
     
    620631
    621632        auto& style = block.style();
    622         if (block.style().display() != DisplayType::InlineBlock)
     633        if (!isSupportedStyle(style))
    623634            SET_REASON_AND_RETURN_IF_NEEDED(FlowHasNonSupportedChild, reasons, includeReasons)
    624         if (style.verticalAlign() == VerticalAlign::Sub || style.verticalAlign() == VerticalAlign::Super)
    625             SET_REASON_AND_RETURN_IF_NEEDED(FlowHasNonSupportedChild, reasons, includeReasons);
    626         if (style.width().isPercent() || style.height().isPercent())
    627             SET_REASON_AND_RETURN_IF_NEEDED(FlowHasNonSupportedChild, reasons, includeReasons);
     635        if (style.display() != DisplayType::InlineBlock)
     636            SET_REASON_AND_RETURN_IF_NEEDED(FlowHasNonSupportedChild, reasons, includeReasons)
    628637
    629638        return reasons;
Note: See TracChangeset for help on using the changeset viewer.