Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Issue 385583005: For flex items, percent paddings should resolve against their respective dimension

Created:
6 years, 5 months ago by harpreet.sk
Modified:
6 years, 4 months ago
CC:
blink-reviews, blink-reviews-rendering, eae+blinkwatch, jchaffraix+rendering, leviw+renderwatch, pdr., rune+blink, zoltan1
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

For flex items, percent paddings should resolve against their respective dimension Normally, padding top and padding bottom resolve against the width of the containing block, but for the flex items, we should resolve against the height of the containing block. http://dev.w3.org/csswg/css-flexbox/#item-margins This patch tries to resolve this bug by performing computation of percentage padding-top , padding-bottom , padding-before and padding-after against the height of the flexbox. BUG=229568

Patch Set 1 #

Total comments: 16

Patch Set 2 : WIP Patch 2 #

Total comments: 8

Patch Set 3 : WIP Patch 3 #

Total comments: 17

Patch Set 4 : WIP Patch 4 #

Patch Set 5 : WIP Patch 5 #

Patch Set 6 : Rebase #

Total comments: 2

Patch Set 7 : WIP Patch 6 #

Patch Set 8 : #

Patch Set 9 : #

Patch Set 10 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+133 lines, -18 lines) Patch
A LayoutTests/css3/flexbox/percent-padding.html View 1 2 3 4 5 6 7 1 chunk +74 lines, -0 lines 0 comments Download
A + LayoutTests/css3/flexbox/percent-padding-expected.txt View 1 2 3 0 chunks +-1 lines, --1 lines 0 comments Download
M Source/core/rendering/RenderBoxModelObject.h View 1 2 3 4 5 6 7 3 chunks +22 lines, -9 lines 0 comments Download
M Source/core/rendering/RenderBoxModelObject.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +37 lines, -3 lines 0 comments Download
M Source/core/rendering/RenderThemeChromiumSkia.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -7 lines 0 comments Download
M Source/platform/RuntimeEnabledFeatures.in View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 22 (0 generated)
harpreet.sk
This is a WIP patch trying to solve the problem for padding. please take a ...
6 years, 5 months ago (2014-07-10 15:41:08 UTC) #1
tony
The change description should link to the spec instead of an email of meeting notes. ...
6 years, 5 months ago (2014-07-10 17:10:06 UTC) #2
harpreet.sk
On 2014/07/10 17:10:06, tony wrote: > The change description should link to the spec instead ...
6 years, 5 months ago (2014-07-14 08:37:04 UTC) #3
harpreet.sk
Uploaded new patch... ptal.... https://codereview.chromium.org/385583005/diff/1/LayoutTests/css3/flexbox/percent-margins-padding.html File LayoutTests/css3/flexbox/percent-margins-padding.html (right): https://codereview.chromium.org/385583005/diff/1/LayoutTests/css3/flexbox/percent-margins-padding.html#newcode15 LayoutTests/css3/flexbox/percent-margins-padding.html:15: shouldBeEqualToString('window.getComputedStyle(document.getElementById("flexItem1"),null).getPropertyValue("padding-top")', '10px'); On 2014/07/10 17:10:06, ...
6 years, 5 months ago (2014-07-14 08:38:07 UTC) #4
tony
https://codereview.chromium.org/385583005/diff/20001/LayoutTests/css3/flexbox/percent-margins-padding.html File LayoutTests/css3/flexbox/percent-margins-padding.html (right): https://codereview.chromium.org/385583005/diff/20001/LayoutTests/css3/flexbox/percent-margins-padding.html#newcode13 LayoutTests/css3/flexbox/percent-margins-padding.html:13: <div id="flexItem1" data-expected-padding-top="10" data-expected-padding-bottom="10" data-expected-padding-before="10" data-expected-padding-after="10" style="background:yellow; padding:10%;">Pasta batman</div> ...
6 years, 5 months ago (2014-07-14 16:34:38 UTC) #5
harpreet.sk
I tried to go through the implementation of mozilla (although only some part of it ...
6 years, 5 months ago (2014-07-15 16:31:01 UTC) #6
harpreet.sk
@ojan, christian, tony - please have a look
6 years, 5 months ago (2014-07-15 18:19:41 UTC) #7
tony
This approach seems reasonable to me, but I might be missing something. Since I'm not ...
6 years, 5 months ago (2014-07-15 18:29:26 UTC) #8
leviw_travelin_and_unemployed
https://codereview.chromium.org/385583005/diff/40001/LayoutTests/css3/flexbox/percent-margins-padding-expected.txt File LayoutTests/css3/flexbox/percent-margins-padding-expected.txt (right): https://codereview.chromium.org/385583005/diff/40001/LayoutTests/css3/flexbox/percent-margins-padding-expected.txt#newcode1 LayoutTests/css3/flexbox/percent-margins-padding-expected.txt:1: Pasta batman +1, though I know Pasta Batman is ...
6 years, 5 months ago (2014-07-15 20:08:29 UTC) #9
ojan
https://codereview.chromium.org/385583005/diff/40001/Source/core/rendering/RenderBoxModelObject.cpp File Source/core/rendering/RenderBoxModelObject.cpp (right): https://codereview.chromium.org/385583005/diff/40001/Source/core/rendering/RenderBoxModelObject.cpp#newcode317 Source/core/rendering/RenderBoxModelObject.cpp:317: if (containingBlock()->isFlexibleBox() && (type == TopPadding || type == ...
6 years, 5 months ago (2014-07-15 20:33:25 UTC) #10
ojan
Please add a runtime flag for this. I don't want us to ship this until ...
6 years, 5 months ago (2014-07-15 20:34:19 UTC) #11
harpreet.sk
Please have a look.... https://codereview.chromium.org/385583005/diff/40001/LayoutTests/css3/flexbox/percent-margins-padding-expected.txt File LayoutTests/css3/flexbox/percent-margins-padding-expected.txt (right): https://codereview.chromium.org/385583005/diff/40001/LayoutTests/css3/flexbox/percent-margins-padding-expected.txt#newcode1 LayoutTests/css3/flexbox/percent-margins-padding-expected.txt:1: Pasta batman On 2014/07/15 18:29:26, ...
6 years, 5 months ago (2014-07-16 15:43:02 UTC) #12
harpreet.sk
On 2014/07/15 20:34:19, ojan-only-code-yellow-reviews wrote: > Please add a runtime flag for this. I don't ...
6 years, 5 months ago (2014-07-16 15:43:29 UTC) #13
tony
https://codereview.chromium.org/385583005/diff/90001/Source/core/rendering/RenderBoxModelObject.cpp File Source/core/rendering/RenderBoxModelObject.cpp (right): https://codereview.chromium.org/385583005/diff/90001/Source/core/rendering/RenderBoxModelObject.cpp#newcode2532 Source/core/rendering/RenderBoxModelObject.cpp:2532: default: One of the reasons to use a switch ...
6 years, 5 months ago (2014-07-16 16:57:23 UTC) #14
harpreet.sk
ptal... https://codereview.chromium.org/385583005/diff/90001/Source/core/rendering/RenderBoxModelObject.cpp File Source/core/rendering/RenderBoxModelObject.cpp (right): https://codereview.chromium.org/385583005/diff/90001/Source/core/rendering/RenderBoxModelObject.cpp#newcode2532 Source/core/rendering/RenderBoxModelObject.cpp:2532: default: On 2014/07/16 16:57:23, tony wrote: > One ...
6 years, 5 months ago (2014-07-17 14:36:53 UTC) #15
harpreet.sk
Levi or Ojan can you please take a look...
6 years, 5 months ago (2014-07-17 18:36:41 UTC) #16
harpreet.sk
@Ojan, Christian - please take a look
6 years, 5 months ago (2014-07-24 17:25:34 UTC) #17
cbiesinger
Tab - can you confirm which edge margin-before refers to in case of vertical writing ...
6 years, 4 months ago (2014-08-12 01:37:10 UTC) #18
Tab Atkins
On 2014/08/12 01:37:10, cbiesinger wrote: > Tab - can you confirm which edge margin-before refers ...
6 years, 4 months ago (2014-08-12 01:43:33 UTC) #19
cbiesinger
On 2014/08/12 01:43:33, Tab Atkins wrote: > On 2014/08/12 01:37:10, cbiesinger wrote: > > Tab ...
6 years, 4 months ago (2014-08-12 01:47:11 UTC) #20
harpreet.sk
On 2014/08/12 01:37:10, cbiesinger wrote: > Tab - can you confirm which edge margin-before refers ...
6 years, 4 months ago (2014-08-20 13:58:45 UTC) #21
cbiesinger
6 years, 4 months ago (2014-08-21 21:13:54 UTC) #22
On 2014/08/20 13:58:45, harpreet.sk wrote:
> On 2014/08/12 01:37:10, cbiesinger wrote:
> > Tab - can you confirm which edge margin-before refers to in case of vertical
> > writing modes? In particular should percentage paddings for flex items
always
> > resolve against the height for padding-before?
> 
> @Chris : I am not always resolving the percentages padding-before against the
> height. In my sloution i am taking containingBlockLogicalHeight which takes
care
> of vertical-writing modes and return width for vertical writing mode. 
> 
> Even i have added 2 test cases at end of the layout test above for vertical
> writing modes in which padding-top/bottom is resolved against width. 
> 
> I might be missing something or might be wrong somewhere. Can you tell where i
> am wrong in my solution or can tell some test cases where my patch will fail.

Sorry, I got it wrong, it is margin-top/margin-bottom which will not do the
right thing (they should resolve to top/bottom even in vertical writing mode).
Only margin-before/after should resolve to left/right.

I am also really concerned about the performance implications of this additional
check *every time* we are accessing a percentage padding value anywhere

Powered by Google App Engine
This is Rietveld 408576698