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

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

Issue 1830333002: Correct visual rects for scroll corner/resizer and non-frame composited scroll bars. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't create a LayoutScrollbartPart if we've no scrollable area. Created 4 years, 8 months 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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 case ForwardButtonEndPart: 254 case ForwardButtonEndPart:
255 needLayoutObject = (buttonsPlacement == WebScrollbarButtonsPlacement Single || buttonsPlacement == WebScrollbarButtonsPlacementDoubleEnd 255 needLayoutObject = (buttonsPlacement == WebScrollbarButtonsPlacement Single || buttonsPlacement == WebScrollbarButtonsPlacementDoubleEnd
256 || buttonsPlacement == WebScrollbarButtonsPlacementDoubleBoth); 256 || buttonsPlacement == WebScrollbarButtonsPlacementDoubleBoth);
257 break; 257 break;
258 default: 258 default:
259 break; 259 break;
260 } 260 }
261 } 261 }
262 262
263 LayoutScrollbarPart* partLayoutObject = m_parts.get(partType); 263 LayoutScrollbarPart* partLayoutObject = m_parts.get(partType);
264 if (!partLayoutObject && needLayoutObject) { 264 if (!partLayoutObject && needLayoutObject && m_scrollableArea) {
wkorman 2016/04/05 19:04:19 Also added this check, which fixes otherwise-crash
265 partLayoutObject = LayoutScrollbarPart::createAnonymous(&owningLayoutObj ect()->document(), this, partType); 265 partLayoutObject = LayoutScrollbarPart::createAnonymous(&owningLayoutObj ect()->document(), m_scrollableArea, this, partType);
266 m_parts.set(partType, partLayoutObject); 266 m_parts.set(partType, partLayoutObject);
267 } else if (partLayoutObject && !needLayoutObject) { 267 } else if (partLayoutObject && !needLayoutObject) {
268 m_parts.remove(partType); 268 m_parts.remove(partType);
269 partLayoutObject->destroy(); 269 partLayoutObject->destroy();
270 partLayoutObject = 0; 270 partLayoutObject = 0;
271 } 271 }
272 272
273 if (partLayoutObject) 273 if (partLayoutObject)
274 partLayoutObject->setStyleWithWritingModeOfParent(partStyle.release()); 274 partLayoutObject->setStyleWithWritingModeOfParent(partStyle.release());
275 } 275 }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 return orientation() == HorizontalScrollbar ? partLayoutObject->size().width () : partLayoutObject->size().height(); 359 return orientation() == HorizontalScrollbar ? partLayoutObject->size().width () : partLayoutObject->size().height();
360 } 360 }
361 361
362 void LayoutScrollbar::invalidateDisplayItemClientsOfScrollbarParts(const LayoutB oxModelObject& paintInvalidationContainer) 362 void LayoutScrollbar::invalidateDisplayItemClientsOfScrollbarParts(const LayoutB oxModelObject& paintInvalidationContainer)
363 { 363 {
364 for (auto& part : m_parts) 364 for (auto& part : m_parts)
365 part.value->invalidateDisplayItemClientsIncludingNonCompositingDescendan ts(&paintInvalidationContainer, PaintInvalidationScroll); 365 part.value->invalidateDisplayItemClientsIncludingNonCompositingDescendan ts(&paintInvalidationContainer, PaintInvalidationScroll);
366 } 366 }
367 367
368 } // namespace blink 368 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698