Bug 104373

Summary: Harden RenderBox::canBeScrolledAndHasScrollableArea logic
Product: WebKit Reporter: Antonio Gomes <tonikitoo>
Component: Layout and RenderingAssignee: Antonio Gomes <tonikitoo>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, commit-queue, esprehn+autocc, esprehn, glenn, jkjiang, kondapallykalyan, simon.fraser, skyostil, tdanderson
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch 0.1 - for EWS (no tests or changelog added yet)
none
patch 1 - for review simon.fraser: review+

Description Antonio Gomes 2012-12-07 08:30:01 PST
353 // The RenderBox::canbeScrolledAndHasScrollableArea method returns true for the
354 // following scenario, for example:
355 // (1) a div that has a vertical overflow but no horizontal overflow
356 //     with overflow-y: hidden and overflow-x: auto set.
357 // The version below fixes it.
358 // FIXME: Fix RenderBox::canBeScrolledAndHasScrollableArea method instead.
359 bool InRegionScrollerPrivate::canScrollRenderBox(RenderBox* box)
Comment 1 Terry Anderson 2013-03-01 11:30:01 PST
*** Bug 109633 has been marked as a duplicate of this bug. ***
Comment 2 Antonio Gomes 2013-08-20 09:12:54 PDT
Created attachment 209200 [details]
patch 0.1 - for EWS (no tests or changelog added yet)
Comment 3 Antonio Gomes 2013-08-20 11:47:28 PDT
Created attachment 209213 [details]
patch 1 - for review
Comment 4 Simon Fraser (smfr) 2013-08-20 14:03:15 PDT
Comment on attachment 209213 [details]
patch 1 - for review

View in context: https://bugs.webkit.org/attachment.cgi?id=209213&action=review

> LayoutTests/ChangeLog:9
> +        ayis if it is scrollable in that direction, according to its style.

axis

> Source/WebCore/rendering/RenderBox.h:467
> +    bool hasScrollableOverflowX() const { return scrollsOverflowX() && scrollWidth() != clientWidth(); }
> +    bool hasScrollableOverflowY() const { return scrollsOverflowY() && scrollHeight() != clientHeight(); }

I'm not convinced that scrollWidth() != clientWidth() is right here.  RenderLayer::hasHorizontalOverflow() does:  scrollWidth() > renderBox()->pixelSnappedClientWidth();
Comment 5 Antonio Gomes 2013-08-21 07:06:21 PDT
https://trac.webkit.org/changeset/154383