[css-grid] Implementing the grid's first line baseline.
Implementation of the 'first-line' baseline for Grid containers,
according to the CSS Grid Layout spec.
https://drafts.csswg.org/css-grid/#grid-baselines
The self-baseline and content-baseline alignment logic is still
not implemented, hence some cases will be implemented in
future patches.
BUG=234191
Committed: https://crrev.com/84aad1bd751661177410014915ea453b7bad2346
Cr-Commit-Position: refs/heads/master@{#429479}
Description was changed from ========== [css-grid] Implementing the grid's first line baseline. Implementation of the ...
4 years, 2 months ago
(2016-10-13 14:11:53 UTC)
#1
Description was changed from
==========
[css-grid] Implementing the grid's first line baseline.
Implementation of the 'first-line' baseline for Grid containers,
according to the CSS Grid Layout spec.
https://drafts.csswg.org/css-grid/#grid-baselines
BUG=234191
==========
to
==========
[css-grid] Implementing the grid's first line baseline.
Implementation of the 'first-line' baseline for Grid containers,
according to the CSS Grid Layout spec.
https://drafts.csswg.org/css-grid/#grid-baselines
The self-baseline and content-baseline alignment logic is still
not implemented.
BUG=234191
==========
Description was changed from ========== [css-grid] Implementing the grid's first line baseline. Implementation of the ...
4 years, 2 months ago
(2016-10-13 14:12:56 UTC)
#3
Description was changed from
==========
[css-grid] Implementing the grid's first line baseline.
Implementation of the 'first-line' baseline for Grid containers,
according to the CSS Grid Layout spec.
https://drafts.csswg.org/css-grid/#grid-baselines
The self-baseline and content-baseline alignment logic is still
not implemented.
BUG=234191
==========
to
==========
[css-grid] Implementing the grid's first line baseline.
Implementation of the 'first-line' baseline for Grid containers,
according to the CSS Grid Layout spec.
https://drafts.csswg.org/css-grid/#grid-baselines
The self-baseline and content-baseline alignment logic is still
not implemented, hence some cases will be implemented in
future patches.
BUG=234191
==========
4 years, 2 months ago
(2016-10-17 08:20:02 UTC)
#5
cbiesinger
lgtm https://codereview.chromium.org/2417853002/diff/1/third_party/WebKit/Source/core/layout/LayoutGrid.cpp File third_party/WebKit/Source/core/layout/LayoutGrid.cpp (right): https://codereview.chromium.org/2417853002/diff/1/third_party/WebKit/Source/core/layout/LayoutGrid.cpp#newcode2888 third_party/WebKit/Source/core/layout/LayoutGrid.cpp:2888: LayoutUnit LayoutGrid::firstLineBoxBaselineForChild( Are you calling this function anywhere...? ...
4 years, 2 months ago
(2016-10-19 20:57:59 UTC)
#6
Thanks for the review. See my comments below. https://codereview.chromium.org/2417853002/diff/1/third_party/WebKit/Source/core/layout/LayoutGrid.cpp File third_party/WebKit/Source/core/layout/LayoutGrid.cpp (right): https://codereview.chromium.org/2417853002/diff/1/third_party/WebKit/Source/core/layout/LayoutGrid.cpp#newcode2888 third_party/WebKit/Source/core/layout/LayoutGrid.cpp:2888: LayoutUnit ...
4 years, 2 months ago
(2016-10-20 09:07:14 UTC)
#7
Thanks for the review.
See my comments below.
https://codereview.chromium.org/2417853002/diff/1/third_party/WebKit/Source/c...
File third_party/WebKit/Source/core/layout/LayoutGrid.cpp (right):
https://codereview.chromium.org/2417853002/diff/1/third_party/WebKit/Source/c...
third_party/WebKit/Source/core/layout/LayoutGrid.cpp:2888: LayoutUnit
LayoutGrid::firstLineBoxBaselineForChild(
On 2016/10/19 20:57:59, cbiesinger wrote:
> Are you calling this function anywhere...?
Umm, you're right. This function will be used later, in the implementation
of the self-baseline alignment. It can be removed from this patch, indeed.
https://codereview.chromium.org/2417853002/diff/1/third_party/WebKit/Source/c...
third_party/WebKit/Source/core/layout/LayoutGrid.cpp:2891: // We take
content-box's bottom if no valid baseline.
On 2016/10/19 20:57:59, cbiesinger wrote:
> But you're actually calculating the border-box bottom?
umm, as far as I know, LayoutBlock::logicalHeightForChild(child) returns
the child.size().height() which should be the content-box's height, right ?
This function is pretty similar to the one implemented for Flexbox and
named as marginBoxAscentForChild, which it uses another Flexbox
specific function, named as crossAxisExtentForChild which provides
the same value than LayoutBlock::logicalHeightForChild.
I might be wrong, but as far as I understand this logic, the function
I implemented, like the Flexbox one, returns the content-box's bottom
position.
https://codereview.chromium.org/2417853002/diff/1/third_party/WebKit/Source/c...
third_party/WebKit/Source/core/layout/LayoutGrid.cpp:2913: DCHECK(mode ==
PositionOnContainingLine);
On 2016/10/19 20:57:59, cbiesinger wrote:
> DCHECK_EQ
Done.
cbiesinger
(still lgtm) https://codereview.chromium.org/2417853002/diff/1/third_party/WebKit/Source/core/layout/LayoutGrid.cpp File third_party/WebKit/Source/core/layout/LayoutGrid.cpp (right): https://codereview.chromium.org/2417853002/diff/1/third_party/WebKit/Source/core/layout/LayoutGrid.cpp#newcode2891 third_party/WebKit/Source/core/layout/LayoutGrid.cpp:2891: // We take content-box's bottom if no ...
4 years, 2 months ago
(2016-10-20 17:42:36 UTC)
#8
(still lgtm)
https://codereview.chromium.org/2417853002/diff/1/third_party/WebKit/Source/c...
File third_party/WebKit/Source/core/layout/LayoutGrid.cpp (right):
https://codereview.chromium.org/2417853002/diff/1/third_party/WebKit/Source/c...
third_party/WebKit/Source/core/layout/LayoutGrid.cpp:2891: // We take
content-box's bottom if no valid baseline.
On 2016/10/20 09:07:14, jfernandez wrote:
> On 2016/10/19 20:57:59, cbiesinger wrote:
> > But you're actually calculating the border-box bottom?
>
> umm, as far as I know, LayoutBlock::logicalHeightForChild(child) returns
> the child.size().height() which should be the content-box's height, right ?
>
> This function is pretty similar to the one implemented for Flexbox and
> named as marginBoxAscentForChild, which it uses another Flexbox
> specific function, named as crossAxisExtentForChild which provides
> the same value than LayoutBlock::logicalHeightForChild.
>
> I might be wrong, but as far as I understand this logic, the function
> I implemented, like the Flexbox one, returns the content-box's bottom
> position.
No, size().height() (and logicalHeight()) all refer to the border-box size, so
that's also what the flexbox one returns. If you want the content-box, use
contentHeight().
jfernandez
https://codereview.chromium.org/2417853002/diff/1/third_party/WebKit/Source/core/layout/LayoutGrid.cpp File third_party/WebKit/Source/core/layout/LayoutGrid.cpp (right): https://codereview.chromium.org/2417853002/diff/1/third_party/WebKit/Source/core/layout/LayoutGrid.cpp#newcode2891 third_party/WebKit/Source/core/layout/LayoutGrid.cpp:2891: // We take content-box's bottom if no valid baseline. ...
4 years, 2 months ago
(2016-10-20 22:13:23 UTC)
#9
https://codereview.chromium.org/2417853002/diff/1/third_party/WebKit/Source/c...
File third_party/WebKit/Source/core/layout/LayoutGrid.cpp (right):
https://codereview.chromium.org/2417853002/diff/1/third_party/WebKit/Source/c...
third_party/WebKit/Source/core/layout/LayoutGrid.cpp:2891: // We take
content-box's bottom if no valid baseline.
On 2016/10/20 17:42:36, cbiesinger wrote:
> On 2016/10/20 09:07:14, jfernandez wrote:
> > On 2016/10/19 20:57:59, cbiesinger wrote:
> > > But you're actually calculating the border-box bottom?
> >
> > umm, as far as I know, LayoutBlock::logicalHeightForChild(child) returns
> > the child.size().height() which should be the content-box's height, right ?
> >
> > This function is pretty similar to the one implemented for Flexbox and
> > named as marginBoxAscentForChild, which it uses another Flexbox
> > specific function, named as crossAxisExtentForChild which provides
> > the same value than LayoutBlock::logicalHeightForChild.
> >
> > I might be wrong, but as far as I understand this logic, the function
> > I implemented, like the Flexbox one, returns the content-box's bottom
> > position.
>
> No, size().height() (and logicalHeight()) all refer to the border-box size, so
> that's also what the flexbox one returns. If you want the content-box, use
> contentHeight().
Oh, I was so confused about this. I'll think about what I actually need and
probably send a new patch, since we have found out that we are not respecting
grid-order when selecting the first item (Flexbox uses document-modified-order,
instead)
svillar
Looking good but there are some issues that should be corrected first. https://codereview.chromium.org/2417853002/diff/20001/third_party/WebKit/Source/core/layout/LayoutGrid.cpp File third_party/WebKit/Source/core/layout/LayoutGrid.cpp ...
4 years, 2 months ago
(2016-10-21 12:53:06 UTC)
#10
Please @cbiesinger, take another look as I change the patch quite much. https://codereview.chromium.org/2417853002/diff/20001/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-baseline-expected.html File third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-baseline-expected.html ...
4 years, 1 month ago
(2016-10-26 14:22:31 UTC)
#12
Please @cbiesinger, take another look as I change the patch quite much.
https://codereview.chromium.org/2417853002/diff/20001/third_party/WebKit/Layo...
File
third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-baseline-expected.html
(right):
https://codereview.chromium.org/2417853002/diff/20001/third_party/WebKit/Layo...
third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-baseline-expected.html:99:
<!-- TODO: Grid spec does not allow block-axis baseline alignment, which is what
apparently flexbox does.
On 2016/10/25 19:42:08, Manuel Rego wrote:
> Ditto.
Acknowledged.
https://codereview.chromium.org/2417853002/diff/20001/third_party/WebKit/Layo...
third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-baseline-expected.html:179:
<!-- TODO: Grid spec does not allow block-axis baseline alignment, which is what
apparently flexbox does.
On 2016/10/25 19:42:08, Manuel Rego wrote:
> Ditto.
Acknowledged.
https://codereview.chromium.org/2417853002/diff/20001/third_party/WebKit/Layo...
File
third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-baseline-margins.html
(right):
https://codereview.chromium.org/2417853002/diff/20001/third_party/WebKit/Layo...
third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-baseline-margins.html:12:
min-height: 0;
On 2016/10/25 19:42:08, Manuel Rego wrote:
> Just out of curiosity, why do you need this?
It's just legacy, with the purpose of dealing with some min-height issues.
I'll remove these lines.
https://codereview.chromium.org/2417853002/diff/20001/third_party/WebKit/Layo...
File
third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-baseline-must-respect-grid-order.html
(right):
https://codereview.chromium.org/2417853002/diff/20001/third_party/WebKit/Layo...
third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-baseline-must-respect-grid-order.html:33:
Each grid container must use its first (grid order) item to compute its
baseline, hence they might be baseline aligned each other accordingly.
On 2016/10/25 19:42:08, Manuel Rego wrote:
> As @svillar said, this is probably wrong as we should use
> the grid-modified document order.
> Which means that the item in the first row and first column
> would be the one defining the baseline, independently on its
> position on the DOM.
Done.
https://codereview.chromium.org/2417853002/diff/20001/third_party/WebKit/Layo...
File third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-baseline.html
(right):
https://codereview.chromium.org/2417853002/diff/20001/third_party/WebKit/Layo...
third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-baseline.html:23:
.firstRowFirstColumn {
On 2016/10/25 19:42:08, Manuel Rego wrote:
> Nit: You could reuse these classes from grid.css.
I wasn't interested on the background-color. Since this is a ref test to compare
with flexbox's behavior I'd rather keep the tests as independent as possible.
https://codereview.chromium.org/2417853002/diff/20001/third_party/WebKit/Layo...
third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-baseline.html:107: <!--
TODO: Grid spec does not allow block-axis baseline alignment, which is what
apparently flexbox does.
On 2016/10/25 19:42:08, Manuel Rego wrote:
> I think this test is unrelated to block-axis baseline.
>
> Also, we cannot reproduce this case on Grid Layout,
> as it'll always use the item on the first cell.
> So I'd remove it directly from the test.
Done.
https://codereview.chromium.org/2417853002/diff/20001/third_party/WebKit/Layo...
third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-baseline.html:187: <!--
TODO: Grid spec does not allow block-axis baseline alignment, which is what
apparently flexbox does.
On 2016/10/25 19:42:08, Manuel Rego wrote:
> Ditto.
Done.
https://codereview.chromium.org/2417853002/diff/20001/third_party/WebKit/Sour...
File third_party/WebKit/Source/core/layout/LayoutGrid.cpp (right):
https://codereview.chromium.org/2417853002/diff/20001/third_party/WebKit/Sour...
third_party/WebKit/Source/core/layout/LayoutGrid.cpp:2907:
box.verticalScrollbarWidth())
On 2016/10/21 12:53:06, svillar wrote:
> Why aren't you directly using contentHeight() ?
Well, we don't want contentHeight, but the distance from the box's top position
to its border-box bottom edge.
https://codereview.chromium.org/2417853002/diff/20001/third_party/WebKit/Sour...
third_party/WebKit/Source/core/layout/LayoutGrid.cpp:2911:
box.horizontalScrollbarHeight())
On 2016/10/21 12:53:06, svillar wrote:
> Why aren't you directly using contentWidth() ?
Ditto.
https://codereview.chromium.org/2417853002/diff/20001/third_party/WebKit/Sour...
third_party/WebKit/Source/core/layout/LayoutGrid.cpp:2918: LinePositionMode
mode) const {
On 2016/10/25 19:42:09, Manuel Rego wrote:
> This is the same code than flexbox, probably it'd be nice to add
> a comment about a future refactoring.
Acknowledged.
https://codereview.chromium.org/2417853002/diff/20001/third_party/WebKit/Sour...
third_party/WebKit/Source/core/layout/LayoutGrid.cpp:2932: for (const LayoutBox*
child = m_orderIterator.first(); child;
On 2016/10/25 19:42:09, Manuel Rego wrote:
> On 2016/10/21 12:53:06, svillar wrote:
> > This is order-modified document order not grid-modified document order.
>
> Yeah you should check the things in the first row using
> m_grid[0] and the items in the first busy cell
> as we do in GridPainter.
Done.
https://codereview.chromium.org/2417853002/diff/20001/third_party/WebKit/Sour...
third_party/WebKit/Source/core/layout/LayoutGrid.cpp:2980: int
LayoutGrid::inlineBlockBaseline(LineDirectionMode direction) const {
On 2016/10/25 19:42:09, Manuel Rego wrote:
> Again same code than flexbox, please add a comment.
Acknowledged.
cbiesinger
lgtm
4 years, 1 month ago
(2016-10-26 19:30:30 UTC)
#13
lgtm
jfernandez
The CQ bit was checked by jfernandez@igalia.com
4 years, 1 month ago
(2016-11-02 18:01:57 UTC)
#14
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/98310) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, ...
4 years, 1 month ago
(2016-11-02 18:07:14 UTC)
#18
Try jobs failed on following builders: android_cronet on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_cronet/builds/29078) android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, ...
4 years, 1 month ago
(2016-11-02 22:29:33 UTC)
#24
Description was changed from ========== [css-grid] Implementing the grid's first line baseline. Implementation of the ...
4 years, 1 month ago
(2016-11-03 00:37:48 UTC)
#29
Message was sent while issue was closed.
Description was changed from
==========
[css-grid] Implementing the grid's first line baseline.
Implementation of the 'first-line' baseline for Grid containers,
according to the CSS Grid Layout spec.
https://drafts.csswg.org/css-grid/#grid-baselines
The self-baseline and content-baseline alignment logic is still
not implemented, hence some cases will be implemented in
future patches.
BUG=234191
==========
to
==========
[css-grid] Implementing the grid's first line baseline.
Implementation of the 'first-line' baseline for Grid containers,
according to the CSS Grid Layout spec.
https://drafts.csswg.org/css-grid/#grid-baselines
The self-baseline and content-baseline alignment logic is still
not implemented, hence some cases will be implemented in
future patches.
BUG=234191
==========
commit-bot: I haz the power
Committed patchset #6 (id:140001)
4 years, 1 month ago
(2016-11-03 00:37:49 UTC)
#30
Message was sent while issue was closed.
Committed patchset #6 (id:140001)
commit-bot: I haz the power
Description was changed from ========== [css-grid] Implementing the grid's first line baseline. Implementation of the ...
4 years, 1 month ago
(2016-11-03 00:40:23 UTC)
#31
Message was sent while issue was closed.
Description was changed from
==========
[css-grid] Implementing the grid's first line baseline.
Implementation of the 'first-line' baseline for Grid containers,
according to the CSS Grid Layout spec.
https://drafts.csswg.org/css-grid/#grid-baselines
The self-baseline and content-baseline alignment logic is still
not implemented, hence some cases will be implemented in
future patches.
BUG=234191
==========
to
==========
[css-grid] Implementing the grid's first line baseline.
Implementation of the 'first-line' baseline for Grid containers,
according to the CSS Grid Layout spec.
https://drafts.csswg.org/css-grid/#grid-baselines
The self-baseline and content-baseline alignment logic is still
not implemented, hence some cases will be implemented in
future patches.
BUG=234191
Committed: https://crrev.com/84aad1bd751661177410014915ea453b7bad2346
Cr-Commit-Position: refs/heads/master@{#429479}
==========
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/84aad1bd751661177410014915ea453b7bad2346 Cr-Commit-Position: refs/heads/master@{#429479}
4 years, 1 month ago
(2016-11-03 00:40:24 UTC)
#32
Issue 2417853002: [css-grid] Implementing the grid's first line baseline.
(Closed)
Created 4 years, 2 months ago by jfernandez
Modified 4 years, 1 month ago
Reviewers: cbiesinger, svillar, Manuel Rego
Base URL:
Comments: 33