void AutoscrollController::startAutoscrollForSelection(LayoutObject* layoutObject) { // We don't want to trigger the autoscroll or the panScroll if it's already active if (m_autoscrollType != NoAutoscroll) return; LayoutBox* scrollable = LayoutBox::findAutoscrollable(layoutObject); if (!scrollable) scrollable = layoutObject->isListBox() ? toLayoutListBox(layoutObject) : nullptr; if (!scrollable) return; m_autoscrollType = AutoscrollForSelection; m_autoscrollLayoutObject = scrollable; startAutoscroll(); }
void AutoscrollController::startAutoscrollForSelection( LayoutObject* layoutObject) { // We don't want to trigger the autoscroll or the middleClickAutoscroll if // it's already active. if (m_autoscrollType != NoAutoscroll) return; if (layoutObject) layoutObject->frameView()->updateAllLifecyclePhasesExceptPaint(); LayoutBox* scrollable = LayoutBox::findAutoscrollable(layoutObject); if (!scrollable) scrollable = layoutObject->isListBox() ? toLayoutListBox(layoutObject) : nullptr; if (!scrollable) return; m_pressedLayoutObject = layoutObject && layoutObject->isBox() ? toLayoutBox(layoutObject) : nullptr; m_autoscrollType = AutoscrollForSelection; m_autoscrollLayoutObject = scrollable; startAutoscroll(); }