Account for scrolled element offsetTop in scrollIntoView
Account for scrolled element offsetTop in scrollIntoView

Previously when we try to scroll into view for a treeElement, we did not
consider that parent element (usually the scrollable tree container)
may have padding or border tops that may skew its result. Therefore,
the calculated deltaTop (how much to scroll in the Y axis) will always
be off by parent's padding-top + border-top, resulting in continous
scrolling even after the element is already scrolled into view.
This CL fixes this by offsetting the offsetTop of the element being
scrolled, which equals the distance of top of the element to the inner
border of the top of the offsetParent node.

Fixed: chromium:1208785
Change-Id: I7499983fddf1f4c4ec3e2ce56c48f8737b03ed0f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2960614
Auto-Submit: Changhao Han <68542faf32f0a558a873c0f094ca9bedb2744bff@chromium.org>
Reviewed-by: Mathias Bynens <17a2cbc4e33156874a9862b0f530521117e66a3d@chromium.org>
Commit-Queue: Changhao Han <68542faf32f0a558a873c0f094ca9bedb2744bff@chromium.org>

ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend