• tonikitoo@webkit.org's avatar
    Text dragging can scroll overflow:hidden boxes https://bugs.webkit.org/show_bug.cgi?id=119760 · ce8f1831
    tonikitoo@webkit.org authored
    Reviewed by Darin Adler.
    Patch by Antonio Gomes <a1.gomes@sisa.samsung.com>
    
    Source/WebCore:
    
    Consider the case of the following HTML:
    <div style="overflow:hidden; width: 100px; height: 100px" >
      <input id="input" type="text" size=10 value="any text here!"/>
      <button style="position:relative; top: 100px; left: 100px"/>
    </div>
    
    If ones starts a text selection by dragging the mouse from within the input
    field, and continues to drag beyong the outer div boundary, the latter will
    be scrolled no matter its overflow:hidden style.
    That happens because when the autoscroll has started, it gets propagated up
    to the current layer's parent layer, instead of the to current layer's enclosing
    scrollable layer.
    
    Patch fixes the issue by hardening the way scrolling is
    propagated upwards when autoscroll is being performed.
    
    RenderLayer::enclosingScrollableLayer method also got rewritten
    in terms of RenderLayer tree traversing, instead of RenderObject tree.
    The rewrite adds support for cross frame upwards traversal.
    
    Test: fast/events/autoscroll-upwards-propagation.html
    
    * rendering/RenderLayer.cpp:
    (WebCore::parentLayerCrossFrame):
    (WebCore::RenderLayer::enclosingScrollableLayer):
    (WebCore::RenderLayer::scrollRectToVisible):
    
    LayoutTests:
    
    * fast/events/autoscroll-upwards-propagation-expected.txt: Added.
    * fast/events/autoscroll-upwards-propagation.html: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154382 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    ce8f1831