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 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 // overflow:auto may need to lay out again if scrollbars got added/removed. | 594 // overflow:auto may need to lay out again if scrollbars got added/removed. |
595 bool autoHorizontalScrollBarChanged = m_box->hasAutoHorizontalScrollbar() &&
(hasHorizontalScrollbar() != hasHorizontalOverflow); | 595 bool autoHorizontalScrollBarChanged = m_box->hasAutoHorizontalScrollbar() &&
(hasHorizontalScrollbar() != hasHorizontalOverflow); |
596 bool autoVerticalScrollBarChanged = m_box->hasAutoVerticalScrollbar() && (ha
sVerticalScrollbar() != hasVerticalOverflow); | 596 bool autoVerticalScrollBarChanged = m_box->hasAutoVerticalScrollbar() && (ha
sVerticalScrollbar() != hasVerticalOverflow); |
597 | 597 |
598 if (autoHorizontalScrollBarChanged || autoVerticalScrollBarChanged) { | 598 if (autoHorizontalScrollBarChanged || autoVerticalScrollBarChanged) { |
599 if (m_box->hasAutoHorizontalScrollbar()) | 599 if (m_box->hasAutoHorizontalScrollbar()) |
600 setHasHorizontalScrollbar(hasHorizontalOverflow); | 600 setHasHorizontalScrollbar(hasHorizontalOverflow); |
601 if (m_box->hasAutoVerticalScrollbar()) | 601 if (m_box->hasAutoVerticalScrollbar()) |
602 setHasVerticalScrollbar(hasVerticalOverflow); | 602 setHasVerticalScrollbar(hasVerticalOverflow); |
603 | 603 |
| 604 if (hasVerticalOverflow || hasHorizontalOverflow) |
| 605 updateScrollCornerStyle(); |
| 606 |
604 layer()->updateSelfPaintingLayer(); | 607 layer()->updateSelfPaintingLayer(); |
605 | 608 |
606 // Force an update since we know the scrollbars have changed things. | 609 // Force an update since we know the scrollbars have changed things. |
607 if (m_box->document().hasAnnotatedRegions()) | 610 if (m_box->document().hasAnnotatedRegions()) |
608 m_box->document().setAnnotatedRegionsDirty(true); | 611 m_box->document().setAnnotatedRegionsDirty(true); |
609 | 612 |
610 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) | 613 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) |
611 m_box->repaint(); | 614 m_box->repaint(); |
612 | 615 |
613 if (m_box->style()->overflowX() == OAUTO || m_box->style()->overflowY()
== OAUTO) { | 616 if (m_box->style()->overflowX() == OAUTO || m_box->style()->overflowY()
== OAUTO) { |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
951 bool RenderLayerScrollableArea::scrollsOverflow() const | 954 bool RenderLayerScrollableArea::scrollsOverflow() const |
952 { | 955 { |
953 if (FrameView* frameView = m_box->view()->frameView()) | 956 if (FrameView* frameView = m_box->view()->frameView()) |
954 return frameView->containsScrollableArea(this); | 957 return frameView->containsScrollableArea(this); |
955 | 958 |
956 return false; | 959 return false; |
957 } | 960 } |
958 | 961 |
959 void RenderLayerScrollableArea::updateScrollCornerStyle() | 962 void RenderLayerScrollableArea::updateScrollCornerStyle() |
960 { | 963 { |
| 964 if (!m_scrollCorner && !hasScrollbar()) |
| 965 return; |
| 966 if (!m_scrollCorner && hasOverlayScrollbars()) |
| 967 return; |
| 968 |
961 RenderObject* actualRenderer = rendererForScrollbar(m_box); | 969 RenderObject* actualRenderer = rendererForScrollbar(m_box); |
962 RefPtr<RenderStyle> corner = m_box->hasOverflowClip() ? actualRenderer->getU
ncachedPseudoStyle(PseudoStyleRequest(SCROLLBAR_CORNER), actualRenderer->style()
) : PassRefPtr<RenderStyle>(nullptr); | 970 RefPtr<RenderStyle> corner = m_box->hasOverflowClip() ? actualRenderer->getU
ncachedPseudoStyle(PseudoStyleRequest(SCROLLBAR_CORNER), actualRenderer->style()
) : PassRefPtr<RenderStyle>(nullptr); |
963 if (corner) { | 971 if (corner) { |
964 if (!m_scrollCorner) { | 972 if (!m_scrollCorner) { |
965 m_scrollCorner = RenderScrollbarPart::createAnonymous(&m_box->docume
nt()); | 973 m_scrollCorner = RenderScrollbarPart::createAnonymous(&m_box->docume
nt()); |
966 m_scrollCorner->setParent(m_box); | 974 m_scrollCorner->setParent(m_box); |
967 } | 975 } |
968 m_scrollCorner->setStyle(corner.release()); | 976 m_scrollCorner->setStyle(corner.release()); |
969 } else if (m_scrollCorner) { | 977 } else if (m_scrollCorner) { |
970 m_scrollCorner->destroy(); | 978 m_scrollCorner->destroy(); |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1523 void RenderLayerScrollableArea::setForceNeedsCompositedScrolling(ForceNeedsCompo
sitedScrollingMode mode) | 1531 void RenderLayerScrollableArea::setForceNeedsCompositedScrolling(ForceNeedsCompo
sitedScrollingMode mode) |
1524 { | 1532 { |
1525 if (m_forceNeedsCompositedScrolling == mode) | 1533 if (m_forceNeedsCompositedScrolling == mode) |
1526 return; | 1534 return; |
1527 | 1535 |
1528 m_forceNeedsCompositedScrolling = mode; | 1536 m_forceNeedsCompositedScrolling = mode; |
1529 layer()->didUpdateNeedsCompositedScrolling(); | 1537 layer()->didUpdateNeedsCompositedScrolling(); |
1530 } | 1538 } |
1531 | 1539 |
1532 } // Namespace WebCore | 1540 } // Namespace WebCore |
OLD | NEW |