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

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

Issue 784453003: Initial scroll-blocks-on compositor integration (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Eliminate scrollbars from iframe test for cross-platform output consistency Created 5 years, 11 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/rendering/RenderBox.cpp
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp
index b4c3939d511b886855b77a039883d27d13d96512..b754afafc1e32a275d56dd9bde21cf3e70306770 100644
--- a/Source/core/rendering/RenderBox.cpp
+++ b/Source/core/rendering/RenderBox.cpp
@@ -104,6 +104,30 @@ RenderBox::RenderBox(ContainerNode* node)
setIsBox();
}
+LayerType RenderBox::layerTypeRequired() const
+{
+ // hasAutoZIndex only returns true if the element is positioned or a flex-item since
+ // position:static elements that are not flex-items get their z-index coerced to auto.
+ if (isPositioned() || createsGroup() || hasClipPath() || hasTransformRelatedProperty()
+ || hasHiddenBackface() || hasReflection() || style()->specifiesColumns()
+ || !style()->hasAutoZIndex() || style()->shouldCompositeForCurrentAnimations())
+ return NormalLayer;
+
+ // Ensure that explicit use of scroll-blocks-on creates a RenderLayer (since we might need
+ // it to be composited).
+ if (style()->hasScrollBlocksOn()) {
+ if (isDocumentElement()) {
+ ASSERT(style()->scrollBlocksOn() == view()->style()->scrollBlocksOn());
+ return NoLayer;
+ }
+ return NormalLayer;
+ }
+ if (hasOverflowClip())
+ return OverflowClipLayer;
+
+ return NoLayer;
+}
+
void RenderBox::willBeRemovedFromTree()
{
if (m_rareData && m_rareData->m_spannerPlaceholder) {

Powered by Google App Engine
This is Rietveld 408576698