The above test case crashes on WebKit/Qt and I would like to get some feedback: PlatformScrollBarQt (created by the RenderLayer) can crash in two ways: 1.) It was removed from the FrameView and it acceses parent() 2.) m_client is a dangling pointer after RenderLayer was destroyed. 1.) is easy to fix 2.) Adding a ScrollBar::setClient and calling it from RenderLayer::destroyScrollBar to avoid the dangling pointer. I assume this approach will be declared too scientific so see the other alternative EventHandler gives the PlatformScrollBar a 2nd live because m_lastScrollbarUnderMouse is a RefPtr and has the scrollbar stored. Rev 24942 introduced the test case and I extend the change to take m_lastScrollbarUnderMouse into consideration.
Created attachment 17112 [details] Do not crash on mousedown_in_scrollbar.html Change EventHandler to give up the reference to a Scrollbar created by the RenderLayer.
Finally landed in r28227.