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

Side by Side Diff: third_party/WebKit/Source/core/frame/VisualViewport.cpp

Issue 1673393002: Return early from VisualViewport::initializeScrollbars if not attached yet. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 327
328 initializeScrollbars(); 328 initializeScrollbars();
329 } 329 }
330 330
331 m_innerViewportScrollLayer->removeAllChildren(); 331 m_innerViewportScrollLayer->removeAllChildren();
332 m_innerViewportScrollLayer->addChild(currentLayerTreeRoot); 332 m_innerViewportScrollLayer->addChild(currentLayerTreeRoot);
333 } 333 }
334 334
335 void VisualViewport::initializeScrollbars() 335 void VisualViewport::initializeScrollbars()
336 { 336 {
337 // Do nothing if not attached to layer tree yet - will initialize upon attac h.
338 if (!m_innerViewportContainerLayer)
339 return;
340
337 if (visualViewportSuppliesScrollbars()) { 341 if (visualViewportSuppliesScrollbars()) {
338 if (!m_overlayScrollbarHorizontal->parent()) 342 if (!m_overlayScrollbarHorizontal->parent())
339 m_innerViewportContainerLayer->addChild(m_overlayScrollbarHorizontal .get()); 343 m_innerViewportContainerLayer->addChild(m_overlayScrollbarHorizontal .get());
340 if (!m_overlayScrollbarVertical->parent()) 344 if (!m_overlayScrollbarVertical->parent())
341 m_innerViewportContainerLayer->addChild(m_overlayScrollbarVertical.g et()); 345 m_innerViewportContainerLayer->addChild(m_overlayScrollbarVertical.g et());
342 } else { 346 } else {
343 m_overlayScrollbarHorizontal->removeFromParent(); 347 m_overlayScrollbarHorizontal->removeFromParent();
344 m_overlayScrollbarVertical->removeFromParent(); 348 m_overlayScrollbarVertical->removeFromParent();
345 } 349 }
346 350
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 } else if (graphicsLayer == m_rootTransformLayer) { 744 } else if (graphicsLayer == m_rootTransformLayer) {
741 name = "Root Transform Layer"; 745 name = "Root Transform Layer";
742 } else { 746 } else {
743 ASSERT_NOT_REACHED(); 747 ASSERT_NOT_REACHED();
744 } 748 }
745 749
746 return name; 750 return name;
747 } 751 }
748 752
749 } // namespace blink 753 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698