Ignore:
Timestamp:
Sep 8, 2013, 11:54:02 PM (12 years ago)
Author:
[email protected]
Message:

Scrollbar width is not applied when element hidden
https://bugs.webkit.org/show_bug.cgi?id=90546

Patch by Gurpreet Kaur <[email protected]> on 2013-09-08
Reviewed by Simon Fraser.

Source/WebCore:

Webkit has css properties through which custom scroll
bars can be added. Incase the element's visible property
is hidden and custom scrollbar properties are applied
the scrollbar width is not considered when quering the
element.clientWidth. Incase of non-custom scrollbars
whether the element's visible property is hidden or not
correct scrollbar width is considered.

Tests: fast/dom/Element/scroll-width-hidden.html

fast/dom/Element/scroll-width-visible.html

  • rendering/RenderScrollbar.cpp:

(WebCore::RenderScrollbar::updateScrollbarPart):
Incase custom scrollbar is created there is a check whether
the renderer to which scrollbar is added is visible or not.
This check is not required since for non-custom scrollbars same
check is not present. Also whether element's visible property is
hidden or not a placeholder is set for the element. Both behavoiur
i.e custom and non-custom scrollbars should be same.

LayoutTests:

  • fast/dom/Element/scroll-width-hidden-expected.txt: Added.
  • fast/dom/Element/scroll-width-hidden.html: Added.
  • fast/dom/Element/scroll-width-visible-expected.txt: Added.
  • fast/dom/Element/scroll-width-visible.html: Added.

Added new test for verifying that scroll width returns proper
values for element which is visible and hidden.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/rendering/RenderScrollbar.cpp

    r154580 r155323  
    227227    RefPtr<RenderStyle> partStyle = !destroy ? getScrollbarPseudoStyle(partType,  pseudoForScrollbarPart(partType)) : PassRefPtr<RenderStyle>(0);
    228228   
    229     bool needRenderer = !destroy && partStyle && partStyle->display() != NONE && partStyle->visibility() == VISIBLE;
     229    bool needRenderer = !destroy && partStyle && partStyle->display() != NONE;
    230230   
    231231    if (needRenderer && partStyle->display() != BLOCK) {
Note: See TracChangeset for help on using the changeset viewer.