summaryrefslogtreecommitdiff
path: root/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.mm
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.mm')
-rw-r--r--Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.mm26
1 files changed, 22 insertions, 4 deletions
diff --git a/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.mm b/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.mm
index 7dc0b0e64..c4ee69330 100644
--- a/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.mm
+++ b/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.mm
@@ -196,6 +196,8 @@ const PluginView* BuiltInPDFView::pluginView() const
void BuiltInPDFView::updateScrollbars()
{
+ bool hadScrollbars = m_horizontalScrollbar || m_verticalScrollbar;
+
if (m_horizontalScrollbar) {
if (m_pluginSize.width() >= m_pdfDocumentSize.width())
destroyScrollbar(HorizontalScrollbar);
@@ -234,10 +236,15 @@ void BuiltInPDFView::updateScrollbars()
if (!frameView)
return;
- if (m_verticalScrollbar || m_horizontalScrollbar)
- frameView->addScrollableArea(this);
- else
- frameView->removeScrollableArea(this);
+ bool hasScrollbars = m_horizontalScrollbar || m_verticalScrollbar;
+ if (hadScrollbars != hasScrollbars) {
+ if (hasScrollbars)
+ frameView->addScrollableArea(this);
+ else
+ frameView->removeScrollableArea(this);
+
+ frameView->setNeedsLayout();
+ }
}
PassRefPtr<Scrollbar> BuiltInPDFView::createScrollbar(ScrollbarOrientation orientation)
@@ -464,6 +471,12 @@ bool BuiltInPDFView::isTransparent()
return false;
}
+bool BuiltInPDFView::wantsWheelEvents()
+{
+ // We return false here even though we do want wheel events, because we add ourselves to the scrollable area set in updateScrollbars().
+ return false;
+}
+
void BuiltInPDFView::geometryDidChange(const IntSize& pluginSize, const IntRect& clipRect, const AffineTransform& pluginToRootViewTransform)
{
if (m_pluginSize == pluginSize) {
@@ -688,6 +701,11 @@ ScrollableArea* BuiltInPDFView::enclosingScrollableArea() const
return 0;
}
+IntRect BuiltInPDFView::scrollableAreaBoundingBox() const
+{
+ return pluginView()->frameRect();
+}
+
void BuiltInPDFView::setScrollOffset(const IntPoint& offset)
{
m_scrollOffset = IntSize(offset.x(), offset.y());