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-overflow] Specify computed value of overflow for display: table #8133

Open
fred-wang opened this issue Nov 25, 2022 · 0 comments
Open
Labels
css-overflow-3 Current Work css-tables-3 Current Work

Comments

@fred-wang
Copy link

From https://www.w3.org/TR/css-overflow-3/#overflow-properties

The computed value of overflow-x/y are "as specified, except with visible/clip computing to auto/hidden (respectively) if one of overflow-x or overflow-y is neither visible nor clip"

Here is a testcase using elements with display: table:

<!DOCTYPE html>
<table style="overflow: visible"></table>
<table style="overflow: hidden"></table>
<table style="overflow: scroll"></table>
<table style="overflow: clip"></table>
<table style="overflow-x: hidden; overflow-y: visible"></table>
<table style="overflow-x: auto; overflow-y: clip"></table>
<textarea id="output" cols="80" rows="40"></textarea>
<script>
 Array.from(document.getElementsByTagName('table')).forEach(table => {
   output.textContent += `Table with ${table.getAttribute('style')}\n`;
   output.textContent += `  overflowX: ${window.getComputedStyle(table).overflowX}\n`;
   output.textContent += `  overflowY: ${window.getComputedStyle(table).overflowY}\n\n`;
  });
</script>
</script>

Firefox follows the spec here and output the following for the two last elements:

Table with overflow-x: hidden; overflow-y: visible
  overflowX: hidden
  overflowY: auto

Table with overflow-x: auto; overflow-y: clip
  overflowX: auto
  overflowY: hidden

Chrome resolves everything to visible instead, see https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/css/resolver/style_adjuster.cc;l=503;drc=c78c35fff237598ae5022a8d3ff5f8ee20b894ce :

Table with overflow-x: hidden; overflow-y: visible
  overflowX: visible
  overflowY: visible

Table with overflow-x: auto; overflow-y: clip
  overflowX: visible
  overflowY: visible

For WebKit, I'm getting this:

Table with overflow-x: hidden; overflow-y: visible
  overflowX: hidden
  overflowY: visible

Table with overflow-x: auto; overflow-y: clip
  overflowX: visible
  overflowY: hidden

It would be good to specify an interoperable interpretation for tables.

@fantasai fantasai added css-tables-3 Current Work css-overflow-3 Current Work labels Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-overflow-3 Current Work css-tables-3 Current Work
Projects
None yet
Development

No branches or pull requests

2 participants