Unnecessary scroll bar after changing the dimensions of a DIV
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Apr 2012 20:31:15 +0000 (20:31 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Apr 2012 20:31:15 +0000 (20:31 +0000)
commitd575efb068c5dfd9e5f106b0fc2746ffac89a710
treeff95e049a08b087c7ee00870d776f32151438a49
parent55aea4fd5b97eca1d60bb04b95919290e5fe4851
Unnecessary scroll bar after changing the dimensions of a DIV
https://bugs.webkit.org/show_bug.cgi?id=71541

Patch by SravanKumar Sandela <ssandela@innominds.com> on 2012-04-09
Reviewed by Julien Chaffraix.

Source/WebCore:

overflow: auto was being determined based on clientWidth and clientHeight, which during style change
scenarii will blindly exclude previous scrollbars while computing overflow. This is valid only for
overflow: scroll, but for other cases it wrongly reduces available area. Now it is taken care by
determining the overflow based on pixelSnappedPaddingBoxWidth/Height() which are newly added in RenderBox.

Tests: fast/overflow/overflow-auto-destroy-scroll-after-resizing-expected.html
       fast/overflow/overflow-auto-destroy-scroll-after-resizing.html

* rendering/RenderBox.h:
(WebCore::RenderBox::paddingBoxWidth):
(WebCore::RenderBox::paddingBoxHeight):
(WebCore::RenderBox::pixelSnappedPaddingBoxWidth):
(WebCore::RenderBox::pixelSnappedPaddingBoxHeight):
(RenderBox):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::hasHorizontalOverflow):
(WebCore::RenderLayer::hasVerticalOverflow):

LayoutTests:

Ref tests to check scrollbar behaviour in overflow: auto, on resizing.

* fast/overflow/overflow-auto-destroy-scroll-after-resizing-expected.html: Added.
* fast/overflow/overflow-auto-destroy-scroll-after-resizing.html: Added.

scrollbars-on-positioned-content.html and hidden-scrollbar-resize.html needs to be rebaselined
as their expected values were buggy because of redundant scrollbars.

* platform/chromium/test_expectations.txt:
* platform/efl/Skipped:
* platform/mac/Skipped:
* platform/qt/Skipped:
* platform/win/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113611 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/overflow/overflow-auto-destroy-scroll-after-resizing-expected.html [new file with mode: 0644]
LayoutTests/fast/overflow/overflow-auto-destroy-scroll-after-resizing.html [new file with mode: 0644]
LayoutTests/platform/chromium/test_expectations.txt
LayoutTests/platform/efl/Skipped
LayoutTests/platform/mac/Skipped
LayoutTests/platform/qt/Skipped
LayoutTests/platform/win/Skipped
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderLayer.cpp