diff options
Diffstat (limited to 'src/3rdparty/webkit/WebCore/platform/ScrollView.cpp')
-rw-r--r-- | src/3rdparty/webkit/WebCore/platform/ScrollView.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp b/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp index 9f0da3a..9d3c128 100644 --- a/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp +++ b/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp @@ -165,6 +165,7 @@ bool ScrollView::canBlitOnScroll() const return m_canBlitOnScroll; } +#if !PLATFORM(GTK) IntRect ScrollView::visibleContentRect(bool includeScrollbars) const { if (platformWidget()) @@ -173,6 +174,7 @@ IntRect ScrollView::visibleContentRect(bool includeScrollbars) const IntSize(max(0, width() - (verticalScrollbar() && !includeScrollbars ? verticalScrollbar()->width() : 0)), max(0, height() - (horizontalScrollbar() && !includeScrollbars ? horizontalScrollbar()->height() : 0)))); } +#endif int ScrollView::layoutWidth() const { @@ -279,7 +281,8 @@ void ScrollView::scrollRectIntoViewRecursively(const IntRect& r) // on up the view chain. // This rect is not clamped, since Mail actually relies on receiving an unclamped rect with negative coordinates in order to // expose the headers. - hostWindow()->scrollRectIntoView(rect, this); + if (hostWindow()) + hostWindow()->scrollRectIntoView(rect, this); } void ScrollView::setScrollPosition(const IntPoint& scrollPoint) @@ -544,6 +547,8 @@ IntRect ScrollView::contentsToScreen(const IntRect& rect) const { if (platformWidget()) return platformContentsToScreen(rect); + if (!hostWindow()) + return IntRect(); return hostWindow()->windowToScreen(contentsToWindow(rect)); } @@ -551,6 +556,8 @@ IntPoint ScrollView::screenToContents(const IntPoint& point) const { if (platformWidget()) return platformScreenToContents(point); + if (!hostWindow()) + return IntPoint(); return windowToContents(hostWindow()->screenToWindow(point)); } @@ -633,12 +640,12 @@ void ScrollView::setScrollbarsSuppressed(bool suppressed, bool repaintOnUnsuppre } } -Scrollbar* ScrollView::scrollbarUnderMouse(const PlatformMouseEvent& mouseEvent) +Scrollbar* ScrollView::scrollbarUnderPoint(const IntPoint& windowPoint) { if (platformWidget()) return 0; - IntPoint viewPoint = convertFromContainingWindow(mouseEvent.pos()); + IntPoint viewPoint = convertFromContainingWindow(windowPoint); if (m_horizontalScrollbar && m_horizontalScrollbar->frameRect().contains(viewPoint)) return m_horizontalScrollbar.get(); if (m_verticalScrollbar && m_verticalScrollbar->frameRect().contains(viewPoint)) @@ -717,7 +724,8 @@ void ScrollView::repaintContentRectangle(const IntRect& rect, bool now) return; } - hostWindow()->repaint(contentsToWindow(rect), true, now); + if (hostWindow()) + hostWindow()->repaint(contentsToWindow(rect), true, now); } void ScrollView::paint(GraphicsContext* context, const IntRect& rect) @@ -853,6 +861,8 @@ bool ScrollView::isOffscreen() const void ScrollView::addPanScrollIcon(const IntPoint& iconPosition) { + if (!hostWindow()) + return; m_drawPanScrollIcon = true; m_panScrollIconPoint = IntPoint(iconPosition.x() - panIconSizeLength / 2 , iconPosition.y() - panIconSizeLength / 2) ; hostWindow()->repaint(IntRect(m_panScrollIconPoint, IntSize(panIconSizeLength,panIconSizeLength)), true, true); @@ -860,6 +870,8 @@ void ScrollView::addPanScrollIcon(const IntPoint& iconPosition) void ScrollView::removePanScrollIcon() { + if (!hostWindow()) + return; m_drawPanScrollIcon = false; hostWindow()->repaint(IntRect(m_panScrollIconPoint, IntSize(panIconSizeLength, panIconSizeLength)), true, true); } |