| 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 22 matching lines...) Expand all Loading... |
| 33 } | 33 } |
| 34 } | 34 } |
| 35 | 35 |
| 36 bool CompositingReasonFinder::hasOverflowScrollTrigger() const | 36 bool CompositingReasonFinder::hasOverflowScrollTrigger() const |
| 37 { | 37 { |
| 38 return m_compositingTriggers & OverflowScrollTrigger; | 38 return m_compositingTriggers & OverflowScrollTrigger; |
| 39 } | 39 } |
| 40 | 40 |
| 41 bool CompositingReasonFinder::isMainFrame() const | 41 bool CompositingReasonFinder::isMainFrame() const |
| 42 { | 42 { |
| 43 // FIXME: LocalFrame::isMainFrame() is probably better. | 43 return m_layoutView.document().isInMainFrame(); |
| 44 return !m_layoutView.document().ownerElement(); | |
| 45 } | 44 } |
| 46 | 45 |
| 47 CompositingReasons CompositingReasonFinder::directReasons(const PaintLayer* laye
r) const | 46 CompositingReasons CompositingReasonFinder::directReasons(const PaintLayer* laye
r) const |
| 48 { | 47 { |
| 49 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) | 48 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
| 50 return CompositingReasonNone; | 49 return CompositingReasonNone; |
| 51 | 50 |
| 52 ASSERT(potentialCompositingReasonsFromStyle(layer->layoutObject()) == layer-
>potentialCompositingReasonsFromStyle()); | 51 ASSERT(potentialCompositingReasonsFromStyle(layer->layoutObject()) == layer-
>potentialCompositingReasonsFromStyle()); |
| 53 CompositingReasons styleDeterminedDirectCompositingReasons = layer->potentia
lCompositingReasonsFromStyle() & CompositingReasonComboAllDirectStyleDeterminedR
easons; | 52 CompositingReasons styleDeterminedDirectCompositingReasons = layer->potentia
lCompositingReasonsFromStyle() & CompositingReasonComboAllDirectStyleDeterminedR
easons; |
| 54 | 53 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 bool CompositingReasonFinder::requiresCompositingForPositionFixed(const PaintLay
er* layer) const | 178 bool CompositingReasonFinder::requiresCompositingForPositionFixed(const PaintLay
er* layer) const |
| 180 { | 179 { |
| 181 if (!(m_compositingTriggers & ViewportConstrainedPositionedTrigger)) | 180 if (!(m_compositingTriggers & ViewportConstrainedPositionedTrigger)) |
| 182 return false; | 181 return false; |
| 183 // Don't promote fixed position elements that are descendants of a non-view
container, e.g. transformed elements. | 182 // Don't promote fixed position elements that are descendants of a non-view
container, e.g. transformed elements. |
| 184 // They will stay fixed wrt the container rather than the enclosing frame. | 183 // They will stay fixed wrt the container rather than the enclosing frame. |
| 185 return layer->scrollsWithViewport() && m_layoutView.frameView()->isScrollabl
e(); | 184 return layer->scrollsWithViewport() && m_layoutView.frameView()->isScrollabl
e(); |
| 186 } | 185 } |
| 187 | 186 |
| 188 } // namespace blink | 187 } // namespace blink |
| OLD | NEW |