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 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1009 | 1009 |
1010 return layoutObject; | 1010 return layoutObject; |
1011 } | 1011 } |
1012 | 1012 |
1013 bool PaintLayerScrollableArea::needsScrollbarReconstruction() const | 1013 bool PaintLayerScrollableArea::needsScrollbarReconstruction() const |
1014 { | 1014 { |
1015 const LayoutObject& actualLayoutObject = layoutObjectForScrollbar(box()); | 1015 const LayoutObject& actualLayoutObject = layoutObjectForScrollbar(box()); |
1016 bool shouldUseCustom = actualLayoutObject.isBox() && actualLayoutObject.styl
eRef().hasPseudoStyle(SCROLLBAR); | 1016 bool shouldUseCustom = actualLayoutObject.isBox() && actualLayoutObject.styl
eRef().hasPseudoStyle(SCROLLBAR); |
1017 bool hasAnyScrollbar = hasScrollbar(); | 1017 bool hasAnyScrollbar = hasScrollbar(); |
1018 bool hasCustom = (hasHorizontalScrollbar() && horizontalScrollbar()->isCusto
mScrollbar()) || (hasVerticalScrollbar() && verticalScrollbar()->isCustomScrollb
ar()); | 1018 bool hasCustom = (hasHorizontalScrollbar() && horizontalScrollbar()->isCusto
mScrollbar()) || (hasVerticalScrollbar() && verticalScrollbar()->isCustomScrollb
ar()); |
1019 return hasAnyScrollbar && (shouldUseCustom != hasCustom); | 1019 bool didCustomScrollbarOwnerChanged = false; |
| 1020 |
| 1021 if (hasHorizontalScrollbar() && horizontalScrollbar()->isCustomScrollbar())
{ |
| 1022 if (actualLayoutObject != toLayoutScrollbar(horizontalScrollbar())->owni
ngLayoutObject()) |
| 1023 didCustomScrollbarOwnerChanged = true; |
| 1024 } |
| 1025 |
| 1026 if (hasVerticalScrollbar() && verticalScrollbar()->isCustomScrollbar()) { |
| 1027 if (actualLayoutObject != toLayoutScrollbar(verticalScrollbar())->owning
LayoutObject()) |
| 1028 didCustomScrollbarOwnerChanged = true; |
| 1029 } |
| 1030 |
| 1031 return hasAnyScrollbar && ((shouldUseCustom != hasCustom) || (shouldUseCusto
m && didCustomScrollbarOwnerChanged)); |
1020 } | 1032 } |
1021 | 1033 |
1022 void PaintLayerScrollableArea::setHasHorizontalScrollbar(bool hasScrollbar) | 1034 void PaintLayerScrollableArea::setHasHorizontalScrollbar(bool hasScrollbar) |
1023 { | 1035 { |
1024 if (hasScrollbar == hasHorizontalScrollbar()) | 1036 if (hasScrollbar == hasHorizontalScrollbar()) |
1025 return; | 1037 return; |
1026 | 1038 |
1027 if (!hasScrollbar && !layerForHorizontalScrollbar()) | 1039 if (!hasScrollbar && !layerForHorizontalScrollbar()) |
1028 horizontalScrollbar()->invalidate(); | 1040 horizontalScrollbar()->invalidate(); |
1029 | 1041 |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1562 } | 1574 } |
1563 | 1575 |
1564 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager) | 1576 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager) |
1565 { | 1577 { |
1566 visitor->trace(m_scrollableArea); | 1578 visitor->trace(m_scrollableArea); |
1567 visitor->trace(m_hBar); | 1579 visitor->trace(m_hBar); |
1568 visitor->trace(m_vBar); | 1580 visitor->trace(m_vBar); |
1569 } | 1581 } |
1570 | 1582 |
1571 } // namespace blink | 1583 } // namespace blink |
OLD | NEW |