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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 newThickness = isHorizontal ? part->size().height() : part->size().width
(); | 194 newThickness = isHorizontal ? part->size().height() : part->size().width
(); |
195 } | 195 } |
196 | 196 |
197 if (newThickness != oldThickness) { | 197 if (newThickness != oldThickness) { |
198 setFrameRect(IntRect(location(), IntSize(isHorizontal ? width() : newThi
ckness, isHorizontal ? newThickness : height()))); | 198 setFrameRect(IntRect(location(), IntSize(isHorizontal ? width() : newThi
ckness, isHorizontal ? newThickness : height()))); |
199 if (LayoutBox* box = owningLayoutObjectWithinFrame()) { | 199 if (LayoutBox* box = owningLayoutObjectWithinFrame()) { |
200 if (box->isLayoutBlock()) | 200 if (box->isLayoutBlock()) |
201 toLayoutBlock(box)->notifyScrollbarThicknessChanged(); | 201 toLayoutBlock(box)->notifyScrollbarThicknessChanged(); |
202 box->setChildNeedsLayout(); | 202 box->setChildNeedsLayout(); |
203 if (m_scrollableArea) | 203 if (m_scrollableArea) |
204 m_scrollableArea->invalidateScrollCorner(m_scrollableArea->scrol
lCornerRect()); | 204 m_scrollableArea->setScrollCornerNeedsPaintInvalidation(); |
205 } | 205 } |
206 } | 206 } |
207 } | 207 } |
208 | 208 |
209 static PseudoId pseudoForScrollbarPart(ScrollbarPart part) | 209 static PseudoId pseudoForScrollbarPart(ScrollbarPart part) |
210 { | 210 { |
211 switch (part) { | 211 switch (part) { |
212 case BackButtonStartPart: | 212 case BackButtonStartPart: |
213 case ForwardButtonStartPart: | 213 case ForwardButtonStartPart: |
214 case BackButtonEndPart: | 214 case BackButtonEndPart: |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 | 355 |
356 int LayoutScrollbar::minimumThumbLength() const | 356 int LayoutScrollbar::minimumThumbLength() const |
357 { | 357 { |
358 LayoutScrollbarPart* partLayoutObject = m_parts.get(ThumbPart); | 358 LayoutScrollbarPart* partLayoutObject = m_parts.get(ThumbPart); |
359 if (!partLayoutObject) | 359 if (!partLayoutObject) |
360 return 0; | 360 return 0; |
361 partLayoutObject->layout(); | 361 partLayoutObject->layout(); |
362 return orientation() == HorizontalScrollbar ? partLayoutObject->size().width
() : partLayoutObject->size().height(); | 362 return orientation() == HorizontalScrollbar ? partLayoutObject->size().width
() : partLayoutObject->size().height(); |
363 } | 363 } |
364 | 364 |
365 void LayoutScrollbar::invalidateRect(const IntRect& rect) | 365 void LayoutScrollbar::invalidateDisplayItemClientsOfScrollbarParts(const LayoutB
oxModelObject& paintInvalidationContainer, const LayoutRect& paintInvalidationRe
ct) |
366 { | 366 { |
367 Scrollbar::invalidateRect(rect); | 367 for (auto& part : m_parts) |
368 | 368 part.value->invalidateDisplayItemClientsIncludingNonCompositingDescendan
ts(&paintInvalidationContainer, PaintInvalidationScroll, &paintInvalidationRect)
; |
369 // FIXME: invalidate only the changed part. | |
370 if (LayoutBox* owningLayoutObject = this->owningLayoutObject()) { | |
371 for (auto& part : m_parts) | |
372 owningLayoutObject->invalidateDisplayItemClientForNonCompositingDesc
endantsOf(*part.value); | |
373 } | |
374 } | 369 } |
375 | 370 |
376 } | 371 } |
OLD | NEW |