| 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 static IntRect cornerRect(const LayoutBox& box, const Scrollbar* horizontalScrol
lbar, const Scrollbar* verticalScrollbar, const IntRect& bounds) | 235 static IntRect cornerRect(const LayoutBox& box, const Scrollbar* horizontalScrol
lbar, const Scrollbar* verticalScrollbar, const IntRect& bounds) |
| 236 { | 236 { |
| 237 int horizontalThickness; | 237 int horizontalThickness; |
| 238 int verticalThickness; | 238 int verticalThickness; |
| 239 if (!verticalScrollbar && !horizontalScrollbar) { | 239 if (!verticalScrollbar && !horizontalScrollbar) { |
| 240 // FIXME: This isn't right. We need to know the thickness of custom scro
llbars | 240 // FIXME: This isn't right. We need to know the thickness of custom scro
llbars |
| 241 // even when they don't exist in order to set the resizer square size pr
operly. | 241 // even when they don't exist in order to set the resizer square size pr
operly. |
| 242 horizontalThickness = ScrollbarTheme::theme().scrollbarThickness(); | 242 horizontalThickness = ScrollbarTheme::theme().scrollbarThickness(); |
| 243 verticalThickness = horizontalThickness; | 243 verticalThickness = horizontalThickness; |
| 244 } else if (verticalScrollbar && !horizontalScrollbar) { | 244 } else if (verticalScrollbar && !horizontalScrollbar) { |
| 245 horizontalThickness = verticalScrollbar->scrollbarThickness(); | 245 horizontalThickness = verticalScrollbar->width(); |
| 246 verticalThickness = horizontalThickness; | 246 verticalThickness = horizontalThickness; |
| 247 } else if (horizontalScrollbar && !verticalScrollbar) { | 247 } else if (horizontalScrollbar && !verticalScrollbar) { |
| 248 verticalThickness = horizontalScrollbar->scrollbarThickness(); | 248 verticalThickness = horizontalScrollbar->height(); |
| 249 horizontalThickness = verticalThickness; | 249 horizontalThickness = verticalThickness; |
| 250 } else { | 250 } else { |
| 251 horizontalThickness = verticalScrollbar->scrollbarThickness(); | 251 horizontalThickness = verticalScrollbar->width(); |
| 252 verticalThickness = horizontalScrollbar->scrollbarThickness(); | 252 verticalThickness = horizontalScrollbar->height(); |
| 253 } | 253 } |
| 254 return IntRect(cornerStart(box, bounds.x(), bounds.maxX(), horizontalThickne
ss), | 254 return IntRect(cornerStart(box, bounds.x(), bounds.maxX(), horizontalThickne
ss), |
| 255 bounds.maxY() - verticalThickness - box.styleRef().borderBottomWidth(), | 255 bounds.maxY() - verticalThickness - box.styleRef().borderBottomWidth(), |
| 256 horizontalThickness, verticalThickness); | 256 horizontalThickness, verticalThickness); |
| 257 } | 257 } |
| 258 | 258 |
| 259 | 259 |
| 260 IntRect PaintLayerScrollableArea::scrollCornerRect() const | 260 IntRect PaintLayerScrollableArea::scrollCornerRect() const |
| 261 { | 261 { |
| 262 // We have a scrollbar corner when a scrollbar is visible and not filling th
e entire length of the box. | 262 // We have a scrollbar corner when a scrollbar is visible and not filling th
e entire length of the box. |
| (...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1501 ASSERT(orientation == HorizontalScrollbar ? !m_hBarIsAttached : !m_vBarIsAtt
ached); | 1501 ASSERT(orientation == HorizontalScrollbar ? !m_hBarIsAttached : !m_vBarIsAtt
ached); |
| 1502 RefPtrWillBeRawPtr<Scrollbar> scrollbar = nullptr; | 1502 RefPtrWillBeRawPtr<Scrollbar> scrollbar = nullptr; |
| 1503 const LayoutObject& actualLayoutObject = layoutObjectForScrollbar(m_scrollab
leArea->box()); | 1503 const LayoutObject& actualLayoutObject = layoutObjectForScrollbar(m_scrollab
leArea->box()); |
| 1504 bool hasCustomScrollbarStyle = actualLayoutObject.isBox() && actualLayoutObj
ect.styleRef().hasPseudoStyle(SCROLLBAR); | 1504 bool hasCustomScrollbarStyle = actualLayoutObject.isBox() && actualLayoutObj
ect.styleRef().hasPseudoStyle(SCROLLBAR); |
| 1505 if (hasCustomScrollbarStyle) { | 1505 if (hasCustomScrollbarStyle) { |
| 1506 scrollbar = LayoutScrollbar::createCustomScrollbar(m_scrollableArea.get(
), orientation, actualLayoutObject.node()); | 1506 scrollbar = LayoutScrollbar::createCustomScrollbar(m_scrollableArea.get(
), orientation, actualLayoutObject.node()); |
| 1507 } else { | 1507 } else { |
| 1508 ScrollbarControlSize scrollbarSize = RegularScrollbar; | 1508 ScrollbarControlSize scrollbarSize = RegularScrollbar; |
| 1509 if (actualLayoutObject.styleRef().hasAppearance()) | 1509 if (actualLayoutObject.styleRef().hasAppearance()) |
| 1510 scrollbarSize = LayoutTheme::theme().scrollbarControlSizeForPart(act
ualLayoutObject.styleRef().appearance()); | 1510 scrollbarSize = LayoutTheme::theme().scrollbarControlSizeForPart(act
ualLayoutObject.styleRef().appearance()); |
| 1511 scrollbar = Scrollbar::create(m_scrollableArea.get(), orientation, scrol
lbarSize, &m_scrollableArea->box().frame()->page()->chromeClient()); | 1511 scrollbar = Scrollbar::create(m_scrollableArea.get(), orientation, scrol
lbarSize); |
| 1512 if (orientation == HorizontalScrollbar) | 1512 if (orientation == HorizontalScrollbar) |
| 1513 m_scrollableArea->didAddScrollbar(*scrollbar, HorizontalScrollbar); | 1513 m_scrollableArea->didAddScrollbar(*scrollbar, HorizontalScrollbar); |
| 1514 else | 1514 else |
| 1515 m_scrollableArea->didAddScrollbar(*scrollbar, VerticalScrollbar); | 1515 m_scrollableArea->didAddScrollbar(*scrollbar, VerticalScrollbar); |
| 1516 } | 1516 } |
| 1517 m_scrollableArea->box().document().view()->addChild(scrollbar.get()); | 1517 m_scrollableArea->box().document().view()->addChild(scrollbar.get()); |
| 1518 return scrollbar.release(); | 1518 return scrollbar.release(); |
| 1519 } | 1519 } |
| 1520 | 1520 |
| 1521 void PaintLayerScrollableArea::ScrollbarManager::destroyScrollbar(ScrollbarOrien
tation orientation) | 1521 void PaintLayerScrollableArea::ScrollbarManager::destroyScrollbar(ScrollbarOrien
tation orientation) |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1536 } | 1536 } |
| 1537 | 1537 |
| 1538 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager) | 1538 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager) |
| 1539 { | 1539 { |
| 1540 visitor->trace(m_scrollableArea); | 1540 visitor->trace(m_scrollableArea); |
| 1541 visitor->trace(m_hBar); | 1541 visitor->trace(m_hBar); |
| 1542 visitor->trace(m_vBar); | 1542 visitor->trace(m_vBar); |
| 1543 } | 1543 } |
| 1544 | 1544 |
| 1545 } // namespace blink | 1545 } // namespace blink |
| OLD | NEW |