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

Changeset 277325 in webkit


Ignore:
Timestamp:
May 11, 2021, 8:33:13 AM (5 years ago)
Author:
Alan Bujtas
Message:

REGRESSION(r275515): wpt/quirks/blocks-ignore-line-height.html
https://bugs.webkit.org/show_bug.cgi?id=225591
<rdar://problem/77766308>

Reviewed by Antti Koivisto.

Source/WebCore:

Replace the generic line height quirk with a list-item specific one.
The original quirk was added to cover fast/lists/list-item-line-height.html but it looks like
it only needs a list-item specific quirk. This is copied from legacy line layout (see InlineFlowBox c'tor).

Test: fast/inline/line-height-in-non-standards-mode.html

  • layout/formattingContexts/inline/InlineFormattingContextQuirks.cpp:

(WebCore::Layout::InlineFormattingContext::Quirks::inlineLevelBoxAffectsLineBox const):

  • layout/integration/LayoutIntegrationBoxTree.cpp:

(WebCore::LayoutIntegration::rootBoxStyle):

  • rendering/style/RenderStyle.h:

(WebCore::RenderStyle::isOriginalDisplayListItemType const):
(WebCore::RenderStyle::isDisplayListItemType):

LayoutTests:

  • fast/inline/incorrect-middle-baseline-alignment-with-line-height-expected.html: progression.
  • fast/inline/line-height-in-non-standards-mode-expected.html: Added.
  • fast/inline/line-height-in-non-standards-mode.html: Added.
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r277321 r277325  
     12021-05-11  Zalan Bujtas  <zalan@apple.com>
     2
     3        REGRESSION(r275515): wpt/quirks/blocks-ignore-line-height.html
     4        https://bugs.webkit.org/show_bug.cgi?id=225591
     5        <rdar://problem/77766308>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        * fast/inline/incorrect-middle-baseline-alignment-with-line-height-expected.html: progression.
     10        * fast/inline/line-height-in-non-standards-mode-expected.html: Added.
     11        * fast/inline/line-height-in-non-standards-mode.html: Added.
     12
    1132021-05-11  Cathie Chen  <cathiechen@igalia.com>
    214
  • trunk/LayoutTests/fast/inline/incorrect-middle-baseline-alignment-with-line-height-expected.html

    r276767 r277325  
    44  font-size: 20px;
    55  background-color: green;
    6   height: 112px;
     6  height: 110px;
    77  padding-top: 90px;
    88}
  • trunk/Source/WebCore/ChangeLog

    r277323 r277325  
     12021-05-11  Zalan Bujtas  <zalan@apple.com>
     2
     3        REGRESSION(r275515): wpt/quirks/blocks-ignore-line-height.html
     4        https://bugs.webkit.org/show_bug.cgi?id=225591
     5        <rdar://problem/77766308>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Replace the generic line height quirk with a list-item specific one.
     10        The original quirk was added to cover fast/lists/list-item-line-height.html but it looks like
     11        it only needs a list-item specific quirk. This is copied from legacy line layout (see InlineFlowBox c'tor).
     12
     13        Test: fast/inline/line-height-in-non-standards-mode.html
     14
     15        * layout/formattingContexts/inline/InlineFormattingContextQuirks.cpp:
     16        (WebCore::Layout::InlineFormattingContext::Quirks::inlineLevelBoxAffectsLineBox const):
     17        * layout/integration/LayoutIntegrationBoxTree.cpp:
     18        (WebCore::LayoutIntegration::rootBoxStyle):
     19        * rendering/style/RenderStyle.h:
     20        (WebCore::RenderStyle::isOriginalDisplayListItemType const):
     21        (WebCore::RenderStyle::isDisplayListItemType):
     22
    1232021-05-11  Zalan Bujtas  <zalan@apple.com>
    224
  • trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContextQuirks.cpp

    r276886 r277325  
    7474            return true;
    7575        if (inlineLevelBox.isRootInlineBox()) {
    76             auto shouldRootInlineBoxWithNoContentStretchLineBox = [&] {
    77                 if (inlineLevelBox.layoutBox().style().lineHeight().isNegative())
    78                     return false;
    79                 // The root inline box with non-initial line height value stretches the line box even when root has no content
    80                 // but there's at least one inline box with content.
    81                 // e.g. <div style="line-height: 100px;"><span>content</span></div>
    82                 if (!lineBox.hasInlineBox())
    83                     return false;
    84                 for (auto& inlineLevelBox : lineBox.nonRootInlineLevelBoxes()) {
    85                     if (!inlineLevelBox.isInlineBox())
    86                         continue;
    87                     if (inlineLevelBox.hasContent())
    88                         return true;
    89                 }
    90                 return false;
    91             };
    92             return shouldRootInlineBoxWithNoContentStretchLineBox();
     76            // This root inline box has no direct text content and we are in non-standards mode.
     77            // Now according to legacy line layout, we need to apply the following list-item specific quirk:
     78            // We do not create markers for list items when the list-style-type is none, while other browsers do.
     79            // The side effect of having no marker is that in quirks mode we have to specifically check for list-item
     80            // and make sure it is treated as if it had content and stretched the line.
     81            // see InlineFlowBox c'tor.
     82            return inlineLevelBox.layoutBox().style().isOriginalDisplayListItemType();
    9383        }
    9484        // Non-root inline boxes (e.g. <span>).
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.cpp

    r276216 r277325  
    4747{
    4848    auto clonedStyle = RenderStyle::clone(style);
    49     clonedStyle.setDisplay(DisplayType::Block);
     49    clonedStyle.setEffectiveDisplay(DisplayType::Block);
    5050    return clonedStyle;
    5151}
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r277321 r277325  
    15011501    bool isDisplayFlexibleOrGridBox() const { return isDisplayFlexibleOrGridBox(display()); }
    15021502    bool isDisplayRegionType() const;
     1503    bool isOriginalDisplayListItemType() const { return isDisplayListItemType(originalDisplay()); }
    15031504
    15041505    bool setWritingMode(WritingMode);
     
    19661967    static bool isDisplayGridBox(DisplayType);
    19671968    static bool isDisplayFlexibleOrGridBox(DisplayType);
     1969    static bool isDisplayListItemType(DisplayType);
    19681970
    19691971    static LayoutBoxExtent shadowExtent(const ShadowData*);
     
    23692371}
    23702372
     2373inline bool RenderStyle::isDisplayListItemType(DisplayType display)
     2374{
     2375    return display == DisplayType::ListItem;
     2376}
     2377
    23712378inline bool RenderStyle::hasAnyPublicPseudoStyles() const
    23722379{
Note: See TracChangeset for help on using the changeset viewer.