OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 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 23 matching lines...) Expand all Loading... |
34 | 34 |
35 namespace blink { | 35 namespace blink { |
36 | 36 |
37 LayoutScrollbarPart::LayoutScrollbarPart(ScrollableArea* scrollableArea, | 37 LayoutScrollbarPart::LayoutScrollbarPart(ScrollableArea* scrollableArea, |
38 LayoutScrollbar* scrollbar, | 38 LayoutScrollbar* scrollbar, |
39 ScrollbarPart part) | 39 ScrollbarPart part) |
40 : LayoutBlock(nullptr), | 40 : LayoutBlock(nullptr), |
41 m_scrollableArea(scrollableArea), | 41 m_scrollableArea(scrollableArea), |
42 m_scrollbar(scrollbar), | 42 m_scrollbar(scrollbar), |
43 m_part(part) { | 43 m_part(part) { |
44 ASSERT(m_scrollableArea); | 44 DCHECK(m_scrollableArea); |
45 } | 45 } |
46 | 46 |
47 LayoutScrollbarPart::~LayoutScrollbarPart() { | 47 LayoutScrollbarPart::~LayoutScrollbarPart() { |
48 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS | 48 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS |
49 // We may not have invalidated the painting layer for now, but the | 49 // We may not have invalidated the painting layer for now, but the |
50 // scrollable area will invalidate during paint invalidation. | 50 // scrollable area will invalidate during paint invalidation. |
51 endShouldKeepAlive(); | 51 endShouldKeepAlive(); |
52 #endif | 52 #endif |
53 } | 53 } |
54 | 54 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 void LayoutScrollbarPart::styleWillChange(StyleDifference diff, | 200 void LayoutScrollbarPart::styleWillChange(StyleDifference diff, |
201 const ComputedStyle& newStyle) { | 201 const ComputedStyle& newStyle) { |
202 LayoutBlock::styleWillChange(diff, newStyle); | 202 LayoutBlock::styleWillChange(diff, newStyle); |
203 setInline(false); | 203 setInline(false); |
204 } | 204 } |
205 | 205 |
206 void LayoutScrollbarPart::styleDidChange(StyleDifference diff, | 206 void LayoutScrollbarPart::styleDidChange(StyleDifference diff, |
207 const ComputedStyle* oldStyle) { | 207 const ComputedStyle* oldStyle) { |
208 LayoutBlock::styleDidChange(diff, oldStyle); | 208 LayoutBlock::styleDidChange(diff, oldStyle); |
209 // See adjustStyleBeforeSet() above. | 209 // See adjustStyleBeforeSet() above. |
210 ASSERT(!isOrthogonalWritingModeRoot()); | 210 DCHECK(!isOrthogonalWritingModeRoot()); |
211 setInline(false); | 211 setInline(false); |
212 clearPositionedState(); | 212 clearPositionedState(); |
213 setFloating(false); | 213 setFloating(false); |
214 if (oldStyle && (diff.needsFullPaintInvalidation() || diff.needsLayout())) | 214 if (oldStyle && (diff.needsFullPaintInvalidation() || diff.needsLayout())) |
215 setNeedsPaintInvalidation(); | 215 setNeedsPaintInvalidation(); |
216 } | 216 } |
217 | 217 |
218 void LayoutScrollbarPart::imageChanged(WrappedImagePtr image, | 218 void LayoutScrollbarPart::imageChanged(WrappedImagePtr image, |
219 const IntRect* rect) { | 219 const IntRect* rect) { |
220 setNeedsPaintInvalidation(); | 220 setNeedsPaintInvalidation(); |
221 LayoutBlock::imageChanged(image, rect); | 221 LayoutBlock::imageChanged(image, rect); |
222 } | 222 } |
223 | 223 |
224 LayoutObject* LayoutScrollbarPart::scrollbarStyleSource() const { | 224 LayoutObject* LayoutScrollbarPart::scrollbarStyleSource() const { |
225 return (!m_scrollbar) ? nullptr : m_scrollbar->styleSource(); | 225 return (!m_scrollbar) ? nullptr : m_scrollbar->styleSource(); |
226 } | 226 } |
227 | 227 |
228 void LayoutScrollbarPart::setNeedsPaintInvalidation() { | 228 void LayoutScrollbarPart::setNeedsPaintInvalidation() { |
229 if (m_scrollbar) { | 229 if (m_scrollbar) { |
230 m_scrollbar->setNeedsPaintInvalidation(AllParts); | 230 m_scrollbar->setNeedsPaintInvalidation(AllParts); |
231 return; | 231 return; |
232 } | 232 } |
233 | 233 |
234 // This LayoutScrollbarPart is a scroll corner or a resizer. | 234 // This LayoutScrollbarPart is a scroll corner or a resizer. |
235 ASSERT(m_part == NoPart); | 235 DCHECK_EQ(m_part, NoPart); |
236 if (FrameView* frameView = view()->frameView()) { | 236 if (FrameView* frameView = view()->frameView()) { |
237 if (frameView->isFrameViewScrollCorner(this)) { | 237 if (frameView->isFrameViewScrollCorner(this)) { |
238 frameView->setScrollCornerNeedsPaintInvalidation(); | 238 frameView->setScrollCornerNeedsPaintInvalidation(); |
239 return; | 239 return; |
240 } | 240 } |
241 } | 241 } |
242 | 242 |
243 m_scrollableArea->setScrollCornerNeedsPaintInvalidation(); | 243 m_scrollableArea->setScrollCornerNeedsPaintInvalidation(); |
244 } | 244 } |
245 | 245 |
246 } // namespace blink | 246 } // namespace blink |
OLD | NEW |