| 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 } | 275 } |
| 276 | 276 |
| 277 if (FrameView *frameView = view()->frameView()) { | 277 if (FrameView *frameView = view()->frameView()) { |
| 278 bool newStyleIsViewportConstained = style()->position() == FixedPosition
; | 278 bool newStyleIsViewportConstained = style()->position() == FixedPosition
; |
| 279 bool oldStyleIsViewportConstrained = oldStyle && oldStyle->position() ==
FixedPosition; | 279 bool oldStyleIsViewportConstrained = oldStyle && oldStyle->position() ==
FixedPosition; |
| 280 bool newStyleIsSticky = style()->position() == StickyPosition; | 280 bool newStyleIsSticky = style()->position() == StickyPosition; |
| 281 bool oldStyleIsSticky = oldStyle && oldStyle->position() == StickyPositi
on; | 281 bool oldStyleIsSticky = oldStyle && oldStyle->position() == StickyPositi
on; |
| 282 | 282 |
| 283 if (newStyleIsSticky != oldStyleIsSticky) { | 283 if (newStyleIsSticky != oldStyleIsSticky) { |
| 284 if (newStyleIsSticky) { | 284 if (newStyleIsSticky) { |
| 285 frameView->addStickyPositionObject(); | |
| 286 // During compositing inputs update we'll have the scroll | 285 // During compositing inputs update we'll have the scroll |
| 287 // ancestor without having to walk up the tree and can compute | 286 // ancestor without having to walk up the tree and can compute |
| 288 // the sticky position constraints then. | 287 // the sticky position constraints then. |
| 289 if (layer()) | 288 if (layer()) |
| 290 layer()->setNeedsCompositingInputsUpdate(); | 289 layer()->setNeedsCompositingInputsUpdate(); |
| 291 } else { | 290 } else { |
| 292 // This may get re-added to viewport constrained objects if the
object went | 291 // This may get re-added to viewport constrained objects if the
object went |
| 293 // from sticky to fixed. | 292 // from sticky to fixed. |
| 294 frameView->removeViewportConstrainedObject(this); | 293 frameView->removeViewportConstrainedObject(this); |
| 295 frameView->removeStickyPositionObject(); | |
| 296 | 294 |
| 297 // Remove sticky constraints for this layer. | 295 // Remove sticky constraints for this layer. |
| 298 if (layer()) { | 296 if (layer()) { |
| 299 DisableCompositingQueryAsserts disabler; | 297 DisableCompositingQueryAsserts disabler; |
| 300 if (const PaintLayer* ancestorOverflowLayer = layer()->ances
torOverflowLayer()) | 298 if (const PaintLayer* ancestorOverflowLayer = layer()->ances
torOverflowLayer()) |
| 301 ancestorOverflowLayer->getScrollableArea()->invalidateSt
ickyConstraintsFor(layer()); | 299 ancestorOverflowLayer->getScrollableArea()->invalidateSt
ickyConstraintsFor(layer()); |
| 302 } | 300 } |
| 303 } | 301 } |
| 304 } | 302 } |
| 305 | 303 |
| (...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1111 if (rootElementStyle->hasBackground()) | 1109 if (rootElementStyle->hasBackground()) |
| 1112 return false; | 1110 return false; |
| 1113 | 1111 |
| 1114 if (node() != document().firstBodyElement()) | 1112 if (node() != document().firstBodyElement()) |
| 1115 return false; | 1113 return false; |
| 1116 | 1114 |
| 1117 return true; | 1115 return true; |
| 1118 } | 1116 } |
| 1119 | 1117 |
| 1120 } // namespace blink | 1118 } // namespace blink |
| OLD | NEW |