• tonikitoo@webkit.org's avatar
    Harden RenderBox::canBeScrolledAndHasScrollableArea logic... · 1bf1cb62
    tonikitoo@webkit.org authored
    Harden RenderBox::canBeScrolledAndHasScrollableArea logic https://bugs.webkit.org/show_bug.cgi?id=104373
    Reviewed by Simon Fraser.
    Patch by Antonio Gomes <a1.gomes@sisa.samsung.com>
    Previously if a say div has a overflown content on 'y' but is
    styled as "overflow-x: auto; overflow-y: hidden", RenderBox::canBeProgramaticallyScrolled
    would still return true. It interfers, among other things, with the way
    autoscroll works.
    Patch fixes it by adding two helper methods to RenderBox class in order to verify a box'
    scrollability in a given axis (x or y); They are used when checking if a given box is in
    fact programatically scrollable.
    Test: fast/events/autoscroll-overflow-hidden-longhands.html
    WebKit autoscroll behavior now matches Firefox and Opera12 (pre-blink)
    in that sense.
    * rendering/RenderBox.cpp:
    * rendering/RenderBox.h:
    Patch adds a test to ensure autoscrolling only happens on a given
    axis if it is scrollable in that direction, according to its style.
    * fast/events/autoscroll-overflow-hidden-longhands-expected.txt: Added.
    * fast/events/autoscroll-overflow-hidden-longhands.html: Added.
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154383 268f45cc-cd09-0410-ab3c-d52691b4dbfc