Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-align-3][css-tables-3] Define last baseline for tables. #7655

Open
bfgeek opened this issue Aug 29, 2022 · 5 comments
Open

[css-align-3][css-tables-3] Define last baseline for tables. #7655

bfgeek opened this issue Aug 29, 2022 · 5 comments

Comments

@bfgeek
Copy link

bfgeek commented Aug 29, 2022

"The maximum distance between the top of the cell box and the baseline over all cells that have 'vertical-align: baseline' is used to set the baseline of the row. If a row doesn’t have any cell that has 'vertical-align: baseline', the baseline of that row is the bottom content edge of the lowest cell in the row.

The baseline of a table-root is the baseline of its first row, if any. Otherwise, it is the bottom content edge of the table-root."

This definition for first baseline is good! - We also need to define the last baseline behaviour.

Something like:
"The last baseline is defined as:

  • The maxiumum distance between the top of the cell box and the last baseline over all the non-rowspanned cells that have 'vertical-align: baseline' is used to set the baseline of the row.
  • If the row doesn't have any non-rowspanned cell that has 'vertical-align: basleine', the baseline of that row is the bottom content edge of the lowest cell in the row.

The last baseline of a table-root is the baseline of its last row, if any."

Ian

@bfgeek bfgeek added css-tables-3 Current Work css-align-3 Current Work labels Aug 29, 2022
@bfgeek
Copy link
Author

bfgeek commented Aug 29, 2022

(note importantly this definition does/will ignore captions at the top/bottom of the table).

@tabatkins
Copy link
Member

This should use the same logic as we decide in #7641, wrt using cells with last-baseline alignment, and maybe falling back to first-baseline (if we decide to do that for flexbox) before falling back to a synthesized baseline.

Also it should be checking for align-content: last baseline, not vertical-align: baseline; see https://www.w3.org/TR/css-align-3/#distribution-block which defines that align-content: normal defers to vertical-align but other values override that behavior.

@bfgeek
Copy link
Author

bfgeek commented Sep 15, 2022

testcase showing lowest content edge baseline: https://www.software.hixie.ch/utilities/js/live-dom-viewer/?saved=10716

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed last baseline of tables, and agreed to the following:

  • RESOLVED: Table baselines match grid, per details above.
  • RESOLVED: Rowspanning cells particpate only in first baseline alignment of their first row, and last baseline alignment in the last row
The full IRC log of that discussion <TabAtkins> Topic: last baseline of tables
<fantasai> github: https://github.com//issues/7655
<TabAtkins> iank_: Tables work by taking the first baseline from the first row in the larger table
<TabAtkins> iank_: Importantly, we skip captions, this is intentional
<TabAtkins> iank_: So how do we determine last baseline?
<TabAtkins> iank_: First relatively obvious bit is we probably want the last row
<TabAtkins> iank_: Given the reoslution we just had for flex and grid, we can probably do something similar
<TabAtkins> iank_: So if you've got a lot of baseline-aligned items, we'll take the first-baseline of those items and use it as the table's last baseline; toherwise we'll synthesize
<TabAtkins> fantasai: Alignment expands baseline alignment for tables, says align-content works on cells; "normal" looks at vertical-align, but you can use first/last baseline normally
<heycam> q+
<TabAtkins> fantasai: So probably just want to take literally the grid behavior and apply it here
<TabAtkins> iank_: Yeah, fine with that
<TabAtkins> iank_: Not implementing it yet, but seems fine
<TabAtkins> iank_: Important is to not consider captions
<TabAtkins> fantasai: agreed
<fremy> q+
<TabAtkins> iank_: (I'll show Firefox folks some cases for why caption should be ignored later)
<Rossen_> ack heycam
<TabAtkins> heycam: How do spanning cells impact this?
<TabAtkins> iank_: it gets a little complex
<TabAtkins> iank_: this wouldn't apply until impls support align-content; if something is spanning multiple rows, its first baseline currently only contributes to its first spanned row
<TabAtkins> iank_: And last-baseline, you can only get spanned cells affecting the last baseline if you support align-content:last-baseline
<TabAtkins> fantasai: So a spanned cell only affects first baseline alignment in its first row, and last baseline in its last row, and that's it
<Rossen_> ack fremy
<TabAtkins> fantasai: so it doesn't affect first-baseline alignmetn in its last row, etc
<TabAtkins> fremy: When you synthesize, do you include the table border?
<TabAtkins> iank_: TAbles always have a valid baseline - it's complicated - if there's a tbody, you ahve a baseline bc you synthesize it using the content edge of the first row
<TabAtkins> iank_: I think if you have captions but no body there's no exported baseline, so you'd synthesize from the table border
<TabAtkins> iank_: Need to do some investigation on our behavior
<TabAtkins> fantasai: proposed resolution: finding first/last baseline of a table cell works same as in grid
<TabAtkins> iank_: And last baseline of a table is taken from teh corret baseline-sharing group in the alst table row
<TabAtkins> Rossen_: objections?
<TabAtkins> RESOLVED: Table baselines match grid, per details above.
<fantasai> RESOLVED: Rowspanning cells particpate only in first baseline alignment of their first row, and last baseline alignment in the last row
<TabAtkins> fremy: Should I modify Tables?
<TabAtkins> fantasai: We might be able to do it generically in Align.
<TabAtkins> fantasai: If we can't we'll ping you.

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 20, 2022
For more details see:
w3c/csswg-drafts#7655 (comment)

Effectively we should propagate the last-baseline from the last
table-row (we ignore caption baselines for example).

If the row is baseline aligned (using vertical-align: baseline) this
becomes the first & last baseline (until we support
"align-content: last baseline"), otherwise we use the lowest
content-edge.

Bug: 885175
Change-Id: Id9de2f8baff5511fd4da2cef3f056c1bac0fc112
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 20, 2022
For more details see:
w3c/csswg-drafts#7655 (comment)

Effectively we should propagate the last-baseline from the last
table-row (we ignore caption baselines for example).

If the row is baseline aligned (using vertical-align: baseline) this
becomes the first & last baseline (until we support
"align-content: last baseline"), otherwise we use the lowest
content-edge.

Bug: 885175
Change-Id: Id9de2f8baff5511fd4da2cef3f056c1bac0fc112
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3907838
Reviewed-by: David Grogan <dgrogan@chromium.org>
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1049240}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 20, 2022
For more details see:
w3c/csswg-drafts#7655 (comment)

Effectively we should propagate the last-baseline from the last
table-row (we ignore caption baselines for example).

If the row is baseline aligned (using vertical-align: baseline) this
becomes the first & last baseline (until we support
"align-content: last baseline"), otherwise we use the lowest
content-edge.

Bug: 885175
Change-Id: Id9de2f8baff5511fd4da2cef3f056c1bac0fc112
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3907838
Reviewed-by: David Grogan <dgrogan@chromium.org>
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1049240}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Sep 24, 2022
…from tables., a=testonly

Automatic update from web-platform-tests
[last-baseline] Propagate last-baseline from tables.

For more details see:
w3c/csswg-drafts#7655 (comment)

Effectively we should propagate the last-baseline from the last
table-row (we ignore caption baselines for example).

If the row is baseline aligned (using vertical-align: baseline) this
becomes the first & last baseline (until we support
"align-content: last baseline"), otherwise we use the lowest
content-edge.

Bug: 885175
Change-Id: Id9de2f8baff5511fd4da2cef3f056c1bac0fc112
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3907838
Reviewed-by: David Grogan <dgrogan@chromium.org>
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1049240}

--

wpt-commits: 55e1c625687971d6e9ad0836127bb2f679f33123
wpt-pr: 35976
jamienicol pushed a commit to jamienicol/gecko that referenced this issue Sep 27, 2022
…from tables., a=testonly

Automatic update from web-platform-tests
[last-baseline] Propagate last-baseline from tables.

For more details see:
w3c/csswg-drafts#7655 (comment)

Effectively we should propagate the last-baseline from the last
table-row (we ignore caption baselines for example).

If the row is baseline aligned (using vertical-align: baseline) this
becomes the first & last baseline (until we support
"align-content: last baseline"), otherwise we use the lowest
content-edge.

Bug: 885175
Change-Id: Id9de2f8baff5511fd4da2cef3f056c1bac0fc112
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3907838
Reviewed-by: David Grogan <dgrogan@chromium.org>
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1049240}

--

wpt-commits: 55e1c625687971d6e9ad0836127bb2f679f33123
wpt-pr: 35976
mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this issue Oct 14, 2022
For more details see:
w3c/csswg-drafts#7655 (comment)

Effectively we should propagate the last-baseline from the last
table-row (we ignore caption baselines for example).

If the row is baseline aligned (using vertical-align: baseline) this
becomes the first & last baseline (until we support
"align-content: last baseline"), otherwise we use the lowest
content-edge.

Bug: 885175
Change-Id: Id9de2f8baff5511fd4da2cef3f056c1bac0fc112
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3907838
Reviewed-by: David Grogan <dgrogan@chromium.org>
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1049240}
NOKEYCHECK=True
GitOrigin-RevId: 27e262d4b48a9012233fb8aada2986da0ab60e57
fantasai added a commit to fantasai/csswg-drafts that referenced this issue Jan 20, 2023
…inding algo w3c#7655 w3c#7641

* RESOLVED: When taking the baseline of a row of items,
  we check a shared first baseline, then a shared last baseline,
  then the first baseline of the first item.
  (And vice versa for last baselines.)

* RESOLVED: Rowspanning cells participate only
  in first baseline alignment of their first row,
  and last baseline alignment in the last row.

* RESOLVED: Table baselines match grid, per details above.
@fantasai
Copy link
Collaborator

@tabatkins and I have drawn up a PR for this at #8341

fantasai added a commit to fantasai/csswg-drafts that referenced this issue Mar 3, 2023
…inding algo w3c#7655 w3c#7641

* RESOLVED: When taking the baseline of a row of items,
  we check a shared first baseline, then a shared last baseline,
  then the first baseline of the first item.
  (And vice versa for last baselines.)

* RESOLVED: Rowspanning cells participate only
  in first baseline alignment of their first row,
  and last baseline alignment in the last row.

* RESOLVED: Table baselines match grid, per details above.
fantasai added a commit to fantasai/csswg-drafts that referenced this issue Oct 30, 2023
…inding algo w3c#7655 w3c#7641

* RESOLVED: When taking the baseline of a row of items,
  we check a shared first baseline, then a shared last baseline,
  then the first baseline of the first item.
  (And vice versa for last baselines.)

* RESOLVED: Rowspanning cells participate only
  in first baseline alignment of their first row,
  and last baseline alignment in the last row.

* RESOLVED: Table baselines match grid, per details above.
fantasai added a commit to fantasai/csswg-drafts that referenced this issue Oct 30, 2023
…inding algo w3c#7655 w3c#7641 Part II w3c#8341

RESOLVED: first/last baseline takes from the first/last item (rather than taking highest/lowest baseline)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants