Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(560)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp

Issue 2308503002: Revert of Paint solid color backgrounds which are equivalent to locally attached into scrolling c... (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scrollcontent-paint-bg
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
index a757f5e362f632e2d3b2cd70e1061308f658b884..6c6ec933ce0598843aae45578a2128c3483ef273 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
@@ -33,7 +33,6 @@
#include "core/layout/LayoutFlexibleBox.h"
#include "core/layout/LayoutGeometryMap.h"
#include "core/layout/LayoutInline.h"
-#include "core/layout/LayoutTheme.h"
#include "core/layout/LayoutView.h"
#include "core/layout/compositing/CompositedLayerMapping.h"
#include "core/layout/compositing/PaintLayerCompositor.h"
@@ -114,64 +113,6 @@
bool LayoutBoxModelObject::usesCompositedScrolling() const
{
return hasOverflowClip() && hasLayer() && layer()->getScrollableArea()->usesCompositedScrolling();
-}
-
-bool LayoutBoxModelObject::hasLocalEquivalentBackground() const
-{
- int minBorderWidth = std::min(style()->borderTopWidth(),
- std::min(style()->borderLeftWidth(),
- std::min(style()->borderRightWidth(), style()->borderBottomWidth())));
- bool outlineOverlapsPaddingBox = style()->outlineOffset() < -minBorderWidth;
- bool hasCustomScrollbars = false;
- // TODO(flackr): Detect opaque custom scrollbars which would cover up a border-box
- // background.
- if (PaintLayerScrollableArea* scrollableArea = getScrollableArea()) {
- if ((scrollableArea->horizontalScrollbar() && scrollableArea->horizontalScrollbar()->isCustomScrollbar())
- || (scrollableArea->verticalScrollbar() && scrollableArea->verticalScrollbar()->isCustomScrollbar())) {
- hasCustomScrollbars = true;
- }
- }
-
- const FillLayer* layer = &(style()->backgroundLayers());
- for (; layer; layer = layer->next()) {
- if (layer->attachment() == LocalBackgroundAttachment)
- continue;
-
- // If the outline draws inside the border, it intends to draw on top of the scroller's background,
- // however because it is painted into a layer behind the scrolling contents layer we avoid auto
- // promoting in this case to avoid obscuring the outline.
- // TODO(flackr): Outlines should be drawn on top of the scrolling contents layer so that
- // they cannot be covered up by composited scrolling contents.
- if (outlineOverlapsPaddingBox)
- return false;
-
- // Solid color layers with an effective background clip of the padding box can be treated
- // as local.
- if (!layer->image() && !layer->next() && resolveColor(CSSPropertyBackgroundColor).alpha() > 0) {
- EFillBox clip = layer->clip();
- if (clip == PaddingFillBox)
- continue;
- // A border box can be treated as a padding box if the border is opaque or there is
- // no border and we don't have custom scrollbars.
- if (clip == BorderFillBox && !hasCustomScrollbars
- && (style()->borderTopWidth() == 0 || !resolveColor(CSSPropertyBorderTopColor).hasAlpha())
- && (style()->borderLeftWidth() == 0 || !resolveColor(CSSPropertyBorderLeftColor).hasAlpha())
- && (style()->borderRightWidth() == 0 || !resolveColor(CSSPropertyBorderRightColor).hasAlpha())
- && (style()->borderBottomWidth() == 0 || !resolveColor(CSSPropertyBorderBottomColor).hasAlpha())) {
- continue;
- }
- // A content fill box can be treated as a padding fill box if there is no padding.
- if (clip == ContentFillBox
- && style()->paddingTop().isZero()
- && style()->paddingLeft().isZero()
- && style()->paddingRight().isZero()
- && style()->paddingBottom().isZero()) {
- continue;
- }
- }
- return false;
- }
- return true;
}
LayoutBoxModelObject::~LayoutBoxModelObject()
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h ('k') | third_party/WebKit/Source/core/layout/LayoutTheme.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698