Title: [106191] trunk
Revision
106191
Author
[email protected]
Date
2012-01-28 11:28:44 -0800 (Sat, 28 Jan 2012)

Log Message

REGRESSION (r94016): Element with visibility:hidden but visible descendant may not be properly repainted
https://bugs.webkit.org/show_bug.cgi?id=76126

Reviewed by Simon Fraser.

Source/WebCore:

Tests: fast/layers/scroll-no-visible-content-but-visible-descendant-expected.html
       fast/layers/scroll-no-visible-content-but-visible-descendant.html

The optimization missed out that if the current layer does not have some visible content
(m_hasVisibleContent is false), a descendant could totally be visible and would need to
have its repaint rectangles recomputed.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPositionsAfterScroll):
Bail out only if the layer doesn't have visible content AND no visible descendants.

LayoutTests:

Added testing for a layer with no visible content but one of its descendant has some visible content.
The reverse case is already profusely tested.

* fast/layers/scroll-no-visible-content-but-visible-descendant-expected.html: Added.
* fast/layers/scroll-no-visible-content-but-visible-descendant.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (106190 => 106191)


--- trunk/LayoutTests/ChangeLog	2012-01-28 19:02:34 UTC (rev 106190)
+++ trunk/LayoutTests/ChangeLog	2012-01-28 19:28:44 UTC (rev 106191)
@@ -1,3 +1,16 @@
+2012-01-28  Julien Chaffraix  <[email protected]>
+
+        REGRESSION (r94016): Element with visibility:hidden but visible descendant may not be properly repainted
+        https://bugs.webkit.org/show_bug.cgi?id=76126
+
+        Reviewed by Simon Fraser.
+
+        Added testing for a layer with no visible content but one of its descendant has some visible content.
+        The reverse case is already profusely tested.
+
+        * fast/layers/scroll-no-visible-content-but-visible-descendant-expected.html: Added.
+        * fast/layers/scroll-no-visible-content-but-visible-descendant.html: Added.
+
 2012-01-28 Hajime Morita  <[email protected]>
 
         Unreviewed, another attempt for warning elimination.

Added: trunk/LayoutTests/fast/layers/scroll-no-visible-content-but-visible-descendant-expected.html (0 => 106191)


--- trunk/LayoutTests/fast/layers/scroll-no-visible-content-but-visible-descendant-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/layers/scroll-no-visible-content-but-visible-descendant-expected.html	2012-01-28 19:28:44 UTC (rev 106191)
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+div {
+    height: 100px;
+    width: 100px;
+}
+</style>
+</head>
+<body>
+<div style="background-color: green"></div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/layers/scroll-no-visible-content-but-visible-descendant.html (0 => 106191)


--- trunk/LayoutTests/fast/layers/scroll-no-visible-content-but-visible-descendant.html	                        (rev 0)
+++ trunk/LayoutTests/fast/layers/scroll-no-visible-content-but-visible-descendant.html	2012-01-28 19:28:44 UTC (rev 106191)
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+div {
+    height: 100px;
+    width: 100px;
+}
+
+#outerDiv {
+    visibility: hidden;
+    overflow: hidden;
+}
+
+.paddingBlockNoVisibleDescendantOrContent {
+    position: relative;
+    background: red;
+    visibility: visible;
+}
+
+.noVisibleContentVisibleWrapper {
+    position: relative;
+    visibility: visible;
+}
+
+.greenContainer {
+    background: green;
+}
+</style>
+<script>
+    function scroll()
+    {
+        var outerDiv = document.getElementById("outerDiv");
+        outerDiv.scrollTop = "100";
+    }
+    window.addEventListener("load", scroll, false);
+</script>
+</head>
+<body>
+<!--
+    Bug 76126: REGRESSION (r94016): Visibility hidden to visible override with outer fixed inner relative elements
+    This test has PASSED if there is only a green square and no red!
+-->
+<div class="hidden noOverflow" id="outerDiv">
+    <div class="paddingBlockNoVisibleDescendantOrContent"></div>
+    <div class="noVisibleContentVisibleWrapper">
+        <div class="greenContainer"></div>
+    </div>
+</div>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (106190 => 106191)


--- trunk/Source/WebCore/ChangeLog	2012-01-28 19:02:34 UTC (rev 106190)
+++ trunk/Source/WebCore/ChangeLog	2012-01-28 19:28:44 UTC (rev 106191)
@@ -1,3 +1,21 @@
+2012-01-28  Julien Chaffraix  <[email protected]>
+
+        REGRESSION (r94016): Element with visibility:hidden but visible descendant may not be properly repainted
+        https://bugs.webkit.org/show_bug.cgi?id=76126
+
+        Reviewed by Simon Fraser.
+
+        Tests: fast/layers/scroll-no-visible-content-but-visible-descendant-expected.html
+               fast/layers/scroll-no-visible-content-but-visible-descendant.html
+
+        The optimization missed out that if the current layer does not have some visible content
+        (m_hasVisibleContent is false), a descendant could totally be visible and would need to
+        have its repaint rectangles recomputed.
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::updateLayerPositionsAfterScroll):
+        Bail out only if the layer doesn't have visible content AND no visible descendants.
+
 2012-01-27  Chris Marrin  <[email protected]>
 
         Get rid of TransformOperationList

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (106190 => 106191)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2012-01-28 19:02:34 UTC (rev 106190)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2012-01-28 19:28:44 UTC (rev 106191)
@@ -451,12 +451,13 @@
 
 void RenderLayer::updateLayerPositionsAfterScroll(UpdateLayerPositionsAfterScrollFlags flags)
 {
+    ASSERT(!m_visibleDescendantStatusDirty);
     ASSERT(!m_visibleContentStatusDirty);
 
-    // If we have no visible content, there is no point recomputing our rectangles as
-    // they will be empty. If our visibility changes, we are expected to recompute all
-    // our positions anyway.
-    if (!m_hasVisibleContent)
+    // If we have no visible content and no visible descendants, there is no point recomputing
+    // our rectangles as they will be empty. If our visibility changes, we are expected to
+    // recompute all our positions anyway.
+    if (!m_hasVisibleDescendant && !m_hasVisibleContent)
         return;
 
     updateLayerPosition();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to