| Summary: | Compute the correct overflow-x and overflow-y values for table elements | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Ahmad Saleem <ahmad.saleem792> | ||||
| Component: | Layout and Rendering | Assignee: | Nobody <webkit-unassigned> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | bfulgham, simon.fraser, webkit-bug-importer, zalan | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
|
Description
Ahmad Saleem
2023-02-16 13:45:23 PST
yeah, we should take this fix. Thank you! bool overflowIsClipOrVisible = isOverflowClipOrVisible(style.overflowX()) && isOverflowClipOrVisible(style.overflowX());
if (!overflowIsClipOrVisible && (style.display() == DisplayType::Table || style.display() == DisplayType::InlineTable)) {
// Tables only support overflow:hidden and overflow:visible and ignore anything else,
// see https://drafts.csswg.org/css2/#overflow. As a table is not a block
// container box the rules for resolving conflicting x and y values in CSS Overflow Module
// Level 3 do not apply. Arguably overflow-x and overflow-y aren't allowed on tables but
// all UAs allow it.
if (style.overflowX() != Overflow::Hidden)
style.setOverflowX(Overflow::Visible);
if (style.overflowY() != Overflow::Hidden)
style.setOverflowY(Overflow::Visible);
// If we are left with conflicting overflow values for the x and y axes on a table then resolve
// both to Overflow::Visible. This is interoperable behaviour but is not specced anywhere.
if (style.overflowX() == Overflow::Visible)
style.setOverflowY(Overflow::Visible);
else if (style.overflowY() == Overflow::Visible)
style.setOverflowX(Overflow::Visible);
} else if (!isOverflowClipOrVisible(style.overflowY())) {
// Values of 'clip' and 'visible' can only be used with 'clip' and 'visible'.
// If they aren't, 'clip' and 'visible' is reset.
if (style.overflowX() == Overflow::Visible)
style.setOverflowX(Overflow::Auto);
else if (style.overflowX() == Overflow::Clip)
style.setOverflowX(Overflow::Hidden);
} else if (!isOverflowClipOrVisible(style.overflowX())) {
// Values of 'clip' and 'visible' can only be used with 'clip' and 'visible'.
// If they aren't, 'clip' and 'visible' is reset.
if (style.overflowY() == Overflow::Visible)
style.setOverflowY(Overflow::Auto);
else if (style.overflowY() == Overflow::Clip)
style.setOverflowY(Overflow::Hidden);
}
and
static bool isOverflowClipOrVisible(Overflow overflow)
{
return overflow == Overflow::Clip || overflow == Overflow::Clip;
}
____
It leads to massive failures in WPT test suite. :-(
(In reply to Ahmad Saleem from comment #3) > bool overflowIsClipOrVisible = isOverflowClipOrVisible(style.overflowX()) && > isOverflowClipOrVisible(style.overflowX()); > if (!overflowIsClipOrVisible && (style.display() == DisplayType::Table > || style.display() == DisplayType::InlineTable)) { > // Tables only support overflow:hidden and overflow:visible and > ignore anything else, > // see https://drafts.csswg.org/css2/#overflow. As a table is not a > block > // container box the rules for resolving conflicting x and y values > in CSS Overflow Module > // Level 3 do not apply. Arguably overflow-x and overflow-y aren't > allowed on tables but > // all UAs allow it. > if (style.overflowX() != Overflow::Hidden) > style.setOverflowX(Overflow::Visible); > if (style.overflowY() != Overflow::Hidden) > style.setOverflowY(Overflow::Visible); > // If we are left with conflicting overflow values for the x and y > axes on a table then resolve > // both to Overflow::Visible. This is interoperable behaviour but is > not specced anywhere. > if (style.overflowX() == Overflow::Visible) > style.setOverflowY(Overflow::Visible); > else if (style.overflowY() == Overflow::Visible) > style.setOverflowX(Overflow::Visible); > } else if (!isOverflowClipOrVisible(style.overflowY())) { > // Values of 'clip' and 'visible' can only be used with 'clip' and > 'visible'. > // If they aren't, 'clip' and 'visible' is reset. > if (style.overflowX() == Overflow::Visible) > style.setOverflowX(Overflow::Auto); > else if (style.overflowX() == Overflow::Clip) > style.setOverflowX(Overflow::Hidden); > } else if (!isOverflowClipOrVisible(style.overflowX())) { > // Values of 'clip' and 'visible' can only be used with 'clip' and > 'visible'. > // If they aren't, 'clip' and 'visible' is reset. > if (style.overflowY() == Overflow::Visible) > style.setOverflowY(Overflow::Auto); > else if (style.overflowY() == Overflow::Clip) > style.setOverflowY(Overflow::Hidden); > } > > and > > static bool isOverflowClipOrVisible(Overflow overflow) > { > return overflow == Overflow::Clip || overflow == Overflow::Clip; > } > > ____ > > It leads to massive failures in WPT test suite. :-( ^ based on 'Style_Adjuster.cc' from Chromium / Blink. Big Facepalm for me:
static bool isOverflowClipOrVisible(Overflow overflow)
{
return overflow == Overflow::Clip || overflow == Overflow::Clip;
}
Clip <- twice...
Committed 266560@main (e6264aebbca8): <https://commits.webkit.org/266560@main> Reviewed commits have been landed. Closing PR #16219 and removing active labels. |