[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

mitz at apple.com mitz at apple.com
Wed Dec 22 14:52:48 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit baef73376490bee8099ba45e0a2816d7a01bbd63
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 22 22:31:36 2010 +0000

    Layout not updating in a subtree when a scrollbar is hidden in a flexbox descendant
    https://bugs.webkit.org/show_bug.cgi?id=48154
    
    Reviewed by Anders Carlsson.
    
    WebCore:
    
    Test: scrollbars/hidden-scrollbar-prevents-layout.html
    
    updateScrollInfoAfterLayout() calling setHasHorizontalScrollbar() caused updateScrollbarParts()
    to call setChildNeedsLayout() on the overflow, because the RenderScrollbar was created with
    the default thickness instead of the thickness specified in style. This led to the the overflow’s
    parent to be re-marked for layout during its own parent’s finishDelayUpdateScrollInfo(), and
    the result was that at the end of RenderView::layout(), there was a dirty renderer.
    
    * rendering/RenderScrollbar.cpp:
    (WebCore::RenderScrollbar::RenderScrollbar): Set the frame size in the 'display: none' and
    'visibility: hidden' cases as well.
    
    LayoutTests:
    
    * scrollbars/hidden-scrollbar-prevents-layout-expected.txt: Added.
    * scrollbars/hidden-scrollbar-prevents-layout.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70354 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index d5602d6..b5300aa 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-10-22  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        Layout not updating in a subtree when a scrollbar is hidden in a flexbox descendant
+        https://bugs.webkit.org/show_bug.cgi?id=48154
+
+        * scrollbars/hidden-scrollbar-prevents-layout-expected.txt: Added.
+        * scrollbars/hidden-scrollbar-prevents-layout.html: Added.
+
 2010-10-22  Ojan Vafai  <ojan at chromium.org>
 
         fast/parser/block-nesting-cap.html is regularly on the cusp
diff --git a/LayoutTests/scrollbars/hidden-scrollbar-prevents-layout-expected.txt b/LayoutTests/scrollbars/hidden-scrollbar-prevents-layout-expected.txt
new file mode 100644
index 0000000..4dd074f
--- /dev/null
+++ b/LayoutTests/scrollbars/hidden-scrollbar-prevents-layout-expected.txt
@@ -0,0 +1,7 @@
+Test for https://bugs.webkit.org/show_bug.cgi?id=48154 <rdar://problem/8251616> Layout not updating in a subtree when a scrollbar is hidden in a flexbox descendant.
+
+There should be no red on this page.
+
+PASS
+
+
diff --git a/LayoutTests/scrollbars/hidden-scrollbar-prevents-layout.html b/LayoutTests/scrollbars/hidden-scrollbar-prevents-layout.html
new file mode 100644
index 0000000..de2d5ac
--- /dev/null
+++ b/LayoutTests/scrollbars/hidden-scrollbar-prevents-layout.html
@@ -0,0 +1,39 @@
+<head>
+    <style>
+        #overflow::-webkit-scrollbar {
+            visibility: hidden;
+        }
+    </style>
+</head>
+<body style="height: 200%">
+    <p>
+        Test for <i><a href="https://bugs.webkit.org/show_bug.cgi?id=48154">https://bugs.webkit.org/show_bug.cgi?id=48154</a>
+        <a href="rdar://problem/8251616">&lt;rdar://problem/8251616></a> Layout not updating in a subtree when a scrollbar is hidden in a flexbox descendant</i>.
+    </p>
+    <p>
+        There should be no red on this page.
+    </p>
+    <p id="result">Test did not run.</p>
+    <div style="display: -webkit-box; -webkit-box-orient: vertical;">
+        <div> <!-- this is going to end up marked for layout after initial layout -->
+            <div id="target" style="width: 100px; height: 100px; background-color: red;"></div>
+            <div id="overflow" style="overflow: auto; height: 100px; width: 100px;">
+                <div style="height: 150px;"></div>
+            </div>
+        </div>
+    </div>
+    <script>
+        if (window.layoutTestController)
+            layoutTestController.dumpAsText();
+
+        function test()
+        {
+            var target = document.getElementById("target");
+            target.style.height = "0";
+            document.getElementById("result").innerText = target.offsetHeight == 0 ? "PASS" : "FAIL";
+        }
+
+        document.body.offsetTop;
+        test();
+    </script>
+</body>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index eeb4983..11ec0a4 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-10-22  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        Layout not updating in a subtree when a scrollbar is hidden in a flexbox descendant
+        https://bugs.webkit.org/show_bug.cgi?id=48154
+
+        Test: scrollbars/hidden-scrollbar-prevents-layout.html
+
+        updateScrollInfoAfterLayout() calling setHasHorizontalScrollbar() caused updateScrollbarParts()
+        to call setChildNeedsLayout() on the overflow, because the RenderScrollbar was created with
+        the default thickness instead of the thickness specified in style. This led to the the overflow’s
+        parent to be re-marked for layout during its own parent’s finishDelayUpdateScrollInfo(), and
+        the result was that at the end of RenderView::layout(), there was a dirty renderer.
+
+        * rendering/RenderScrollbar.cpp:
+        (WebCore::RenderScrollbar::RenderScrollbar): Set the frame size in the 'display: none' and
+        'visibility: hidden' cases as well.
+
 2010-10-22  Patrick Gansterer  <paroga at webkit.org>
 
         Unreviewed.
diff --git a/WebCore/rendering/RenderScrollbar.cpp b/WebCore/rendering/RenderScrollbar.cpp
index e7a70a4..44a0126 100644
--- a/WebCore/rendering/RenderScrollbar.cpp
+++ b/WebCore/rendering/RenderScrollbar.cpp
@@ -47,13 +47,19 @@ RenderScrollbar::RenderScrollbar(ScrollbarClient* client, ScrollbarOrientation o
     // FIXME: We need to do this because RenderScrollbar::styleChanged is called as soon as the scrollbar is created.
     
     // Update the scrollbar size.
+    int width = 0;
+    int height = 0;
     updateScrollbarPart(ScrollbarBGPart);
-    RenderScrollbarPart* part = m_parts.get(ScrollbarBGPart);
-    if (!part)
-        return;
-
-    part->layout();
-    setFrameRect(IntRect(0, 0, part->width(), part->height()));
+    if (RenderScrollbarPart* part = m_parts.get(ScrollbarBGPart)) {
+        part->layout();
+        width = part->width();
+        height = part->height();
+    } else if (this->orientation() == HorizontalScrollbar)
+        width = this->width();
+    else
+        height = this->height();
+
+    setFrameRect(IntRect(0, 0, width, height));
 }
 
 RenderScrollbar::~RenderScrollbar()

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list