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

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

Issue 2353843002: Add position sticky main thread scrolling reason [spv2] (Closed)
Patch Set: Created 4 years, 3 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2010 Google Inc. All rights reserved. 7 * Copyright (C) 2010 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 bool oldStyleIsSticky = oldStyle && oldStyle->position() == StickyPositi on; 351 bool oldStyleIsSticky = oldStyle && oldStyle->position() == StickyPositi on;
352 352
353 if (newStyleIsSticky != oldStyleIsSticky) { 353 if (newStyleIsSticky != oldStyleIsSticky) {
354 if (newStyleIsSticky) { 354 if (newStyleIsSticky) {
355 frameView->addStickyPositionObject(); 355 frameView->addStickyPositionObject();
356 // During compositing inputs update we'll have the scroll 356 // During compositing inputs update we'll have the scroll
357 // ancestor without having to walk up the tree and can compute 357 // ancestor without having to walk up the tree and can compute
358 // the sticky position constraints then. 358 // the sticky position constraints then.
359 if (layer()) 359 if (layer())
360 layer()->setNeedsCompositingInputsUpdate(); 360 layer()->setNeedsCompositingInputsUpdate();
361
362 // TODO(pdr): When slimming paint v2 is enabled, we will need to
363 // invalidate the scroll paint property subtree for this so main
364 // thread scroll reasons are recomputed.
361 } else { 365 } else {
362 // This may get re-added to viewport constrained objects if the object went 366 // This may get re-added to viewport constrained objects if the object went
363 // from sticky to fixed. 367 // from sticky to fixed.
364 frameView->removeViewportConstrainedObject(this); 368 frameView->removeViewportConstrainedObject(this);
365 frameView->removeStickyPositionObject(); 369 frameView->removeStickyPositionObject();
366 370
367 // Remove sticky constraints for this layer. 371 // Remove sticky constraints for this layer.
368 if (layer()) { 372 if (layer()) {
369 DisableCompositingQueryAsserts disabler; 373 DisableCompositingQueryAsserts disabler;
370 if (const PaintLayer* ancestorOverflowLayer = layer()->ances torOverflowLayer()) 374 if (const PaintLayer* ancestorOverflowLayer = layer()->ances torOverflowLayer())
371 ancestorOverflowLayer->getScrollableArea()->invalidateSt ickyConstraintsFor(layer()); 375 ancestorOverflowLayer->getScrollableArea()->invalidateSt ickyConstraintsFor(layer());
chrishtr 2016/09/20 19:45:57 There is a call site in PaintLayer also.
pdr. 2016/09/20 20:16:57 Added a comment there.
372 } 376 }
377
378 // TODO(pdr): When slimming paint v2 is enabled, we will need to
379 // invalidate the scroll paint property subtree for this so main
380 // thread scroll reasons are recomputed.
373 } 381 }
374 } 382 }
375 383
376 if (newStyleIsViewportConstained != oldStyleIsViewportConstrained) { 384 if (newStyleIsViewportConstained != oldStyleIsViewportConstrained) {
377 if (newStyleIsViewportConstained && layer()) 385 if (newStyleIsViewportConstained && layer())
378 frameView->addViewportConstrainedObject(this); 386 frameView->addViewportConstrainedObject(this);
379 else 387 else
380 frameView->removeViewportConstrainedObject(this); 388 frameView->removeViewportConstrainedObject(this);
381 } 389 }
382 } 390 }
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
1183 if (rootElementStyle->hasBackground()) 1191 if (rootElementStyle->hasBackground())
1184 return false; 1192 return false;
1185 1193
1186 if (node() != document().firstBodyElement()) 1194 if (node() != document().firstBodyElement())
1187 return false; 1195 return false;
1188 1196
1189 return true; 1197 return true;
1190 } 1198 }
1191 1199
1192 } // namespace blink 1200 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698