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

Unified Diff: Source/core/layout/LayoutView.cpp

Issue 1145993002: Refactor root element background painting (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase & revise expectation Created 5 years, 7 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: Source/core/layout/LayoutView.cpp
diff --git a/Source/core/layout/LayoutView.cpp b/Source/core/layout/LayoutView.cpp
index a8c768da00bac6053fd17a489776fd7988b7dab0..0254549eb6c5d5edac37db85b3814ef6aef2496f 100644
--- a/Source/core/layout/LayoutView.cpp
+++ b/Source/core/layout/LayoutView.cpp
@@ -204,16 +204,14 @@ bool LayoutView::shouldDoFullPaintInvalidationForNextLayout() const
return true;
if (size().height() != viewLogicalHeightForBoxSizing()) {
- if (LayoutObject* backgroundLayoutObject = this->backgroundLayoutObject()) {
- // When background-attachment is 'fixed', we treat the viewport (instead of the 'root'
- // i.e. html or body) as the background positioning area, and we should full paint invalidation
- // viewport resize if the background image is not composited and needs full paint invalidation on
- // background positioning area resize.
- if (!m_compositor || !m_compositor->needsFixedRootBackgroundLayer(layer())) {
- if (backgroundLayoutObject->style()->hasFixedBackgroundImage()
- && mustInvalidateFillLayersPaintOnHeightChange(backgroundLayoutObject->style()->backgroundLayers()))
- return true;
- }
+ // When background-attachment is 'fixed', we treat the viewport (instead of the 'root'
+ // i.e. html or body) as the background positioning area, and we should full paint invalidation
+ // viewport resize if the background image is not composited and needs full paint invalidation on
+ // background positioning area resize.
+ if (!m_compositor || !m_compositor->needsFixedRootBackgroundLayer(layer())) {
+ if (style()->hasFixedBackgroundImage()
+ && mustInvalidateFillLayersPaintOnHeightChange(style()->backgroundLayers()))
+ return true;
}
}
@@ -853,18 +851,7 @@ IntRect LayoutView::unscaledDocumentRect() const
bool LayoutView::rootBackgroundIsEntirelyFixed() const
{
- if (LayoutObject* backgroundLayoutObject = this->backgroundLayoutObject())
- return backgroundLayoutObject->style()->hasEntirelyFixedBackground();
- return false;
-}
-
-LayoutObject* LayoutView::backgroundLayoutObject() const
-{
- if (Element* documentElement = document().documentElement()) {
- if (LayoutObject* rootObject = documentElement->layoutObject())
- return rootObject->layoutObjectForRootBackground();
- }
- return 0;
+ return style()->hasEntirelyFixedBackground();
}
LayoutRect LayoutView::backgroundRect(LayoutBox* backgroundLayoutObject) const

Powered by Google App Engine
This is Rietveld 408576698