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