Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 5 * | 5 * |
| 6 * Other contributors: | 6 * Other contributors: |
| 7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
| 9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
| 10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 604 } | 604 } |
| 605 | 605 |
| 606 bool hasHorizontalOverflow = this->hasHorizontalOverflow(); | 606 bool hasHorizontalOverflow = this->hasHorizontalOverflow(); |
| 607 bool hasVerticalOverflow = this->hasVerticalOverflow(); | 607 bool hasVerticalOverflow = this->hasVerticalOverflow(); |
| 608 | 608 |
| 609 { | 609 { |
| 610 // Hits in compositing/overflow/automatically-opt-into-composited-scroll ing-after-style-change.html. | 610 // Hits in compositing/overflow/automatically-opt-into-composited-scroll ing-after-style-change.html. |
| 611 DisableCompositingQueryAsserts disabler; | 611 DisableCompositingQueryAsserts disabler; |
| 612 | 612 |
| 613 // overflow:scroll should just enable/disable. | 613 // overflow:scroll should just enable/disable. |
| 614 if (box().style()->overflowX() == OSCROLL) | 614 if (box().style()->overflowX() == OSCROLL && horizontalScrollbar()) |
|
MuVen
2014/10/13 15:45:01
This checks fixes webkit_unit_tests crashes on and
| |
| 615 horizontalScrollbar()->setEnabled(hasHorizontalOverflow); | 615 horizontalScrollbar()->setEnabled(hasHorizontalOverflow); |
| 616 if (box().style()->overflowY() == OSCROLL) | 616 if (box().style()->overflowY() == OSCROLL && verticalScrollbar()) |
| 617 verticalScrollbar()->setEnabled(hasVerticalOverflow); | 617 verticalScrollbar()->setEnabled(hasVerticalOverflow); |
| 618 } | 618 } |
| 619 | 619 if (hasOverlayScrollbars()) { |
| 620 if (!scrollSize(HorizontalScrollbar)) | |
| 621 setHasHorizontalScrollbar(false); | |
| 622 if (!scrollSize(VerticalScrollbar)) | |
| 623 setHasVerticalScrollbar(false); | |
| 624 } | |
| 620 // overflow:auto may need to lay out again if scrollbars got added/removed. | 625 // overflow:auto may need to lay out again if scrollbars got added/removed. |
| 621 bool autoHorizontalScrollBarChanged = box().hasAutoHorizontalScrollbar() && (hasHorizontalScrollbar() != hasHorizontalOverflow); | 626 bool autoHorizontalScrollBarChanged = box().hasAutoHorizontalScrollbar() && (hasHorizontalScrollbar() != hasHorizontalOverflow); |
| 622 bool autoVerticalScrollBarChanged = box().hasAutoVerticalScrollbar() && (has VerticalScrollbar() != hasVerticalOverflow); | 627 bool autoVerticalScrollBarChanged = box().hasAutoVerticalScrollbar() && (has VerticalScrollbar() != hasVerticalOverflow); |
| 623 | 628 |
| 624 if (autoHorizontalScrollBarChanged || autoVerticalScrollBarChanged) { | 629 if (autoHorizontalScrollBarChanged || autoVerticalScrollBarChanged) { |
| 625 if (box().hasAutoHorizontalScrollbar()) | 630 if (box().hasAutoHorizontalScrollbar()) |
| 626 setHasHorizontalScrollbar(hasHorizontalOverflow); | 631 setHasHorizontalScrollbar(hasHorizontalOverflow); |
| 627 if (box().hasAutoVerticalScrollbar()) | 632 if (box().hasAutoVerticalScrollbar()) |
| 628 setHasVerticalScrollbar(hasVerticalOverflow); | 633 setHasVerticalScrollbar(hasVerticalOverflow); |
| 629 | 634 |
| (...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1486 void RenderLayerScrollableArea::setTopmostScrollChild(RenderLayer* scrollChild) | 1491 void RenderLayerScrollableArea::setTopmostScrollChild(RenderLayer* scrollChild) |
| 1487 { | 1492 { |
| 1488 // We only want to track the topmost scroll child for scrollable areas with | 1493 // We only want to track the topmost scroll child for scrollable areas with |
| 1489 // overlay scrollbars. | 1494 // overlay scrollbars. |
| 1490 if (!hasOverlayScrollbars()) | 1495 if (!hasOverlayScrollbars()) |
| 1491 return; | 1496 return; |
| 1492 m_nextTopmostScrollChild = scrollChild; | 1497 m_nextTopmostScrollChild = scrollChild; |
| 1493 } | 1498 } |
| 1494 | 1499 |
| 1495 } // namespace blink | 1500 } // namespace blink |
| OLD | NEW |