[css-grid] "normal" alignment is "start" for replaced elements
"normal" alignment used to be "stretch" for all the elements,
however the CSS Grid Layout spec has been updated to change
this behavior for replaced elements:
https://github.com/w3c/csswg-drafts/issues/523
A few tests need to be updated due to this change.
We also take advantage to make
fast/css-grid-layout/grid-align-stretching-replaced-items.html
a testharness.js test so we can get rid of the expected file.
BUG=666961
TEST=external/csswg-test/css-grid-1/grid-items/grid-items-sizing-alignment-001.html
Review-Url: https://codereview.chromium.org/2722613003
Cr-Commit-Position: refs/heads/master@{#454133}
Committed: https://chromium.googlesource.com/chromium/src/+/fad39c71033eea490d8437ca186529c8e87125c2
Description was changed from ========== [css-grid] "normal" alignment is "start" for replaced elements "normal" alignment ...
3 years, 9 months ago
(2017-02-28 10:15:47 UTC)
#3
Description was changed from
==========
[css-grid] "normal" alignment is "start" for replaced elements
"normal" alignment used to be "stretch" for all the elements,
however the CSS Grid Layout spec has been updated to change
this behavior for replaced elements:
https://github.com/w3c/csswg-drafts/issues/523
A few tests need to be updated due to this change.
We also take advantage to make
fast/css-grid-layout/grid-align-stretching-replaced-items.html
a testharness.js test so we can get rid of the expected file.
BUG=555027
TEST=external/csswg-test/css-grid-1/grid-items/grid-items-sizing-alignment-001.html
==========
to
==========
[css-grid] "normal" alignment is "start" for replaced elements
"normal" alignment used to be "stretch" for all the elements,
however the CSS Grid Layout spec has been updated to change
this behavior for replaced elements:
https://github.com/w3c/csswg-drafts/issues/523
A few tests need to be updated due to this change.
We also take advantage to make
fast/css-grid-layout/grid-align-stretching-replaced-items.html
a testharness.js test so we can get rid of the expected file.
BUG=666961
TEST=external/csswg-test/css-grid-1/grid-items/grid-items-sizing-alignment-001.html
==========
jfernandez
https://codereview.chromium.org/2722613003/diff/1/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-align-stretching-replaced-items.html File third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-align-stretching-replaced-items.html (right): https://codereview.chromium.org/2722613003/diff/1/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-align-stretching-replaced-items.html#newcode28 third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-align-stretching-replaced-items.html:28: <div class="grid"> This case is based on the fact ...
3 years, 9 months ago
(2017-03-01 12:46:49 UTC)
#4
Thanks for the review, uploaded a new version PTAL. https://codereview.chromium.org/2722613003/diff/1/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-align-stretching-replaced-items.html File third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-align-stretching-replaced-items.html (right): https://codereview.chromium.org/2722613003/diff/1/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-align-stretching-replaced-items.html#newcode28 third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-align-stretching-replaced-items.html:28: ...
3 years, 9 months ago
(2017-03-01 17:57:07 UTC)
#5
Thanks for the review, uploaded a new version PTAL.
https://codereview.chromium.org/2722613003/diff/1/third_party/WebKit/LayoutTe...
File
third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-align-stretching-replaced-items.html
(right):
https://codereview.chromium.org/2722613003/diff/1/third_party/WebKit/LayoutTe...
third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-align-stretching-replaced-items.html:28:
<div class="grid">
On 2017/03/01 12:46:49, jfernandez wrote:
> This case is based on the fact that 'normal' is the default value, but I think
> it'd be better to set explicitly 'normal' as alignment value.
>
> It'd be even better to have both cases, setting 'normal' as defailt and
explicit
> value.
Done.
https://codereview.chromium.org/2722613003/diff/1/third_party/WebKit/Source/c...
File third_party/WebKit/Source/core/layout/LayoutBox.cpp (right):
https://codereview.chromium.org/2722613003/diff/1/third_party/WebKit/Source/c...
third_party/WebKit/Source/core/layout/LayoutBox.cpp:2755:
.resolvedAlignSelf(cb->selfAlignmentNormalBehavior(this),
On 2017/03/01 12:46:49, jfernandez wrote:
> Try to avoid the new 'child' argument.
We need to pass the child in the case of "cb"
is a grid container.
https://codereview.chromium.org/2722613003/diff/1/third_party/WebKit/Source/c...
File third_party/WebKit/Source/core/layout/LayoutBox.h (right):
https://codereview.chromium.org/2722613003/diff/1/third_party/WebKit/Source/c...
third_party/WebKit/Source/core/layout/LayoutBox.h:1386: if (child &&
child->isLayoutReplaced())
On 2017/03/01 12:46:49, jfernandez wrote:
> I think this logic is grid specific, so it should be implemented in Grid, so
> other LayoutBox still use stretch as 'normal' behavior.
>
> Also, I don't like too much the new 'child' argument. I've got a proposal;
since
> this is a grid specific logic, I'd remove this changes in LayoutBox and
> implement the different behavior for replaced grid items as part of
> LayoutGrid::alignSelfForChild and LayoutGrid::justifySelfForChild
> methods.
Yeah, good point, it's grid layout specific so I've overridden
this method in LayoutGrid.
The problem is that we still need to have the "child" argument,
as we need to pass the child in LayoutBox::hasStretchedLogicalWidth()
if it's a Grid.
jfernandez
lgtm https://codereview.chromium.org/2722613003/diff/20001/third_party/WebKit/LayoutTests/fast/css-grid-layout/resources/grid-alignment.css File third_party/WebKit/LayoutTests/fast/css-grid-layout/resources/grid-alignment.css (right): https://codereview.chromium.org/2722613003/diff/20001/third_party/WebKit/LayoutTests/fast/css-grid-layout/resources/grid-alignment.css#newcode96 third_party/WebKit/LayoutTests/fast/css-grid-layout/resources/grid-alignment.css:96: .itemsStretch { I guess this should be itemsNormal, ...
3 years, 9 months ago
(2017-03-01 22:58:54 UTC)
#6
Thank you very much for the review! https://codereview.chromium.org/2722613003/diff/20001/third_party/WebKit/LayoutTests/fast/css-grid-layout/resources/grid-alignment.css File third_party/WebKit/LayoutTests/fast/css-grid-layout/resources/grid-alignment.css (right): https://codereview.chromium.org/2722613003/diff/20001/third_party/WebKit/LayoutTests/fast/css-grid-layout/resources/grid-alignment.css#newcode96 third_party/WebKit/LayoutTests/fast/css-grid-layout/resources/grid-alignment.css:96: .itemsStretch { ...
3 years, 9 months ago
(2017-03-01 23:23:30 UTC)
#7
CQ is committing da patch. Bot data: {"patchset_id": 60001, "attempt_start_ts": 1488410622028210, "parent_rev": "880895ed7e23b1d0b920d5c62c361a226a62c50e", "commit_rev": "fad39c71033eea490d8437ca186529c8e87125c2"}
3 years, 9 months ago
(2017-03-02 01:19:16 UTC)
#11
CQ is committing da patch.
Bot data: {"patchset_id": 60001, "attempt_start_ts": 1488410622028210,
"parent_rev": "880895ed7e23b1d0b920d5c62c361a226a62c50e", "commit_rev":
"fad39c71033eea490d8437ca186529c8e87125c2"}
commit-bot: I haz the power
Description was changed from ========== [css-grid] "normal" alignment is "start" for replaced elements "normal" alignment ...
3 years, 9 months ago
(2017-03-02 01:20:55 UTC)
#12
Message was sent while issue was closed.
Description was changed from
==========
[css-grid] "normal" alignment is "start" for replaced elements
"normal" alignment used to be "stretch" for all the elements,
however the CSS Grid Layout spec has been updated to change
this behavior for replaced elements:
https://github.com/w3c/csswg-drafts/issues/523
A few tests need to be updated due to this change.
We also take advantage to make
fast/css-grid-layout/grid-align-stretching-replaced-items.html
a testharness.js test so we can get rid of the expected file.
BUG=666961
TEST=external/csswg-test/css-grid-1/grid-items/grid-items-sizing-alignment-001.html
==========
to
==========
[css-grid] "normal" alignment is "start" for replaced elements
"normal" alignment used to be "stretch" for all the elements,
however the CSS Grid Layout spec has been updated to change
this behavior for replaced elements:
https://github.com/w3c/csswg-drafts/issues/523
A few tests need to be updated due to this change.
We also take advantage to make
fast/css-grid-layout/grid-align-stretching-replaced-items.html
a testharness.js test so we can get rid of the expected file.
BUG=666961
TEST=external/csswg-test/css-grid-1/grid-items/grid-items-sizing-alignment-001.html
Review-Url: https://codereview.chromium.org/2722613003
Cr-Commit-Position: refs/heads/master@{#454133}
Committed:
https://chromium.googlesource.com/chromium/src/+/fad39c71033eea490d8437ca1865...
==========
commit-bot: I haz the power
Committed patchset #4 (id:60001) as https://chromium.googlesource.com/chromium/src/+/fad39c71033eea490d8437ca186529c8e87125c2
3 years, 9 months ago
(2017-03-02 01:20:56 UTC)
#13
Issue 2722613003: [css-grid] "normal" alignment is "start" for replaced elements
(Closed)
Created 3 years, 9 months ago by Manuel Rego
Modified 3 years, 9 months ago
Reviewers: jfernandez, svillar, cbiesinger
Base URL:
Comments: 16