| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2009 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008, 2009 Apple Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 return SCROLLBAR; | 218 return SCROLLBAR; |
| 219 } | 219 } |
| 220 | 220 |
| 221 void RenderScrollbar::updateScrollbarPart(ScrollbarPart partType, bool destroy) | 221 void RenderScrollbar::updateScrollbarPart(ScrollbarPart partType, bool destroy) |
| 222 { | 222 { |
| 223 if (partType == NoPart) | 223 if (partType == NoPart) |
| 224 return; | 224 return; |
| 225 | 225 |
| 226 RefPtr<RenderStyle> partStyle = !destroy ? getScrollbarPseudoStyle(partType,
pseudoForScrollbarPart(partType)) : PassRefPtr<RenderStyle>(nullptr); | 226 RefPtr<RenderStyle> partStyle = !destroy ? getScrollbarPseudoStyle(partType,
pseudoForScrollbarPart(partType)) : PassRefPtr<RenderStyle>(nullptr); |
| 227 | 227 |
| 228 bool needRenderer = !destroy && partStyle && partStyle->display() != NONE &&
partStyle->visibility() == VISIBLE; | 228 bool needRenderer = !destroy && partStyle && partStyle->display() != NONE; |
| 229 | 229 |
| 230 if (needRenderer && partStyle->display() != BLOCK) { | 230 if (needRenderer && partStyle->display() != BLOCK) { |
| 231 // See if we are a button that should not be visible according to OS set
tings. | 231 // See if we are a button that should not be visible according to OS set
tings. |
| 232 ScrollbarButtonsPlacement buttonsPlacement = theme()->buttonsPlacement()
; | 232 ScrollbarButtonsPlacement buttonsPlacement = theme()->buttonsPlacement()
; |
| 233 switch (partType) { | 233 switch (partType) { |
| 234 case BackButtonStartPart: | 234 case BackButtonStartPart: |
| 235 needRenderer = (buttonsPlacement == ScrollbarButtonsSingle || bu
ttonsPlacement == ScrollbarButtonsDoubleStart || | 235 needRenderer = (buttonsPlacement == ScrollbarButtonsSingle || bu
ttonsPlacement == ScrollbarButtonsDoubleStart || |
| 236 buttonsPlacement == ScrollbarButtonsDoubleBoth); | 236 buttonsPlacement == ScrollbarButtonsDoubleBoth); |
| 237 break; | 237 break; |
| 238 case ForwardButtonStartPart: | 238 case ForwardButtonStartPart: |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 int RenderScrollbar::minimumThumbLength() | 350 int RenderScrollbar::minimumThumbLength() |
| 351 { | 351 { |
| 352 RenderScrollbarPart* partRenderer = m_parts.get(ThumbPart); | 352 RenderScrollbarPart* partRenderer = m_parts.get(ThumbPart); |
| 353 if (!partRenderer) | 353 if (!partRenderer) |
| 354 return 0; | 354 return 0; |
| 355 partRenderer->layout(); | 355 partRenderer->layout(); |
| 356 return orientation() == HorizontalScrollbar ? partRenderer->width() : partRe
nderer->height(); | 356 return orientation() == HorizontalScrollbar ? partRenderer->width() : partRe
nderer->height(); |
| 357 } | 357 } |
| 358 | 358 |
| 359 } | 359 } |
| OLD | NEW |