Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(506)

Unified Diff: Source/core/css/resolver/StyleAdjuster.cpp

Issue 1228373007: Compute the correct overflow-x and overflow-y values for table elements (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/table/table-different-overflow-values-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleAdjuster.cpp
diff --git a/Source/core/css/resolver/StyleAdjuster.cpp b/Source/core/css/resolver/StyleAdjuster.cpp
index ea0adfd5adacb3065e46e9a919226b7510e37cc5..93f090c2560853ca49a79e3eea4c54dafe4201f3 100644
--- a/Source/core/css/resolver/StyleAdjuster.cpp
+++ b/Source/core/css/resolver/StyleAdjuster.cpp
@@ -430,8 +430,24 @@ void StyleAdjuster::adjustOverflow(ComputedStyle& style)
{
ASSERT(style.overflowX() != OVISIBLE || style.overflowY() != OVISIBLE);
- // If either overflow value is not visible, change to auto.
- if (style.overflowX() == OVISIBLE && style.overflowY() != OVISIBLE) {
+ if (style.display() == TABLE || style.display() == INLINE_TABLE) {
+ // Tables only support overflow:hidden and overflow:visible and ignore anything else,
+ // see http://dev.w3.org/csswg/css2/visufx.html#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() != OHIDDEN)
+ style.setOverflowX(OVISIBLE);
+ if (style.overflowY() != OHIDDEN)
+ style.setOverflowY(OVISIBLE);
+ // If we are left with conflicting overflow values for the x and y axes on a table then resolve
+ // both to OVISIBLE. This is interoperable behaviour but is not specced anywhere.
+ if (style.overflowX() == OVISIBLE)
+ style.setOverflowY(OVISIBLE);
+ else if (style.overflowY() == OVISIBLE)
+ style.setOverflowX(OVISIBLE);
+ } else if (style.overflowX() == OVISIBLE && style.overflowY() != OVISIBLE) {
+ // If either overflow value is not visible, change to auto.
// FIXME: Once we implement pagination controls, overflow-x should default to hidden
// if overflow-y is set to -webkit-paged-x or -webkit-page-y. For now, we'll let it
// default to auto so we can at least scroll through the pages.
@@ -440,16 +456,6 @@ void StyleAdjuster::adjustOverflow(ComputedStyle& style)
style.setOverflowY(OAUTO);
}
- // Table rows, sections and the table itself will support overflow:hidden and will ignore scroll/auto.
- // FIXME: Eventually table sections will support auto and scroll.
- if (style.display() == TABLE || style.display() == INLINE_TABLE
- || style.display() == TABLE_ROW_GROUP || style.display() == TABLE_ROW) {
- if (style.overflowX() != OVISIBLE && style.overflowX() != OHIDDEN)
- style.setOverflowX(OVISIBLE);
- if (style.overflowY() != OVISIBLE && style.overflowY() != OHIDDEN)
- style.setOverflowY(OVISIBLE);
- }
-
// Menulists should have visible overflow
if (style.appearance() == MenulistPart) {
style.setOverflowX(OVISIBLE);
« no previous file with comments | « LayoutTests/fast/table/table-different-overflow-values-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698