void ScrollingCoordinatorCoordinatedGraphics::scrollableAreaScrollLayerDidChange(ScrollableArea& scrollableArea) { CoordinatedGraphicsLayer* layer = toCoordinatedGraphicsLayer(scrollLayerForScrollableArea(scrollableArea)); if (!layer) return; layer->setScrollableArea(&scrollableArea); }
void ScrollingCoordinatorCoordinatedGraphics::willDestroyScrollableArea(ScrollableArea& scrollableArea) { CoordinatedGraphicsLayer* layer = toCoordinatedGraphicsLayer(scrollLayerForScrollableArea(scrollableArea)); if (!layer) return; layer->setScrollableArea(nullptr); }
void ScrollingCoordinatorChromium::scrollableAreaScrollLayerDidChange(ScrollableArea* scrollableArea) { GraphicsLayerChromium* scrollLayer = static_cast<GraphicsLayerChromium*>(scrollLayerForScrollableArea(scrollableArea)); if (scrollLayer) scrollLayer->setScrollableArea(scrollableArea); WebLayer* webLayer = scrollingWebLayerForScrollableArea(scrollableArea); if (webLayer) { webLayer->setScrollable(true); webLayer->setScrollPosition(IntPoint(scrollableArea->scrollPosition() - scrollableArea->minimumScrollPosition())); webLayer->setMaxScrollPosition(IntSize(scrollableArea->scrollSize(HorizontalScrollbar), scrollableArea->scrollSize(VerticalScrollbar))); } if (WebScrollbarLayer* scrollbarLayer = getWebScrollbarLayer(scrollableArea, HorizontalScrollbar)) setupScrollbarLayer(horizontalScrollbarLayerForScrollableArea(scrollableArea), scrollbarLayer, webLayer); if (WebScrollbarLayer* scrollbarLayer = getWebScrollbarLayer(scrollableArea, VerticalScrollbar)) setupScrollbarLayer(verticalScrollbarLayerForScrollableArea(scrollableArea), scrollbarLayer, webLayer); }
WebLayer* ScrollingCoordinatorChromium::scrollingWebLayerForScrollableArea(ScrollableArea* scrollableArea) { GraphicsLayer* graphicsLayer = scrollLayerForScrollableArea(scrollableArea); return graphicsLayer ? scrollingWebLayerForGraphicsLayer(graphicsLayer) : 0; }