| 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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 } | 346 } |
| 347 | 347 |
| 348 if (FrameView *frameView = view()->frameView()) { | 348 if (FrameView *frameView = view()->frameView()) { |
| 349 bool newStyleIsViewportConstained = style()->position() == FixedPosition
; | 349 bool newStyleIsViewportConstained = style()->position() == FixedPosition
; |
| 350 bool oldStyleIsViewportConstrained = oldStyle && oldStyle->position() ==
FixedPosition; | 350 bool oldStyleIsViewportConstrained = oldStyle && oldStyle->position() ==
FixedPosition; |
| 351 bool newStyleIsSticky = style()->position() == StickyPosition; | 351 bool newStyleIsSticky = style()->position() == StickyPosition; |
| 352 bool oldStyleIsSticky = oldStyle && oldStyle->position() == StickyPositi
on; | 352 bool oldStyleIsSticky = oldStyle && oldStyle->position() == StickyPositi
on; |
| 353 | 353 |
| 354 if (newStyleIsSticky != oldStyleIsSticky) { | 354 if (newStyleIsSticky != oldStyleIsSticky) { |
| 355 if (newStyleIsSticky) { | 355 if (newStyleIsSticky) { |
| 356 frameView->addStickyPositionObject(); | |
| 357 // During compositing inputs update we'll have the scroll | 356 // During compositing inputs update we'll have the scroll |
| 358 // ancestor without having to walk up the tree and can compute | 357 // ancestor without having to walk up the tree and can compute |
| 359 // the sticky position constraints then. | 358 // the sticky position constraints then. |
| 360 if (layer()) | 359 if (layer()) |
| 361 layer()->setNeedsCompositingInputsUpdate(); | 360 layer()->setNeedsCompositingInputsUpdate(); |
| 362 | 361 |
| 363 // TODO(pdr): When slimming paint v2 is enabled, we will need to | 362 // TODO(pdr): When slimming paint v2 is enabled, we will need to |
| 364 // invalidate the scroll paint property subtree for this so main | 363 // invalidate the scroll paint property subtree for this so main |
| 365 // thread scroll reasons are recomputed. | 364 // thread scroll reasons are recomputed. |
| 366 } else { | 365 } else { |
| 367 // 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 |
| 368 // from sticky to fixed. | 367 // from sticky to fixed. |
| 369 frameView->removeViewportConstrainedObject(this); | 368 frameView->removeViewportConstrainedObject(this); |
| 370 frameView->removeStickyPositionObject(); | |
| 371 | 369 |
| 372 // Remove sticky constraints for this layer. | 370 // Remove sticky constraints for this layer. |
| 373 if (layer()) { | 371 if (layer()) { |
| 374 DisableCompositingQueryAsserts disabler; | 372 DisableCompositingQueryAsserts disabler; |
| 375 if (const PaintLayer* ancestorOverflowLayer = layer()->ances
torOverflowLayer()) | 373 if (const PaintLayer* ancestorOverflowLayer = layer()->ances
torOverflowLayer()) |
| 376 ancestorOverflowLayer->getScrollableArea()->invalidateSt
ickyConstraintsFor(layer()); | 374 ancestorOverflowLayer->getScrollableArea()->invalidateSt
ickyConstraintsFor(layer()); |
| 377 } | 375 } |
| 378 | 376 |
| 379 // TODO(pdr): When slimming paint v2 is enabled, we will need to | 377 // TODO(pdr): When slimming paint v2 is enabled, we will need to |
| 380 // invalidate the scroll paint property subtree for this so main | 378 // invalidate the scroll paint property subtree for this so main |
| (...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1196 if (rootElementStyle->hasBackground()) | 1194 if (rootElementStyle->hasBackground()) |
| 1197 return false; | 1195 return false; |
| 1198 | 1196 |
| 1199 if (node() != document().firstBodyElement()) | 1197 if (node() != document().firstBodyElement()) |
| 1200 return false; | 1198 return false; |
| 1201 | 1199 |
| 1202 return true; | 1200 return true; |
| 1203 } | 1201 } |
| 1204 | 1202 |
| 1205 } // namespace blink | 1203 } // namespace blink |
| OLD | NEW |