| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/layout/compositing/CompositingReasonFinder.h" | 5 #include "core/layout/compositing/CompositingReasonFinder.h" |
| 6 | 6 |
| 7 #include "core/CSSPropertyNames.h" | 7 #include "core/CSSPropertyNames.h" |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 9 #include "core/frame/FrameView.h" | 9 #include "core/frame/FrameView.h" |
| 10 #include "core/frame/Settings.h" | 10 #include "core/frame/Settings.h" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 LayoutRect(layer->boundingBoxForCompositing())) || | 225 LayoutRect(layer->boundingBoxForCompositing())) || |
| 226 layer->compositesWithTransform() || layer->compositesWithOpacity())) { | 226 layer->compositesWithTransform() || layer->compositesWithOpacity())) { |
| 227 return false; | 227 return false; |
| 228 } | 228 } |
| 229 // Don't promote fixed position elements that are descendants of a non-view | 229 // Don't promote fixed position elements that are descendants of a non-view |
| 230 // container, e.g. transformed elements. They will stay fixed wrt the | 230 // container, e.g. transformed elements. They will stay fixed wrt the |
| 231 // container rather than the enclosing frame. | 231 // container rather than the enclosing frame. |
| 232 if (layer->sticksToViewport()) | 232 if (layer->sticksToViewport()) |
| 233 return m_layoutView.frameView()->isScrollable(); | 233 return m_layoutView.frameView()->isScrollable(); |
| 234 | 234 |
| 235 if (layer->layoutObject().style()->position() != EPosition::kSticky) | 235 return layer->layoutObject().style()->position() == EPosition::kSticky && |
| 236 return false; | 236 layer->ancestorOverflowLayer()->scrollsOverflow(); |
| 237 | |
| 238 // Don't promote nested sticky elements; the compositor can't handle them. | |
| 239 // TODO(smcgruer): Add cc nested sticky support (http://crbug.com/672710) | |
| 240 PaintLayerScrollableArea* scrollableArea = | |
| 241 layer->ancestorOverflowLayer()->getScrollableArea(); | |
| 242 DCHECK(scrollableArea->stickyConstraintsMap().contains( | |
| 243 const_cast<PaintLayer*>(layer))); | |
| 244 | |
| 245 return layer->ancestorOverflowLayer()->scrollsOverflow() && | |
| 246 !scrollableArea->stickyConstraintsMap() | |
| 247 .at(const_cast<PaintLayer*>(layer)) | |
| 248 .hasAncestorStickyElement(); | |
| 249 } | 237 } |
| 250 | 238 |
| 251 } // namespace blink | 239 } // namespace blink |
| OLD | NEW |