[webkit-dev] Scrolling overflow:hidden boxes..
tonikitoo at webkit.org
Fri Aug 16 14:45:00 PDT 2013
Bug https://bugs.webkit.org/show_bug.cgi?id=119760 (Text dragging can
scroll overflow:hidden boxes) caught my attention to the following
- imagine a page has an input field within a overflow:hidden <div>,
and user starts text selecting from the input field text by dragging
with the mouse. At some point it goes outside of the input boundary,
reaches the outer <div> boundary. By then, 'autoscroll' takes place
(see WebCore/page/AutoscrollController.cpp/h), and scrolls the outter
<div>. In my opinion, it should not happen, due to div's
A natural solution for that could be hardening
RenderLayer::scrollRectToVisible, when its upwards recursion occurs;
so instead of picking the current layer parent, it picks the enclosing
scrollable layer instead.
However, it seems acceptable that overflow:hidden div's RenderLayers
are scrollable in certain situations. Consider the case of
Element.scrollIntoView(), for example: as of now, WebKit scrolls an
container overflow:hidden div, if it is to bring an HTML element into
Both situations go through the same RenderLayer::scrollRectToVisible method.
Introducing a ScrollSource parameter to indicate where the scrolling
action came from (user interaction or not), and relax or harden the
recursion criteria accordingly would not help, because it would break
autoscrolling within shadow DOM content (think of autoscrolling an
input's shadow DOM div).
Do you guys have thoughts on that?
More information about the webkit-dev