[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

bweinstein at apple.com bweinstein at apple.com
Thu Apr 8 01:02:55 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit e9afc8f6ace9a56219eef13a590bbb59ac0b8d9b
Author: bweinstein at apple.com <bweinstein at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jan 12 23:39:16 2010 +0000

    Safari shows an unneeded horizontal scrollbar on many websites.
    Fixes <rdar://6321041> and <http://webkit.org/b/33555>.
    
    Reviewed by Dave Hyatt.
    
    WebCore:
    
    If a div has no children, and its height or width are 0, we can ignore
    it in our calculation of lowest, rightmost, and leftmost positions. This
    calculation was causing horizontal scrollbars to be drawn when they weren't needed.
    
    Test: fast/block/positioning/absolute-positioning-no-scrollbar.html
    
    * rendering/RenderBlock.cpp:
    (WebCore::RenderBlock::lowestPosition): Added check for no children and width or height 0.
    (WebCore::RenderBlock::rightmostPosition): Ditto.
    (WebCore::RenderBlock::leftmostPosition): Ditto.
    
    LayoutTests:
    
    Added a test that shows no scrollbar in the case where a div has no children
    and either a width or height of 0. Also updated results for a few tests which
    this patch causes progressions for.
    
    * fast/block/positioning/absolute-positioning-no-scrollbar-expected.txt: Added.
    * fast/block/positioning/absolute-positioning-no-scrollbar.html: Added.
    * fast/block/positioning/fixed-positioning-scrollbar-bug.html:
    * platform/mac/fast/backgrounds/repeat/negative-offset-repeat-transformed-expected.txt:
    * platform/mac/fast/block/positioning/fixed-positioning-scrollbar-bug-expected.txt:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53168 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index d0a8e9e..a0bd5da 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,20 @@
+2010-01-12  Brian Weinstein  <bweinstein at apple.com>
+
+        Reviewed by Dave Hyatt.
+
+        Safari shows an unneeded horizontal scrollbar on many websites.
+        Fixes <rdar://6321041> and <http://webkit.org/b/33555>.
+        
+        Added a test that shows no scrollbar in the case where a div has no children
+        and either a width or height of 0. Also updated results for a few tests which
+        this patch causes progressions for.
+
+        * fast/block/positioning/absolute-positioning-no-scrollbar-expected.txt: Added.
+        * fast/block/positioning/absolute-positioning-no-scrollbar.html: Added.
+        * fast/block/positioning/fixed-positioning-scrollbar-bug.html:
+        * platform/mac/fast/backgrounds/repeat/negative-offset-repeat-transformed-expected.txt:
+        * platform/mac/fast/block/positioning/fixed-positioning-scrollbar-bug-expected.txt:
+
 2010-01-12  Beth Dakin  <bdakin at apple.com>
 
         Reviewed by Sam Weinig.
diff --git a/LayoutTests/fast/block/positioning/absolute-positioning-no-scrollbar-expected.txt b/LayoutTests/fast/block/positioning/absolute-positioning-no-scrollbar-expected.txt
new file mode 100644
index 0000000..bdc0454
--- /dev/null
+++ b/LayoutTests/fast/block/positioning/absolute-positioning-no-scrollbar-expected.txt
@@ -0,0 +1,8 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x576
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 306x18
+          text run at (0,0) width 306: "This page should not have a horizontal scrollbar."
diff --git a/LayoutTests/fast/block/positioning/absolute-positioning-no-scrollbar.html b/LayoutTests/fast/block/positioning/absolute-positioning-no-scrollbar.html
new file mode 100644
index 0000000..97110e9
--- /dev/null
+++ b/LayoutTests/fast/block/positioning/absolute-positioning-no-scrollbar.html
@@ -0,0 +1,13 @@
+<html>
+<head>
+    <title></title>
+</head>
+<body>
+    <p>This page should not have a horizontal scrollbar.</p>
+    <script>
+        document.body.offsetTop;    // Force layout now.
+    </script>
+    <div style="width: 100%; position: absolute;">
+    </div>
+</body>
+</html>
diff --git a/LayoutTests/fast/block/positioning/fixed-positioning-scrollbar-bug.html b/LayoutTests/fast/block/positioning/fixed-positioning-scrollbar-bug.html
index 609770b..d812b93 100644
--- a/LayoutTests/fast/block/positioning/fixed-positioning-scrollbar-bug.html
+++ b/LayoutTests/fast/block/positioning/fixed-positioning-scrollbar-bug.html
@@ -7,7 +7,7 @@
     <script>
         document.body.offsetTop;    // Force layout now.
     </script>
-    <div style="height: 2000px; position: absolute;">
+    <div style="height: 2000px; width: 1px; position: absolute;">
     </div>
     <div style="position: fixed; bottom: 0; height: 100px; width: 100px; background: purple;"></div>
     <!-- Try to load a resource. -->
diff --git a/LayoutTests/platform/mac/fast/backgrounds/repeat/negative-offset-repeat-transformed-expected.txt b/LayoutTests/platform/mac/fast/backgrounds/repeat/negative-offset-repeat-transformed-expected.txt
index 2f308ef..728f87f 100644
--- a/LayoutTests/platform/mac/fast/backgrounds/repeat/negative-offset-repeat-transformed-expected.txt
+++ b/LayoutTests/platform/mac/fast/backgrounds/repeat/negative-offset-repeat-transformed-expected.txt
@@ -1,4 +1,4 @@
-layer at (0,0) size 785x5502
+layer at (0,0) size 785x1020
   RenderView at (0,0) size 785x600
 layer at (0,0) size 785x1020
   RenderBlock {HTML} at (0,0) size 785x1020
diff --git a/LayoutTests/platform/mac/fast/block/positioning/fixed-positioning-scrollbar-bug-expected.txt b/LayoutTests/platform/mac/fast/block/positioning/fixed-positioning-scrollbar-bug-expected.txt
index 1bcffce..dbf7613 100644
--- a/LayoutTests/platform/mac/fast/block/positioning/fixed-positioning-scrollbar-bug-expected.txt
+++ b/LayoutTests/platform/mac/fast/block/positioning/fixed-positioning-scrollbar-bug-expected.txt
@@ -12,5 +12,7 @@ layer at (0,0) size 785x600
       RenderText {#text} at (0,0) size 0x0
       RenderText {#text} at (0,0) size 0x0
       RenderText {#text} at (0,0) size 0x0
+layer at (8,26) size 1x2000
+  RenderBlock (positioned) {DIV} at (8,26) size 1x2000
 layer at (8,500) size 100x100
   RenderBlock (positioned) {DIV} at (8,500) size 100x100 [bgcolor=#800080]
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8ca60ef..c89ae0d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-01-12  Brian Weinstein  <bweinstein at apple.com>
+
+        Reviewed by Dave Hyatt.
+
+        Safari shows an unneeded horizontal scrollbar on many websites.
+        Fixes <rdar://6321041> and <http://webkit.org/b/33555>.
+        
+        If a div has no children, and its height or width are 0, we can ignore
+        it in our calculation of lowest, rightmost, and leftmost positions. This
+        calculation was causing horizontal scrollbars to be drawn when they weren't needed.
+
+        Test: fast/block/positioning/absolute-positioning-no-scrollbar.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::lowestPosition): Added check for no children and width or height 0.
+        (WebCore::RenderBlock::rightmostPosition): Ditto.
+        (WebCore::RenderBlock::leftmostPosition): Ditto.
+
 2010-01-12  Alexander Pavlov  <apavlov at chromium.org>
 
         Reviewed by Timothy Hatcher.
diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp
index b57236a..fc714cd 100644
--- a/WebCore/rendering/RenderBlock.cpp
+++ b/WebCore/rendering/RenderBlock.cpp
@@ -2636,6 +2636,9 @@ int RenderBlock::lowestPosition(bool includeOverflowInterior, bool includeSelf)
 
     if (!includeOverflowInterior && (hasOverflowClip() || hasControlClip()))
         return bottom;
+
+    if (!firstChild() && (!width() || !height()))
+        return bottom;
     
     if (!hasColumns()) {
         // FIXME: Come up with a way to use the layer tree to avoid visiting all the kids.
@@ -2728,6 +2731,9 @@ int RenderBlock::rightmostPosition(bool includeOverflowInterior, bool includeSel
     if (!includeOverflowInterior && (hasOverflowClip() || hasControlClip()))
         return right;
 
+    if (!firstChild() && (!width() || !height()))
+        return right;
+
     if (!hasColumns()) {
         // FIXME: Come up with a way to use the layer tree to avoid visiting all the kids.
         // For now, we have to descend into all the children, since we may have a huge abs div inside
@@ -2822,6 +2828,9 @@ int RenderBlock::leftmostPosition(bool includeOverflowInterior, bool includeSelf
     if (!includeOverflowInterior && (hasOverflowClip() || hasControlClip()))
         return left;
 
+    if (!firstChild() && (!width() || !height()))
+        return left;
+
     if (!hasColumns()) {
         // FIXME: Come up with a way to use the layer tree to avoid visiting all the kids.
         // For now, we have to descend into all the children, since we may have a huge abs div inside

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list