Changeset 278280 in webkit


Ignore:
Timestamp:
May 31, 2021 9:18:03 AM (14 months ago)
Author:
svillar@igalia.com
Message:

Enable <summary> to be a flex container
https://bugs.webkit.org/show_bug.cgi?id=190065

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Imported several WPT tests adding coverage for <summary> as grid/flex.

  • resources/import-expectations.json:
  • resources/resource-files.json:
  • web-platform-tests/html/rendering/the-details-element/details-blockification-expected.txt: Added.
  • web-platform-tests/html/rendering/the-details-element/details-blockification.html: Added.
  • web-platform-tests/html/rendering/the-details-element/summary-display-flex-expected.html: Added.
  • web-platform-tests/html/rendering/the-details-element/summary-display-flex.html: Added.
  • web-platform-tests/html/rendering/the-details-element/summary-display-grid-expected.html: Added.
  • web-platform-tests/html/rendering/the-details-element/summary-display-grid.html: Added.
  • web-platform-tests/html/rendering/the-details-element/summary-display-inline-flex-expected.html: Added.
  • web-platform-tests/html/rendering/the-details-element/summary-display-inline-flex.html: Added.
  • web-platform-tests/html/rendering/the-details-element/summary-display-inline-grid-expected.html: Added.
  • web-platform-tests/html/rendering/the-details-element/summary-display-inline-grid.html: Added.
  • web-platform-tests/html/rendering/the-details-element/summary-in-ol-expected.html: Added.
  • web-platform-tests/html/rendering/the-details-element/summary-in-ol.html: Added.
  • web-platform-tests/html/rendering/the-details-element/w3c-import.log:

Source/WebCore:

Create grid or flex renderers for <summary> elements whenever display: {inline}-{grid|flex}
is specified. All vendors but WebKit allowed it so it should be good for interoperability.

  • html/HTMLSummaryElement.cpp:

(WebCore::HTMLSummaryElement::createElementRenderer): create the renderer specifying
RenderElement::OnlyCreateBlockAndFlexboxRenderers.

  • rendering/RenderElement.cpp:

(WebCore::RenderElement::createFor): do not create a RenderListItem for <summary> if display:list-item
is used because they're already list items. Let it fallthrough to RenderBlockFlow creation.

