Commit 50666458 authored by wangxianzhu@chromium.org's avatar wangxianzhu@chromium.org
Browse files

Non-paintsContent fixed position layer should not cause slow scrolling

https://bugs.webkit.org/show_bug.cgi?id=113238

Reviewed by James Robinson.

Source/WebCore:

Added NotCompositedForNoVisibleContent in ViewportConstrainedNotCompositedReason and set it in RLC.

Test: compositing/layer-creation/fixed-position-no-content-scroll-reason.html

* rendering/RenderLayer.h: Add NotCompositedForNoVisibleContent.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForPosition): Set NotCompositedForNoVisibleContent reason when the fixed position layer has no visible content.

LayoutTests:

* compositing/layer-creation/fixed-position-no-content-scroll-reason-expected.txt: Added.
* compositing/layer-creation/fixed-position-no-content-scroll-reason.html: Copied from LayoutTests/compositing/layer-creation/fixed-position-out-of-view-scroll-reason.html. Test case for the bug.
* compositing/layer-creation/fixed-position-in-view-dynamic.html: Set background of fixed layer to distinguish out-of-view case from no-content case.
* compositing/layer-creation/fixed-position-out-of-view-dynamic.html: Ditto.
* compositing/layer-creation/fixed-position-out-of-view-scroll-reason.html: Ditto.
* platform/chromium/compositing/layer-creation/fixed-position-in-view-dynamic-expected.txt: Removed. This was a wrong rebaseline related to this bug.
* platform/chromium/platform/chromium/virtual/softwarecompositing/layer-creation/fixed-position-in-view-dynamic-expected.txt: Removed. This was a wrong rebaseline related to this bug.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146940 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 0b992bb7
2013-03-26 Xianzhu Wang <wangxianzhu@chromium.org>
Non-paintsContent fixed position layer should not cause slow scrolling
https://bugs.webkit.org/show_bug.cgi?id=113238
Reviewed by James Robinson.
* compositing/layer-creation/fixed-position-no-content-scroll-reason-expected.txt: Added.
* compositing/layer-creation/fixed-position-no-content-scroll-reason.html: Copied from LayoutTests/compositing/layer-creation/fixed-position-out-of-view-scroll-reason.html. Test case for the bug.
* compositing/layer-creation/fixed-position-in-view-dynamic.html: Set background of fixed layer to distinguish out-of-view case from no-content case.
* compositing/layer-creation/fixed-position-out-of-view-dynamic.html: Ditto.
* compositing/layer-creation/fixed-position-out-of-view-scroll-reason.html: Ditto.
* platform/chromium/compositing/layer-creation/fixed-position-in-view-dynamic-expected.txt: Removed. This was a wrong rebaseline related to this bug.
* platform/chromium/platform/chromium/virtual/softwarecompositing/layer-creation/fixed-position-in-view-dynamic-expected.txt: Removed. This was a wrong rebaseline related to this bug.
2013-03-26 Alok Priyadarshi <alokp@chromium.org>
 
Unreviewed gardening.
......@@ -8,6 +8,7 @@
width: 10px;
height: 10px;
top: 100px;
background-color: silver;
}
</style>
......
<!DOCTYPE html>
<html>
<head>
<style>
.fixed {
position: fixed;
width: 50px;
height: 50px;
top: 10px;
left: 10px;
z-index: -1;
}
</style>
<script type="text/javascript">
if (window.internals)
window.internals.settings.setAcceleratedCompositingForFixedPositionEnabled(true);
if (window.testRunner) {
testRunner.dumpAsText();
window.addEventListener("load", function() {
document.getElementById("mainThreadScrollingReasons").innerText = window.internals.mainThreadScrollingReasons(document);
}, false);
}
</script>
</head>
<body>
<div style="height: 1000px">
Main thread scrolling reasons should be blank:
<pre id="mainThreadScrollingReasons"></pre>
</div>
<div class="fixed"></div>
</body>
</html>
......@@ -8,6 +8,7 @@
width: 10px;
height: 10px;
top: -100px;
background-color: silver;
}
</style>
......
......@@ -8,6 +8,7 @@
width: 10px;
height: 10px;
z-index: -1;
background-color: silver;
}
</style>
......
2013-03-26 Xianzhu Wang <wangxianzhu@chromium.org>
Non-paintsContent fixed position layer should not cause slow scrolling
https://bugs.webkit.org/show_bug.cgi?id=113238
Reviewed by James Robinson.
Added NotCompositedForNoVisibleContent in ViewportConstrainedNotCompositedReason and set it in RLC.
Test: compositing/layer-creation/fixed-position-no-content-scroll-reason.html
* rendering/RenderLayer.h: Add NotCompositedForNoVisibleContent.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForPosition): Set NotCompositedForNoVisibleContent reason when the fixed position layer has no visible content.
2013-03-26 Zoltan Horvath <zoltan@webkit.org>
 
[CSS Exclusions] The radius of a circle should be computed based on the shorter available dimension
......@@ -838,6 +838,7 @@ public:
NoNotCompositedReason,
NotCompositedForBoundsOutOfView,
NotCompositedForNonViewContainer,
NotCompositedForNoVisibleContent,
};
void setViewportConstrainedNotCompositedReason(ViewportConstrainedNotCompositedReason reason) { m_viewportConstrainedNotCompositedReason = reason; }
......
......@@ -2207,8 +2207,11 @@ bool RenderLayerCompositor::requiresCompositingForPosition(RenderObject* rendere
}
bool paintsContent = layer->isVisuallyNonEmpty() || layer->hasVisibleDescendant();
if (!paintsContent)
if (!paintsContent) {
if (viewportConstrainedNotCompositedReason)
*viewportConstrainedNotCompositedReason = RenderLayer::NotCompositedForNoVisibleContent;
return false;
}
return true;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment