Changeset 265851 in webkit


Ignore:
Timestamp:
Aug 19, 2020 6:33:37 AM (4 years ago)
Author:
svillar@igalia.com
Message:

<button> should support display:inline-grid/grid/inline-flex/flex correctly
https://bugs.webkit.org/show_bug.cgi?id=209656

Reviewed by Javier Fernandez.

LayoutTests/imported/w3c:

Replaced FAIL expectation by PASS one. Both tests should pass now with no failures.

  • web-platform-tests/html/rendering/widgets/button-layout/flex-expected.txt:
  • web-platform-tests/html/rendering/widgets/button-layout/grid-expected.txt:

Source/WebCore:

Button elements with display type (inline-) flex or grid should be laid out as their
display type states and not as buttons. That's mentioned in the HTML spec here
https://html.spec.whatwg.org/multipage/rendering.html#button-layout.

  • html/HTMLButtonElement.cpp:

(WebCore::HTMLButtonElement::createElementRenderer): let HTMLFormControlElement create
a renderer instead of using a RenderButton whenever display is (inline-)grid/flex.

LayoutTests:

  • platform/gtk/imported/w3c/web-platform-tests/html/rendering/widgets/button-layout/flex-expected.txt: Removed.
  • platform/gtk/imported/w3c/web-platform-tests/html/rendering/widgets/button-layout/grid-expected.txt: Removed.
  • platform/ios-wk2/imported/w3c/web-platform-tests/html/rendering/widgets/button-layout/flex-expected.txt: Removed.
  • platform/ios-wk2/imported/w3c/web-platform-tests/html/rendering/widgets/button-layout/grid-expected.txt: Removed.
  • platform/wpe/imported/w3c/web-platform-tests/html/rendering/widgets/button-layout/flex-expected.txt: Removed.
  • platform/wpe/imported/w3c/web-platform-tests/html/rendering/widgets/button-layout/grid-expected.txt: Removed.
Location:
trunk
Files:
6 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r265849 r265851  
     12020-08-18  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        <button> should support display:inline-grid/grid/inline-flex/flex correctly
     4        https://bugs.webkit.org/show_bug.cgi?id=209656
     5
     6        Reviewed by Javier Fernandez.
     7
     8        * platform/gtk/imported/w3c/web-platform-tests/html/rendering/widgets/button-layout/flex-expected.txt: Removed.
     9        * platform/gtk/imported/w3c/web-platform-tests/html/rendering/widgets/button-layout/grid-expected.txt: Removed.
     10        * platform/ios-wk2/imported/w3c/web-platform-tests/html/rendering/widgets/button-layout/flex-expected.txt: Removed.
     11        * platform/ios-wk2/imported/w3c/web-platform-tests/html/rendering/widgets/button-layout/grid-expected.txt: Removed.
     12        * platform/wpe/imported/w3c/web-platform-tests/html/rendering/widgets/button-layout/flex-expected.txt: Removed.
     13        * platform/wpe/imported/w3c/web-platform-tests/html/rendering/widgets/button-layout/grid-expected.txt: Removed.
     14
    1152020-08-19  Diego Pino Garcia  <dpino@igalia.com>
    216
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r265845 r265851  
     12020-08-18  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        <button> should support display:inline-grid/grid/inline-flex/flex correctly
     4        https://bugs.webkit.org/show_bug.cgi?id=209656
     5
     6        Reviewed by Javier Fernandez.
     7
     8        Replaced FAIL expectation by PASS one. Both tests should pass now with no failures.
     9
     10        * web-platform-tests/html/rendering/widgets/button-layout/flex-expected.txt:
     11        * web-platform-tests/html/rendering/widgets/button-layout/grid-expected.txt:
     12
    1132020-08-18  Chris Dumez  <cdumez@apple.com>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/rendering/widgets/button-layout/flex-expected.txt

    r264117 r265851  
    2121PASS inline-flex
    2222PASS flex
    23 FAIL align-items:flex-start should work assert_equals: expected 84 but got 74
    24 FAIL align-items:stretch should work assert_equals: expected 13 but got 33
     23PASS align-items:flex-start should work
     24PASS align-items:stretch should work
    2525
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/rendering/widgets/button-layout/grid-expected.txt

    r249886 r265851  
    15154
    1616
    17 FAIL inline-grid assert_equals: clientWidth expected 26 but got 19
    18 FAIL grid assert_equals: clientWidth expected 26 but got 19
     17PASS inline-grid
     18PASS grid
    1919
  • trunk/Source/WebCore/ChangeLog

    r265850 r265851  
     12020-08-18  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        <button> should support display:inline-grid/grid/inline-flex/flex correctly
     4        https://bugs.webkit.org/show_bug.cgi?id=209656
     5
     6        Reviewed by Javier Fernandez.
     7
     8        Button elements with display type (inline-) flex or grid should be laid out as their
     9        display type states and not as buttons. That's mentioned in the HTML spec here
     10        https://html.spec.whatwg.org/multipage/rendering.html#button-layout.
     11
     12        * html/HTMLButtonElement.cpp:
     13        (WebCore::HTMLButtonElement::createElementRenderer): let HTMLFormControlElement create
     14        a renderer instead of using a RenderButton whenever display is (inline-)grid/flex.
     15
    1162020-08-19  Sergio Villar Senin  <svillar@igalia.com>
    217
  • trunk/Source/WebCore/html/HTMLButtonElement.cpp

    r261013 r265851  
    6161}
    6262
    63 RenderPtr<RenderElement> HTMLButtonElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&)
    64 {
     63RenderPtr<RenderElement> HTMLButtonElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition& position)
     64{
     65    // https://html.spec.whatwg.org/multipage/rendering.html#button-layout
     66    DisplayType display = style.display();
     67    if (display == DisplayType::InlineGrid || display == DisplayType::Grid || display == DisplayType::InlineFlex || display == DisplayType::Flex)
     68        return HTMLFormControlElement::createElementRenderer(WTFMove(style), position);
    6569    return createRenderer<RenderButton>(*this, WTFMove(style));
    6670}
Note: See TracChangeset for help on using the changeset viewer.