Location:
trunk
Files:
12 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r278194 r278280  
     12021-04-29  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        Enable <summary> to be a flex container
     4        https://bugs.webkit.org/show_bug.cgi?id=190065
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Imported several WPT tests adding coverage for <summary> as grid/flex.
     9
     10        * resources/import-expectations.json:
     11        * resources/resource-files.json:
     12        * web-platform-tests/html/rendering/the-details-element/details-blockification-expected.txt: Added.
     13        * web-platform-tests/html/rendering/the-details-element/details-blockification.html: Added.
     14        * web-platform-tests/html/rendering/the-details-element/summary-display-flex-expected.html: Added.
     15        * web-platform-tests/html/rendering/the-details-element/summary-display-flex.html: Added.
     16        * web-platform-tests/html/rendering/the-details-element/summary-display-grid-expected.html: Added.
     17        * web-platform-tests/html/rendering/the-details-element/summary-display-grid.html: Added.
     18        * web-platform-tests/html/rendering/the-details-element/summary-display-inline-flex-expected.html: Added.
     19        * web-platform-tests/html/rendering/the-details-element/summary-display-inline-flex.html: Added.
     20        * web-platform-tests/html/rendering/the-details-element/summary-display-inline-grid-expected.html: Added.
     21        * web-platform-tests/html/rendering/the-details-element/summary-display-inline-grid.html: Added.
     22        * web-platform-tests/html/rendering/the-details-element/summary-in-ol-expected.html: Added.
     23        * web-platform-tests/html/rendering/the-details-element/summary-in-ol.html: Added.
     24        * web-platform-tests/html/rendering/the-details-element/w3c-import.log:
     25
    1262021-05-28  Rob Buis  <rbuis@igalia.com>
    227
  • trunk/LayoutTests/imported/w3c/resources/resource-files.json

    r277091 r278280  
    7777        "csswg-test/WOFF2-UserAgent/Tests/xhtml1/support/available-001b.xht",
    7878        "csswg-test/WOFF2-UserAgent/Tests/xhtml1/testcaseindex.xht",
     79        "html/rendering/the-details-element/empty-crash.html",
     80        "html/rendering/the-details-element/single-summary.html",
    7981        "shadow-dom/declarative/support/declarative-child-frame.html",
    8082        "shadow-dom/event-on-pseudo-element-crash.html",
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/w3c-import.log

    r264117 r278280  
    1919/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/details-before-expected.html
    2020/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/details-before.html
     21/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/details-blockification.html
    2122/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/details-display-property-is-ignored-expected.html
    2223/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/details-display-property-is-ignored.html
     
    3132/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/empty-crash.html
    3233/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/single-summary.html
     34/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/summary-display-flex-expected.html
     35/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/summary-display-flex.html
     36/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/summary-display-grid-expected.html
     37/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/summary-display-grid.html
     38/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/summary-display-inline-flex-expected.html
     39/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/summary-display-inline-flex.html
     40/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/summary-display-inline-grid-expected.html
     41/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/summary-display-inline-grid.html
    3342/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/summary-display-list-item-expected.html
    3443/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/summary-display-list-item.html
     44/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/summary-in-ol-expected.html
     45/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/summary-in-ol.html
    3546/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/summary-text-decoration-expected.html
    3647/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/summary-text-decoration.html
  • trunk/Source/WebCore/ChangeLog

    r278279 r278280  
     12021-04-29  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        Enable <summary> to be a flex container
     4        https://bugs.webkit.org/show_bug.cgi?id=190065
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Create grid or flex renderers for <summary> elements whenever display: {inline}-{grid|flex}
     9        is specified. All vendors but WebKit allowed it so it should be good for interoperability.
     10
     11        * html/HTMLSummaryElement.cpp:
     12        (WebCore::HTMLSummaryElement::createElementRenderer): create the renderer specifying
     13        RenderElement::OnlyCreateBlockAndFlexboxRenderers.
     14        * rendering/RenderElement.cpp:
     15        (WebCore::RenderElement::createFor): do not create a RenderListItem for <summary> if display:list-item
     16        is used because they're already list items. Let it fallthrough to RenderBlockFlow creation.
     17
    1182021-05-31  Alan Bujtas  <zalan@apple.com>
    219
  • trunk/Source/WebCore/html/HTMLSummaryElement.cpp

    r249237 r278280  
    6666RenderPtr<RenderElement> HTMLSummaryElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&)
    6767{
    68     return createRenderer<RenderBlockFlow>(*this, WTFMove(style));
     68    return RenderElement::createFor(*this, WTFMove(style), RenderElement::OnlyCreateBlockAndFlexboxRenderers);
    6969}
    7070
  • trunk/Source/WebCore/rendering/RenderElement.cpp

    r277949 r278280  
    173173        return createRenderer<RenderBlockFlow>(element, WTFMove(style));
    174174    case DisplayType::ListItem:
    175         return createRenderer<RenderListItem>(element, WTFMove(style));
     175        // <summary> elements with display:list-item should not be rendered as list items because
     176        // they'd end up with two markers before the text (one from summary element and the other as
     177        // a list item). Let them fallthrough in that case so they will create a RenderFlexibleBox.
     178        if (creationType == CreateAllRenderers)
     179            return createRenderer<RenderListItem>(element, WTFMove(style));
     180        FALLTHROUGH;
    176181    case DisplayType::Flex:
    177182    case DisplayType::InlineFlex:
Note: See TracChangeset for help on using the changeset viewer.