| 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 int oldThickness = isHorizontal ? height() : width(); | 173 int oldThickness = isHorizontal ? height() : width(); |
| 174 int newThickness = 0; | 174 int newThickness = 0; |
| 175 LayoutScrollbarPart* part = m_parts.get(ScrollbarBGPart); | 175 LayoutScrollbarPart* part = m_parts.get(ScrollbarBGPart); |
| 176 if (part) { | 176 if (part) { |
| 177 part->layout(); | 177 part->layout(); |
| 178 newThickness = | 178 newThickness = |
| 179 (isHorizontal ? part->size().height() : part->size().width()).toInt(); | 179 (isHorizontal ? part->size().height() : part->size().width()).toInt(); |
| 180 } | 180 } |
| 181 | 181 |
| 182 if (newThickness != oldThickness) { | 182 if (newThickness != oldThickness) { |
| 183 setFrameRect( | 183 setFrameRect(IntRect(location(), |
| 184 IntRect(location(), IntSize(isHorizontal ? width() : newThickness, | 184 IntSize(isHorizontal ? width() : newThickness, |
| 185 isHorizontal ? newThickness : height()))); | 185 isHorizontal ? newThickness : height()))); |
| 186 if (LayoutBox* box = styleSource()) { | 186 if (LayoutBox* box = styleSource()) { |
| 187 if (box->isLayoutBlock()) | 187 if (box->isLayoutBlock()) |
| 188 toLayoutBlock(box)->notifyScrollbarThicknessChanged(); | 188 toLayoutBlock(box)->notifyScrollbarThicknessChanged(); |
| 189 box->setChildNeedsLayout(); | 189 box->setChildNeedsLayout(); |
| 190 if (m_scrollableArea) | 190 if (m_scrollableArea) |
| 191 m_scrollableArea->setScrollCornerNeedsPaintInvalidation(); | 191 m_scrollableArea->setScrollCornerNeedsPaintInvalidation(); |
| 192 } | 192 } |
| 193 } | 193 } |
| 194 } | 194 } |
| 195 | 195 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 IntRect previousButton = buttonRect(BackButtonStartPart); | 308 IntRect previousButton = buttonRect(BackButtonStartPart); |
| 309 return IntRect( | 309 return IntRect( |
| 310 isHorizontal ? x() + previousButton.width() : x(), | 310 isHorizontal ? x() + previousButton.width() : x(), |
| 311 isHorizontal ? y() : y() + previousButton.height(), | 311 isHorizontal ? y() : y() + previousButton.height(), |
| 312 isHorizontal ? partLayoutObject->pixelSnappedWidth() : width(), | 312 isHorizontal ? partLayoutObject->pixelSnappedWidth() : width(), |
| 313 isHorizontal ? height() : partLayoutObject->pixelSnappedHeight()); | 313 isHorizontal ? height() : partLayoutObject->pixelSnappedHeight()); |
| 314 } | 314 } |
| 315 | 315 |
| 316 IntRect followingButton = buttonRect(ForwardButtonEndPart); | 316 IntRect followingButton = buttonRect(ForwardButtonEndPart); |
| 317 return IntRect( | 317 return IntRect( |
| 318 isHorizontal | 318 isHorizontal ? x() + width() - followingButton.width() - |
| 319 ? x() + width() - followingButton.width() - | 319 partLayoutObject->pixelSnappedWidth() |
| 320 partLayoutObject->pixelSnappedWidth() | 320 : x(), |
| 321 : x(), | |
| 322 isHorizontal ? y() | 321 isHorizontal ? y() |
| 323 : y() + height() - followingButton.height() - | 322 : y() + height() - followingButton.height() - |
| 324 partLayoutObject->pixelSnappedHeight(), | 323 partLayoutObject->pixelSnappedHeight(), |
| 325 isHorizontal ? partLayoutObject->pixelSnappedWidth() : width(), | 324 isHorizontal ? partLayoutObject->pixelSnappedWidth() : width(), |
| 326 isHorizontal ? height() : partLayoutObject->pixelSnappedHeight()); | 325 isHorizontal ? height() : partLayoutObject->pixelSnappedHeight()); |
| 327 } | 326 } |
| 328 | 327 |
| 329 IntRect LayoutScrollbar::trackRect(int startLength, int endLength) const { | 328 IntRect LayoutScrollbar::trackRect(int startLength, int endLength) const { |
| 330 LayoutScrollbarPart* part = m_parts.get(TrackBGPart); | 329 LayoutScrollbarPart* part = m_parts.get(TrackBGPart); |
| 331 if (part) | 330 if (part) |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 } | 380 } |
| 382 | 381 |
| 383 void LayoutScrollbar::invalidateDisplayItemClientsOfScrollbarParts() { | 382 void LayoutScrollbar::invalidateDisplayItemClientsOfScrollbarParts() { |
| 384 for (auto& part : m_parts) | 383 for (auto& part : m_parts) |
| 385 ObjectPaintInvalidator(*part.value) | 384 ObjectPaintInvalidator(*part.value) |
| 386 .invalidateDisplayItemClientsIncludingNonCompositingDescendants( | 385 .invalidateDisplayItemClientsIncludingNonCompositingDescendants( |
| 387 PaintInvalidationScroll); | 386 PaintInvalidationScroll); |
| 388 } | 387 } |
| 389 | 388 |
| 390 } // namespace blink | 389 } // namespace blink |
| OLD | NEW |