• ambarish.r@samsung.com's avatar
    Element::scrollIntoViewIfNeeded computes the scroll bounding box by calling... · ffaa2984
    ambarish.r@samsung.com authored
    Element::scrollIntoViewIfNeeded computes the scroll bounding box by calling containerNode::boundingBox(), for performing autoscroll.
    This bounding box rect is passed to RenderLayerScrollableArea::exposeRect(), where actual
    scroll parent rect to be scrolled is computed.
    
    This bound is computed by using two factors.
    current Scroll Offset and the target Scroll Offset.
    
    target scroll offset is Y position of the element which has to be
    scrolled into view. This Y position computation includes top border
    of the parent container.
    for example. in the bug reported page.
    Parent grid has border of 5 px so,
    the position of first  child would be 5  and
    the position of second child would be 55 and so on
    
    But [current]scroll offset is independent of top border.
    When target bounding box is computed, target scroll offset is
    substracted from current scroll offset which results in incorrect
    scroll offset.
    for example. in the bug reported page
    1. When page loads grid is scrolled to 200.
    2. Parents top border is      5,
    3. Position of 2nd child is  55
    4. so the target scroll offset is computed as,
       55 - 200 = -145 , which is incorrect &
       should be,  50 - 200 = -150
    5. Hence the borderTop included in the position causes the issue, and needs to be removed from computed scroll offset value.
    
    BUG=295848
    
    Review URL: https://codereview.chromium.org/568453002
    
    git-svn-id: svn://svn.chromium.org/blink/trunk@183917 bbb929c8-8fbe-4397-9dbb-9b2b20218538
    ffaa2984
TestExpectations 116 KB