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

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

Issue 2696093003: Always invalidate sticky constraints on the ancestor overflow layer (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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 if (newStyleIsViewportConstained != oldStyleIsViewportConstrained) { 417 if (newStyleIsViewportConstained != oldStyleIsViewportConstrained) {
418 if (newStyleIsViewportConstained && layer()) 418 if (newStyleIsViewportConstained && layer())
419 frameView->addViewportConstrainedObject(this); 419 frameView->addViewportConstrainedObject(this);
420 else 420 else
421 frameView->removeViewportConstrainedObject(this); 421 frameView->removeViewportConstrainedObject(this);
422 } 422 }
423 } 423 }
424 } 424 }
425 425
426 void LayoutBoxModelObject::invalidateStickyConstraints() { 426 void LayoutBoxModelObject::invalidateStickyConstraints() {
427 if (!layer()) 427 PaintLayer* enclosing = enclosingLayer();
428 return; 428
429 if (PaintLayerScrollableArea* scrollableArea =
430 enclosing->getScrollableArea()) {
431 scrollableArea->invalidateAllStickyConstraints();
432 // If this object doesn't have a layer and its enclosing layer is a scroller
433 // then we don't need to invalidate the sticky constraints on the ancestor
434 // scroller because the enclosing scroller won't have changed size.
435 if (!layer())
436 return;
437 }
429 438
430 // This intentionally uses the stale ancestor overflow layer compositing input 439 // This intentionally uses the stale ancestor overflow layer compositing input
431 // as if we have saved constraints for this layer they were saved in the 440 // as if we have saved constraints for this layer they were saved in the
432 // previous frame. 441 // previous frame.
433 DisableCompositingQueryAsserts disabler; 442 DisableCompositingQueryAsserts disabler;
434 if (const PaintLayer* ancestorOverflowLayer = 443 if (const PaintLayer* ancestorOverflowLayer =
435 layer()->ancestorOverflowLayer()) 444 enclosing->ancestorOverflowLayer())
436 ancestorOverflowLayer->getScrollableArea() 445 ancestorOverflowLayer->getScrollableArea()
437 ->invalidateAllStickyConstraints(); 446 ->invalidateAllStickyConstraints();
438 } 447 }
439 448
440 void LayoutBoxModelObject::createLayer() { 449 void LayoutBoxModelObject::createLayer() {
441 ASSERT(!m_layer); 450 ASSERT(!m_layer);
442 m_layer = WTF::makeUnique<PaintLayer>(this); 451 m_layer = WTF::makeUnique<PaintLayer>(this);
443 setHasLayer(true); 452 setHasLayer(true);
444 m_layer->insertOnlyThisLayerAfterStyleChange(); 453 m_layer->insertOnlyThisLayerAfterStyleChange();
445 } 454 }
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after
1347 if (rootElementStyle->hasBackground()) 1356 if (rootElementStyle->hasBackground())
1348 return false; 1357 return false;
1349 1358
1350 if (node() != document().firstBodyElement()) 1359 if (node() != document().firstBodyElement())
1351 return false; 1360 return false;
1352 1361
1353 return true; 1362 return true;
1354 } 1363 }
1355 1364
1356 } // namespace blink 1365 } // 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