| 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" |
| 44 #include "wtf/PtrUtil.h" | 45 #include "wtf/PtrUtil.h" |
| 45 | 46 |
| 46 namespace blink { | 47 namespace blink { |
| 47 | 48 |
| 48 class FloatStateForStyleChange { | 49 class FloatStateForStyleChange { |
| 49 public: | 50 public: |
| 50 static void setWasFloating(LayoutBoxModelObject* boxModelObject, | 51 static void setWasFloating(LayoutBoxModelObject* boxModelObject, |
| 51 bool wasFloating) { | 52 bool wasFloating) { |
| 52 s_wasFloating = wasFloating; | 53 s_wasFloating = wasFloating; |
| 53 s_boxModelObject = boxModelObject; | 54 s_boxModelObject = boxModelObject; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 } | 105 } |
| 105 | 106 |
| 106 LayoutBoxModelObject::LayoutBoxModelObject(ContainerNode* node) | 107 LayoutBoxModelObject::LayoutBoxModelObject(ContainerNode* node) |
| 107 : LayoutObject(node) {} | 108 : LayoutObject(node) {} |
| 108 | 109 |
| 109 bool LayoutBoxModelObject::usesCompositedScrolling() const { | 110 bool LayoutBoxModelObject::usesCompositedScrolling() const { |
| 110 return hasOverflowClip() && hasLayer() && | 111 return hasOverflowClip() && hasLayer() && |
| 111 layer()->getScrollableArea()->usesCompositedScrolling(); | 112 layer()->getScrollableArea()->usesCompositedScrolling(); |
| 112 } | 113 } |
| 113 | 114 |
| 114 BackgroundPaintLocation LayoutBoxModelObject::backgroundPaintLocation() const { | 115 BackgroundPaintLocation LayoutBoxModelObject::backgroundPaintLocation( |
| 116 uint32_t* reasons) const { |
| 115 bool hasCustomScrollbars = false; | 117 bool hasCustomScrollbars = false; |
| 116 // TODO(flackr): Detect opaque custom scrollbars which would cover up a | 118 // TODO(flackr): Detect opaque custom scrollbars which would cover up a |
| 117 // border-box background. | 119 // border-box background. |
| 118 if (PaintLayerScrollableArea* scrollableArea = getScrollableArea()) { | 120 if (PaintLayerScrollableArea* scrollableArea = getScrollableArea()) { |
| 119 if ((scrollableArea->horizontalScrollbar() && | 121 if ((scrollableArea->horizontalScrollbar() && |
| 120 scrollableArea->horizontalScrollbar()->isCustomScrollbar()) || | 122 scrollableArea->horizontalScrollbar()->isCustomScrollbar()) || |
| 121 (scrollableArea->verticalScrollbar() && | 123 (scrollableArea->verticalScrollbar() && |
| 122 scrollableArea->verticalScrollbar()->isCustomScrollbar())) { | 124 scrollableArea->verticalScrollbar()->isCustomScrollbar())) { |
| 123 hasCustomScrollbars = true; | 125 hasCustomScrollbars = true; |
| 124 } | 126 } |
| 125 } | 127 } |
| 126 | 128 |
| 127 // TODO(flackr): When we correctly clip the scrolling contents layer we can | 129 // TODO(flackr): When we correctly clip the scrolling contents layer we can |
| 128 // paint locally equivalent backgrounds into it. https://crbug.com/645957 | 130 // paint locally equivalent backgrounds into it. https://crbug.com/645957 |
| 129 if (!style()->hasAutoClip()) | 131 if (!style()->hasAutoClip()) |
| 130 return BackgroundPaintInGraphicsLayer; | 132 return BackgroundPaintInGraphicsLayer; |
| 131 | 133 |
| 132 // TODO(flackr): Remove this when box shadows are still painted correctly when | 134 // TODO(flackr): Remove this when box shadows are still painted correctly when |
| 133 // painting into the composited scrolling contents layer. | 135 // painting into the composited scrolling contents layer. |
| 134 // https://crbug.com/646464 | 136 // https://crbug.com/646464 |
| 135 if (style()->boxShadow()) | 137 if (style()->boxShadow()) { |
| 138 if (reasons) |
| 139 *reasons |= MainThreadScrollingReason::kHasBoxShadowFromNonRootLayer; |
| 136 return BackgroundPaintInGraphicsLayer; | 140 return BackgroundPaintInGraphicsLayer; |
| 141 } |
| 137 | 142 |
| 138 // Assume optimistically that the background can be painted in the scrolling | 143 // Assume optimistically that the background can be painted in the scrolling |
| 139 // contents until we find otherwise. | 144 // contents until we find otherwise. |
| 140 BackgroundPaintLocation paintLocation = BackgroundPaintInScrollingContents; | 145 BackgroundPaintLocation paintLocation = BackgroundPaintInScrollingContents; |
| 141 const FillLayer* layer = &(style()->backgroundLayers()); | 146 const FillLayer* layer = &(style()->backgroundLayers()); |
| 142 for (; layer; layer = layer->next()) { | 147 for (; layer; layer = layer->next()) { |
| 143 if (layer->attachment() == LocalBackgroundAttachment) | 148 if (layer->attachment() == LocalBackgroundAttachment) |
| 144 continue; | 149 continue; |
| 145 | 150 |
| 146 // Solid color layers with an effective background clip of the padding box | 151 // Solid color layers with an effective background clip of the padding box |
| (...skipping 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1362 if (rootElementStyle->hasBackground()) | 1367 if (rootElementStyle->hasBackground()) |
| 1363 return false; | 1368 return false; |
| 1364 | 1369 |
| 1365 if (node() != document().firstBodyElement()) | 1370 if (node() != document().firstBodyElement()) |
| 1366 return false; | 1371 return false; |
| 1367 | 1372 |
| 1368 return true; | 1373 return true; |
| 1369 } | 1374 } |
| 1370 | 1375 |
| 1371 } // namespace blink | 1376 } // namespace blink |
| OLD | NEW |