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

Side by Side 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, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fast/table/table-different-overflow-values-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 } 423 }
424 424
425 return; 425 return;
426 } 426 }
427 } 427 }
428 428
429 void StyleAdjuster::adjustOverflow(ComputedStyle& style) 429 void StyleAdjuster::adjustOverflow(ComputedStyle& style)
430 { 430 {
431 ASSERT(style.overflowX() != OVISIBLE || style.overflowY() != OVISIBLE); 431 ASSERT(style.overflowX() != OVISIBLE || style.overflowY() != OVISIBLE);
432 432
433 // If either overflow value is not visible, change to auto. 433 if (style.display() == TABLE || style.display() == INLINE_TABLE) {
434 if (style.overflowX() == OVISIBLE && style.overflowY() != OVISIBLE) { 434 // Tables only support overflow:hidden and overflow:visible and ignore a nything else,
435 // see http://dev.w3.org/csswg/css2/visufx.html#overflow. As a table is not a block
436 // container box the rules for resolving conflicting x and y values in C SS Overflow Module
437 // Level 3 do not apply. Arguably overflow-x and overflow-y aren't allow ed on tables but
438 // all UAs allow it.
439 if (style.overflowX() != OHIDDEN)
440 style.setOverflowX(OVISIBLE);
441 if (style.overflowY() != OHIDDEN)
442 style.setOverflowY(OVISIBLE);
443 // If we are left with conflicting overflow values for the x and y axes on a table then resolve
444 // both to OVISIBLE. This is interoperable behaviour but is not specced anywhere.
445 if (style.overflowX() == OVISIBLE)
446 style.setOverflowY(OVISIBLE);
447 else if (style.overflowY() == OVISIBLE)
448 style.setOverflowX(OVISIBLE);
449 } else if (style.overflowX() == OVISIBLE && style.overflowY() != OVISIBLE) {
450 // If either overflow value is not visible, change to auto.
435 // FIXME: Once we implement pagination controls, overflow-x should defau lt to hidden 451 // FIXME: Once we implement pagination controls, overflow-x should defau lt to hidden
436 // if overflow-y is set to -webkit-paged-x or -webkit-page-y. For now, w e'll let it 452 // if overflow-y is set to -webkit-paged-x or -webkit-page-y. For now, w e'll let it
437 // default to auto so we can at least scroll through the pages. 453 // default to auto so we can at least scroll through the pages.
438 style.setOverflowX(OAUTO); 454 style.setOverflowX(OAUTO);
439 } else if (style.overflowY() == OVISIBLE && style.overflowX() != OVISIBLE) { 455 } else if (style.overflowY() == OVISIBLE && style.overflowX() != OVISIBLE) {
440 style.setOverflowY(OAUTO); 456 style.setOverflowY(OAUTO);
441 } 457 }
442 458
443 // Table rows, sections and the table itself will support overflow:hidden an d will ignore scroll/auto.
444 // FIXME: Eventually table sections will support auto and scroll.
445 if (style.display() == TABLE || style.display() == INLINE_TABLE
446 || style.display() == TABLE_ROW_GROUP || style.display() == TABLE_ROW) {
447 if (style.overflowX() != OVISIBLE && style.overflowX() != OHIDDEN)
448 style.setOverflowX(OVISIBLE);
449 if (style.overflowY() != OVISIBLE && style.overflowY() != OHIDDEN)
450 style.setOverflowY(OVISIBLE);
451 }
452
453 // Menulists should have visible overflow 459 // Menulists should have visible overflow
454 if (style.appearance() == MenulistPart) { 460 if (style.appearance() == MenulistPart) {
455 style.setOverflowX(OVISIBLE); 461 style.setOverflowX(OVISIBLE);
456 style.setOverflowY(OVISIBLE); 462 style.setOverflowY(OVISIBLE);
457 } 463 }
458 } 464 }
459 465
460 void StyleAdjuster::adjustStyleForDisplay(ComputedStyle& style, const ComputedSt yle& parentStyle) 466 void StyleAdjuster::adjustStyleForDisplay(ComputedStyle& style, const ComputedSt yle& parentStyle)
461 { 467 {
462 if (style.display() == BLOCK && !style.isFloating()) 468 if (style.display() == BLOCK && !style.isFloating())
(...skipping 25 matching lines...) Expand all
488 if (style.writingMode() != TopToBottomWritingMode && (style.display() == BOX || style.display() == INLINE_BOX)) 494 if (style.writingMode() != TopToBottomWritingMode && (style.display() == BOX || style.display() == INLINE_BOX))
489 style.setWritingMode(TopToBottomWritingMode); 495 style.setWritingMode(TopToBottomWritingMode);
490 496
491 if (parentStyle.isDisplayFlexibleOrGridBox()) { 497 if (parentStyle.isDisplayFlexibleOrGridBox()) {
492 style.setFloating(NoFloat); 498 style.setFloating(NoFloat);
493 style.setDisplay(equivalentBlockDisplay(style.display(), style.isFloatin g(), !m_useQuirksModeStyles)); 499 style.setDisplay(equivalentBlockDisplay(style.display(), style.isFloatin g(), !m_useQuirksModeStyles));
494 } 500 }
495 } 501 }
496 502
497 } 503 }
OLDNEW
« 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