Created attachment 303641 [details] Example to reproduce the issue This seems a bug as a flex/grid item button that is stretched doesn't use the whole space available, it's a bit smaller. Check the attached example, the first button has a size of 200x200; and it's a little bit bigger than the 2nd (flex) and 3rd (grid) buttons which have a size of 196x196.
Once this is fixed, the following test should be passing too: imported/w3c/csswg-test/css-grid-1/grid-items/grid-items-sizing-alignment-001.html
Created attachment 303646 [details] Image diff after running run-webkit-tests This is the image diff if I create a simple layout test like: <!DOCTYPE html> <div style="display: flex; align-items: stretch; width: 200px; height: 200px;"> <button style="flex: 1;">test</button> </div> And use as -expected this: <!DOCTYPE html> <button style="width: 200px; height: 200px;">test</button>
It seems that WebKit adds some margin to each side of a button if the size property in that axis is intrinsic and no margin declaration has been set: static void addIntrinsicMargins(RenderStyle& style) { // Intrinsic margin value. const int intrinsicMargin = clampToInteger(2 * style.effectiveZoom()); // FIXME: Using width/height alone and not also dealing with min-width/max-width is flawed. // FIXME: Using "hasQuirk" to decide the margin wasn't set is kind of lame. if (style.width().isIntrinsicOrAuto()) { if (style.marginLeft().hasQuirk()) style.setMarginLeft(Length(intrinsicMargin, Fixed)); if (style.marginRight().hasQuirk()) style.setMarginRight(Length(intrinsicMargin, Fixed)); } if (style.height().isAuto()) { if (style.marginTop().hasQuirk()) style.setMarginTop(Length(intrinsicMargin, Fixed)); if (style.marginBottom().hasQuirk()) style.setMarginBottom(Length(intrinsicMargin, Fixed)); } } I think the easiest solution is adding 'margin: 0' to the test.
Created attachment 400447 [details] Patch
Comment on attachment 400447 [details] Patch Thanks, r=me
I guess I will have to disable the test in iOS, https://ews-build.webkit.org/results/iOS-13-Simulator-WK2-Tests-EWS/r400447-18600/results.html
(In reply to Oriol Brufau from comment #6) > I guess I will have to disable the test in iOS, > https://ews-build.webkit.org/results/iOS-13-Simulator-WK2-Tests-EWS/r400447- > 18600/results.html Sounds good to me.
Created attachment 400509 [details] Patch
Created attachment 400617 [details] Patch
This patch modifies the imported WPT tests. Please ensure that any changes on the tests are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
I don't get how the patch can make api-gtk fail, let's see if the rebase fixes it.
Committed r262333: <https://trac.webkit.org/changeset/262333> All reviewed patches have been landed. Closing bug and clearing flags on attachment 400617 [details].
<rdar://problem/63782652>