OLD | NEW |
---|---|
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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
417 } | 417 } |
418 | 418 |
419 return; | 419 return; |
420 } | 420 } |
421 } | 421 } |
422 | 422 |
423 void StyleAdjuster::adjustOverflow(ComputedStyle& style) | 423 void StyleAdjuster::adjustOverflow(ComputedStyle& style) |
424 { | 424 { |
425 ASSERT(style.overflowX() != OVISIBLE || style.overflowY() != OVISIBLE); | 425 ASSERT(style.overflowX() != OVISIBLE || style.overflowY() != OVISIBLE); |
426 | 426 |
427 // Tables support overflow:hidden and will ignore scroll/auto. | |
Julien - ping for review
2015/07/16 14:58:13
Let's link to spec! I love that in your descriptio
mstensho (USE GERRIT)
2015/07/16 20:00:06
We will (and should) also ignore "-webkit-paged-x"
| |
428 if (style.display() == TABLE || style.display() == INLINE_TABLE) { | |
429 if (style.overflowX() != OVISIBLE && style.overflowX() != OHIDDEN) | |
Julien - ping for review
2015/07/16 14:58:13
I would whitelist here (style.overflowX() == OSCRO
mstensho (USE GERRIT)
2015/07/16 20:00:07
I don't think that's a good idea. What does overfl
Julien - ping for review
2015/07/17 00:29:55
We didn't explicitly mention the paged overflow va
| |
430 style.setOverflowX(OVISIBLE); | |
431 if (style.overflowY() != OVISIBLE && style.overflowY() != OHIDDEN) | |
432 style.setOverflowY(OVISIBLE); | |
433 } | |
434 | |
427 // If either overflow value is not visible, change to auto. | 435 // If either overflow value is not visible, change to auto. |
428 if (style.overflowX() == OVISIBLE && style.overflowY() != OVISIBLE) { | 436 if (style.overflowX() == OVISIBLE && style.overflowY() != OVISIBLE) { |
429 // FIXME: Once we implement pagination controls, overflow-x should defau lt to hidden | 437 // FIXME: Once we implement pagination controls, overflow-x should defau lt to hidden |
430 // if overflow-y is set to -webkit-paged-x or -webkit-page-y. For now, w e'll let it | 438 // if overflow-y is set to -webkit-paged-x or -webkit-page-y. For now, w e'll let it |
431 // default to auto so we can at least scroll through the pages. | 439 // default to auto so we can at least scroll through the pages. |
432 style.setOverflowX(OAUTO); | 440 style.setOverflowX(OAUTO); |
mstensho (USE GERRIT)
2015/07/16 20:00:06
Here you could end up setting overflow-x to auto o
| |
433 } else if (style.overflowY() == OVISIBLE && style.overflowX() != OVISIBLE) { | 441 } else if (style.overflowY() == OVISIBLE && style.overflowX() != OVISIBLE) { |
434 style.setOverflowY(OAUTO); | 442 style.setOverflowY(OAUTO); |
435 } | 443 } |
436 | 444 |
437 // Table rows, sections and the table itself will support overflow:hidden an d will ignore scroll/auto. | |
438 // FIXME: Eventually table sections will support auto and scroll. | |
439 if (style.display() == TABLE || style.display() == INLINE_TABLE | |
440 || style.display() == TABLE_ROW_GROUP || style.display() == TABLE_ROW) { | |
441 if (style.overflowX() != OVISIBLE && style.overflowX() != OHIDDEN) | |
442 style.setOverflowX(OVISIBLE); | |
443 if (style.overflowY() != OVISIBLE && style.overflowY() != OHIDDEN) | |
444 style.setOverflowY(OVISIBLE); | |
445 } | |
446 | |
447 // Menulists should have visible overflow | 445 // Menulists should have visible overflow |
448 if (style.appearance() == MenulistPart) { | 446 if (style.appearance() == MenulistPart) { |
449 style.setOverflowX(OVISIBLE); | 447 style.setOverflowX(OVISIBLE); |
450 style.setOverflowY(OVISIBLE); | 448 style.setOverflowY(OVISIBLE); |
451 } | 449 } |
452 } | 450 } |
453 | 451 |
454 void StyleAdjuster::adjustStyleForDisplay(ComputedStyle& style, const ComputedSt yle& parentStyle) | 452 void StyleAdjuster::adjustStyleForDisplay(ComputedStyle& style, const ComputedSt yle& parentStyle) |
455 { | 453 { |
456 if (style.display() == BLOCK && !style.isFloating()) | 454 if (style.display() == BLOCK && !style.isFloating()) |
(...skipping 25 matching lines...) Expand all Loading... | |
482 if (style.writingMode() != TopToBottomWritingMode && (style.display() == BOX || style.display() == INLINE_BOX)) | 480 if (style.writingMode() != TopToBottomWritingMode && (style.display() == BOX || style.display() == INLINE_BOX)) |
483 style.setWritingMode(TopToBottomWritingMode); | 481 style.setWritingMode(TopToBottomWritingMode); |
484 | 482 |
485 if (parentStyle.isDisplayFlexibleOrGridBox()) { | 483 if (parentStyle.isDisplayFlexibleOrGridBox()) { |
486 style.setFloating(NoFloat); | 484 style.setFloating(NoFloat); |
487 style.setDisplay(equivalentBlockDisplay(style.display(), style.isFloatin g(), !m_useQuirksModeStyles)); | 485 style.setDisplay(equivalentBlockDisplay(style.display(), style.isFloatin g(), !m_useQuirksModeStyles)); |
488 } | 486 } |
489 } | 487 } |
490 | 488 |
491 } | 489 } |
OLD | NEW |