Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutScrollbar.cpp

Issue 1511003003: Use refs for non-null GraphicsContext, Scrollbar, etc. in scrollbar related code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ScrollbarRemove
Patch Set: yet another mac fix Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 { 235 {
236 if (partType == NoPart) 236 if (partType == NoPart)
237 return; 237 return;
238 238
239 RefPtr<ComputedStyle> partStyle = !destroy ? getScrollbarPseudoStyle(partTyp e, pseudoForScrollbarPart(partType)) : PassRefPtr<ComputedStyle>(nullptr); 239 RefPtr<ComputedStyle> partStyle = !destroy ? getScrollbarPseudoStyle(partTyp e, pseudoForScrollbarPart(partType)) : PassRefPtr<ComputedStyle>(nullptr);
240 240
241 bool needLayoutObject = !destroy && partStyle && partStyle->display() != NON E; 241 bool needLayoutObject = !destroy && partStyle && partStyle->display() != NON E;
242 242
243 if (needLayoutObject && partStyle->display() != BLOCK) { 243 if (needLayoutObject && partStyle->display() != BLOCK) {
244 // See if we are a button that should not be visible according to OS set tings. 244 // See if we are a button that should not be visible according to OS set tings.
245 ScrollbarButtonsPlacement buttonsPlacement = theme()->buttonsPlacement() ; 245 ScrollbarButtonsPlacement buttonsPlacement = theme().buttonsPlacement();
246 switch (partType) { 246 switch (partType) {
247 case BackButtonStartPart: 247 case BackButtonStartPart:
248 needLayoutObject = (buttonsPlacement == ScrollbarButtonsPlacementSin gle || buttonsPlacement == ScrollbarButtonsPlacementDoubleStart 248 needLayoutObject = (buttonsPlacement == ScrollbarButtonsPlacementSin gle || buttonsPlacement == ScrollbarButtonsPlacementDoubleStart
249 || buttonsPlacement == ScrollbarButtonsPlacementDoubleBoth); 249 || buttonsPlacement == ScrollbarButtonsPlacementDoubleBoth);
250 break; 250 break;
251 case ForwardButtonStartPart: 251 case ForwardButtonStartPart:
252 needLayoutObject = (buttonsPlacement == ScrollbarButtonsPlacementDou bleStart || buttonsPlacement == ScrollbarButtonsPlacementDoubleBoth); 252 needLayoutObject = (buttonsPlacement == ScrollbarButtonsPlacementDou bleStart || buttonsPlacement == ScrollbarButtonsPlacementDoubleBoth);
253 break; 253 break;
254 case BackButtonEndPart: 254 case BackButtonEndPart:
255 needLayoutObject = (buttonsPlacement == ScrollbarButtonsPlacementDou bleEnd || buttonsPlacement == ScrollbarButtonsPlacementDoubleBoth); 255 needLayoutObject = (buttonsPlacement == ScrollbarButtonsPlacementDou bleEnd || buttonsPlacement == ScrollbarButtonsPlacementDoubleBoth);
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::invalidateDisplayItemClientsOfScrollbarParts(const LayoutB oxModelObject& paintInvalidationContainer, const LayoutRect& paintInvalidationRe ct) 365 void LayoutScrollbar::invalidateDisplayItemClientsOfScrollbarParts(const LayoutB oxModelObject& paintInvalidationContainer, const LayoutRect& paintInvalidationRe ct)
366 { 366 {
367 for (auto& part : m_parts) 367 for (auto& part : m_parts)
368 part.value->invalidateDisplayItemClientsIncludingNonCompositingDescendan ts(&paintInvalidationContainer, PaintInvalidationScroll, &paintInvalidationRect) ; 368 part.value->invalidateDisplayItemClientsIncludingNonCompositingDescendan ts(&paintInvalidationContainer, PaintInvalidationScroll, &paintInvalidationRect) ;
369 } 369 }
370 370
371 } 371 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698