| 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 23 matching lines...) Expand all Loading... |
| 34 #include "core/layout/LayoutGeometryMap.h" | 34 #include "core/layout/LayoutGeometryMap.h" |
| 35 #include "core/layout/LayoutInline.h" | 35 #include "core/layout/LayoutInline.h" |
| 36 #include "core/layout/LayoutView.h" | 36 #include "core/layout/LayoutView.h" |
| 37 #include "core/layout/compositing/CompositedLayerMapping.h" | 37 #include "core/layout/compositing/CompositedLayerMapping.h" |
| 38 #include "core/layout/compositing/PaintLayerCompositor.h" | 38 #include "core/layout/compositing/PaintLayerCompositor.h" |
| 39 #include "core/paint/ObjectPaintInvalidator.h" | 39 #include "core/paint/ObjectPaintInvalidator.h" |
| 40 #include "core/paint/PaintLayer.h" | 40 #include "core/paint/PaintLayer.h" |
| 41 #include "core/style/ShadowList.h" | 41 #include "core/style/ShadowList.h" |
| 42 #include "platform/LengthFunctions.h" | 42 #include "platform/LengthFunctions.h" |
| 43 #include "platform/geometry/TransformState.h" | 43 #include "platform/geometry/TransformState.h" |
| 44 #include "platform/scroll/MainThreadScrollingReason.h" | |
| 45 #include "wtf/PtrUtil.h" | 44 #include "wtf/PtrUtil.h" |
| 46 | 45 |
| 47 namespace blink { | 46 namespace blink { |
| 48 | 47 |
| 49 class FloatStateForStyleChange { | 48 class FloatStateForStyleChange { |
| 50 public: | 49 public: |
| 51 static void setWasFloating(LayoutBoxModelObject* boxModelObject, | 50 static void setWasFloating(LayoutBoxModelObject* boxModelObject, |
| 52 bool wasFloating) { | 51 bool wasFloating) { |
| 53 s_wasFloating = wasFloating; | 52 s_wasFloating = wasFloating; |
| 54 s_boxModelObject = boxModelObject; | 53 s_boxModelObject = boxModelObject; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 } | 104 } |
| 106 | 105 |
| 107 LayoutBoxModelObject::LayoutBoxModelObject(ContainerNode* node) | 106 LayoutBoxModelObject::LayoutBoxModelObject(ContainerNode* node) |
| 108 : LayoutObject(node) {} | 107 : LayoutObject(node) {} |
| 109 | 108 |
| 110 bool LayoutBoxModelObject::usesCompositedScrolling() const { | 109 bool LayoutBoxModelObject::usesCompositedScrolling() const { |
| 111 return hasOverflowClip() && hasLayer() && | 110 return hasOverflowClip() && hasLayer() && |
| 112 layer()->getScrollableArea()->usesCompositedScrolling(); | 111 layer()->getScrollableArea()->usesCompositedScrolling(); |
| 113 } | 112 } |
| 114 | 113 |
| 115 BackgroundPaintLocation LayoutBoxModelObject::backgroundPaintLocation( | 114 BackgroundPaintLocation LayoutBoxModelObject::backgroundPaintLocation() const { |
| 116 uint32_t* reasons) const { | |
| 117 bool hasCustomScrollbars = false; | 115 bool hasCustomScrollbars = false; |
| 118 // TODO(flackr): Detect opaque custom scrollbars which would cover up a | 116 // TODO(flackr): Detect opaque custom scrollbars which would cover up a |
| 119 // border-box background. | 117 // border-box background. |
| 120 if (PaintLayerScrollableArea* scrollableArea = getScrollableArea()) { | 118 if (PaintLayerScrollableArea* scrollableArea = getScrollableArea()) { |
| 121 if ((scrollableArea->horizontalScrollbar() && | 119 if ((scrollableArea->horizontalScrollbar() && |
| 122 scrollableArea->horizontalScrollbar()->isCustomScrollbar()) || | 120 scrollableArea->horizontalScrollbar()->isCustomScrollbar()) || |
| 123 (scrollableArea->verticalScrollbar() && | 121 (scrollableArea->verticalScrollbar() && |
| 124 scrollableArea->verticalScrollbar()->isCustomScrollbar())) { | 122 scrollableArea->verticalScrollbar()->isCustomScrollbar())) { |
| 125 hasCustomScrollbars = true; | 123 hasCustomScrollbars = true; |
| 126 } | 124 } |
| 127 } | 125 } |
| 128 | 126 |
| 129 // TODO(flackr): When we correctly clip the scrolling contents layer we can | 127 // TODO(flackr): When we correctly clip the scrolling contents layer we can |
| 130 // paint locally equivalent backgrounds into it. https://crbug.com/645957 | 128 // paint locally equivalent backgrounds into it. https://crbug.com/645957 |
| 131 if (!style()->hasAutoClip()) | 129 if (!style()->hasAutoClip()) |
| 132 return BackgroundPaintInGraphicsLayer; | 130 return BackgroundPaintInGraphicsLayer; |
| 133 | 131 |
| 134 // TODO(flackr): Remove this when box shadows are still painted correctly when | 132 // TODO(flackr): Remove this when box shadows are still painted correctly when |
| 135 // painting into the composited scrolling contents layer. | 133 // painting into the composited scrolling contents layer. |
| 136 // https://crbug.com/646464 | 134 // https://crbug.com/646464 |
| 137 if (style()->boxShadow()) { | 135 if (style()->boxShadow()) |
| 138 if (reasons) | |
| 139 *reasons |= MainThreadScrollingReason::kHasBoxShadowFromNonRootLayer; | |
| 140 return BackgroundPaintInGraphicsLayer; | 136 return BackgroundPaintInGraphicsLayer; |
| 141 } | |
| 142 | 137 |
| 143 // Assume optimistically that the background can be painted in the scrolling | 138 // Assume optimistically that the background can be painted in the scrolling |
| 144 // contents until we find otherwise. | 139 // contents until we find otherwise. |
| 145 BackgroundPaintLocation paintLocation = BackgroundPaintInScrollingContents; | 140 BackgroundPaintLocation paintLocation = BackgroundPaintInScrollingContents; |
| 146 const FillLayer* layer = &(style()->backgroundLayers()); | 141 const FillLayer* layer = &(style()->backgroundLayers()); |
| 147 for (; layer; layer = layer->next()) { | 142 for (; layer; layer = layer->next()) { |
| 148 if (layer->attachment() == LocalBackgroundAttachment) | 143 if (layer->attachment() == LocalBackgroundAttachment) |
| 149 continue; | 144 continue; |
| 150 | 145 |
| 151 // Solid color layers with an effective background clip of the padding box | 146 // Solid color layers with an effective background clip of the padding box |
| (...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1352 if (rootElementStyle->hasBackground()) | 1347 if (rootElementStyle->hasBackground()) |
| 1353 return false; | 1348 return false; |
| 1354 | 1349 |
| 1355 if (node() != document().firstBodyElement()) | 1350 if (node() != document().firstBodyElement()) |
| 1356 return false; | 1351 return false; |
| 1357 | 1352 |
| 1358 return true; | 1353 return true; |
| 1359 } | 1354 } |
| 1360 | 1355 |
| 1361 } // namespace blink | 1356 } // namespace blink |
| OLD | NEW |