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

Unified Diff: Source/core/rendering/RenderLayer.cpp

Issue 14858004: Clean up the way layout tests force elements to opt in/out of composited scrolling. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 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
« no previous file with comments | « Source/core/rendering/RenderLayer.h ('k') | Source/core/testing/Internals.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderLayer.cpp
diff --git a/Source/core/rendering/RenderLayer.cpp b/Source/core/rendering/RenderLayer.cpp
index 17edf636a3a2c9e7116f6987e2195b220b1c5311..4be60e188bc922726168313bb1beea8690e78f78 100644
--- a/Source/core/rendering/RenderLayer.cpp
+++ b/Source/core/rendering/RenderLayer.cpp
@@ -166,6 +166,7 @@ RenderLayer::RenderLayer(RenderLayerModelObject* renderer)
, m_scrollCorner(0)
, m_resizer(0)
, m_enclosingPaginationLayer(0)
+ , m_forceNeedsCompositedScrolling(DoNotForceCompositedScrolling)
{
m_isNormalFlowOnly = shouldBeNormalFlowOnly();
m_isSelfPaintingLayer = shouldBeSelfPaintingLayer();
@@ -466,9 +467,8 @@ void RenderLayer::dirtyAncestorChainHasSelfPaintingLayerDescendantStatus()
bool RenderLayer::acceleratedCompositingForOverflowScrollEnabled() const
{
- return renderer()->frame()
- && renderer()->frame()->page()
- && renderer()->frame()->page()->settings()->acceleratedCompositingForOverflowScrollEnabled();
+ const Settings* settings = renderer()->document()->settings();
+ return settings && settings->acceleratedCompositingForOverflowScrollEnabled();
}
// If we are a stacking container, then this function will determine if our
@@ -2046,6 +2046,16 @@ bool RenderLayer::usesCompositedScrolling() const
bool RenderLayer::needsCompositedScrolling() const
{
+ switch (m_forceNeedsCompositedScrolling) {
+ case DoNotForceCompositedScrolling:
+ return m_needsCompositedScrolling;
+ case CompositedScrollingAlwaysOn:
+ return true;
+ case CompositedScrollingAlwaysOff:
+ return false;
+ }
+
+ ASSERT_NOT_REACHED();
return m_needsCompositedScrolling;
}
@@ -2079,6 +2089,24 @@ void RenderLayer::updateNeedsCompositedScrolling()
m_needsCompositedScrolling = needsCompositedScrolling;
+ // Note, the z-order lists may need to be rebuilt, but our code guarantees
+ // that we have not affected stacking, so we will not dirty
+ // m_canBePromotedToStackingContainer for either us or our stacking context
+ // or container.
+ didUpdateNeedsCompositedScrolling();
+}
+
+void RenderLayer::setForceNeedsCompositedScrolling(RenderLayer::ForceNeedsCompositedScrollingMode mode)
+{
+ if (m_forceNeedsCompositedScrolling == mode)
+ return;
+
+ m_forceNeedsCompositedScrolling = mode;
+ didUpdateNeedsCompositedScrolling();
+}
+
+void RenderLayer::didUpdateNeedsCompositedScrolling()
+{
updateIsNormalFlowOnly();
updateSelfPaintingLayer();
« no previous file with comments | « Source/core/rendering/RenderLayer.h ('k') | Source/core/testing/Internals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698