Bug 117436
Summary: | Correctly calculate auto margins for column flows | ||
---|---|---|---|
Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> |
Component: | Layout and Rendering | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | ahmad.saleem792, ap, bfulgham, dino, hyatt, webkit-bug-importer, zalan |
Priority: | P2 | Keywords: | BlinkMergeCandidate, InRadar |
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Ryosuke Niwa
Consider merging https://chromium.googlesource.com/chromium/blink/+/4727602ff32037dede84f2acd9534d6256f3e001
In RenderBox::computeInlineDirectionMargins, we have to pretend that
auto margins are zero so that the line cross size gets calculated
correctly (compare http://dev.w3.org/csswg/css-flexbox/#auto-margins)
That fix exposed a bug in RenderFlexibleBox::updateAutoMarginsInCrossAxis,
which needs to take LTR/RTL-ness into account -- it needs to adjust the
position iff margin-before is auto, which can be margin-right.
This CL also adds a few comments in an attempt to clarify the code a little.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Ahmad Saleem
I am able to reproduce this issue kind of based on linked Chromium patch:
Link - https://jsfiddle.net/abgLcdpq/show
*** Safari Technology Preview 152 ***
Shows "only four" - centeredWithAlignSelf
*** Chrome Canary 107 ***
Shows "five" - centeredWithAlignSelf
*** Firefox Nightly 106 ***
Shows "five" - centeredWithAlignSelf
_____________________________
Just wanted to share updated results. Thanks!
Ahmad Saleem
This is already added in RenderBox.cpp:
https://github.com/WebKit/WebKit/blob/4385a00da760f9db033925547caa238d3a9f0885/Source/WebCore/rendering/RenderBox.cpp#L3065
RenderFlexibleBox.cpp - Added this already
https://github.com/WebKit/WebKit/blob/4ccdb2ac7f7c989dd9d92ec1c42dccc44ef21b6a/Source/WebCore/rendering/RenderFlexibleBox.cpp#L1288
https://github.com/WebKit/WebKit/blob/4ccdb2ac7f7c989dd9d92ec1c42dccc44ef21b6a/Source/WebCore/rendering/RenderFlexibleBox.cpp#L1302
https://github.com/WebKit/WebKit/blob/4ccdb2ac7f7c989dd9d92ec1c42dccc44ef21b6a/Source/WebCore/rendering/RenderFlexibleBox.cpp#L1315
I think this was added but now we still have different behavior as mentioned in my previous comment. :-?
Radar WebKit Bug Importer
<rdar://problem/99344089>