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

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

Issue 2706673002: Mark elements as viewport constrained when they become sticky positioned (Closed)
Patch Set: Created 3 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 | third_party/WebKit/Source/core/layout/LayoutBoxModelObjectTest.cpp » ('j') | 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) 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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 oldStyle && oldStyle->position() == EPosition::kSticky; 392 oldStyle && oldStyle->position() == EPosition::kSticky;
393 393
394 if (newStyleIsSticky != oldStyleIsSticky) { 394 if (newStyleIsSticky != oldStyleIsSticky) {
395 if (newStyleIsSticky) { 395 if (newStyleIsSticky) {
396 // During compositing inputs update we'll have the scroll ancestor 396 // During compositing inputs update we'll have the scroll ancestor
397 // without having to walk up the tree and can compute the sticky 397 // without having to walk up the tree and can compute the sticky
398 // position constraints then. 398 // position constraints then.
399 if (layer()) 399 if (layer())
400 layer()->setNeedsCompositingInputsUpdate(); 400 layer()->setNeedsCompositingInputsUpdate();
401 401
402 frameView->addViewportConstrainedObject(this);
flackr 2017/02/21 00:38:14 There's a call to add sticky position items to the
smcgruer 2017/02/21 15:50:05 Done.
403
402 // TODO(pdr): When slimming paint v2 is enabled, we will need to 404 // TODO(pdr): When slimming paint v2 is enabled, we will need to
403 // invalidate the scroll paint property subtree for this so main thread 405 // invalidate the scroll paint property subtree for this so main thread
404 // scroll reasons are recomputed. 406 // scroll reasons are recomputed.
405 } else { 407 } else {
406 // This may get re-added to viewport constrained objects if the object 408 // This may get re-added to viewport constrained objects if the object
407 // went from sticky to fixed. 409 // went from sticky to fixed.
408 frameView->removeViewportConstrainedObject(this); 410 frameView->removeViewportConstrainedObject(this);
409 411
410 // Remove sticky constraints for this layer. 412 // Remove sticky constraints for this layer.
411 if (layer()) { 413 if (layer()) {
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after
1367 if (rootElementStyle->hasBackground()) 1369 if (rootElementStyle->hasBackground())
1368 return false; 1370 return false;
1369 1371
1370 if (node() != document().firstBodyElement()) 1372 if (node() != document().firstBodyElement())
1371 return false; 1373 return false;
1372 1374
1373 return true; 1375 return true;
1374 } 1376 }
1375 1377
1376 } // namespace blink 1378 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutBoxModelObjectTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698