Changeset 116469 in webkit


Ignore:
Timestamp:
May 8, 2012 5:24:15 PM (12 years ago)
Author:
andersca@apple.com
Message:

Can't scroll PDF in subframe
https://bugs.webkit.org/show_bug.cgi?id=85932
<rdar://problem/11405527>

Reviewed by Sam Weinig.

  • WebProcess/Plugins/PDF/BuiltInPDFView.h:
  • WebProcess/Plugins/PDF/BuiltInPDFView.mm:

(WebKit::BuiltInPDFView::updateScrollbars):
Trigger a layout when scrollbars come and go so the non fast scrollable region gets recomputed.

(WebKit::BuiltInPDFView::scrollableAreaBoundingBox):
Implement this by calling out to the PluginView.

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r116466 r116469  
     12012-05-08  Anders Carlsson  <andersca@apple.com>
     2
     3        Can't scroll PDF in subframe
     4        https://bugs.webkit.org/show_bug.cgi?id=85932
     5        <rdar://problem/11405527>
     6
     7        Reviewed by Sam Weinig.
     8
     9        * WebProcess/Plugins/PDF/BuiltInPDFView.h:
     10        * WebProcess/Plugins/PDF/BuiltInPDFView.mm:
     11        (WebKit::BuiltInPDFView::updateScrollbars):
     12        Trigger a layout when scrollbars come and go so the non fast scrollable region gets recomputed.
     13
     14        (WebKit::BuiltInPDFView::scrollableAreaBoundingBox):
     15        Implement this by calling out to the PluginView.
     16
    1172012-05-06  Jon Lee  <jonlee@apple.com>
    218
  • trunk/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.h

    r114476 r116469  
    120120    virtual WebCore::IntRect scrollCornerRect() const;
    121121    virtual WebCore::ScrollableArea* enclosingScrollableArea() const;
     122    virtual WebCore::IntRect scrollableAreaBoundingBox() const OVERRIDE;
    122123    virtual void setScrollOffset(const WebCore::IntPoint&);
    123124    virtual int scrollSize(WebCore::ScrollbarOrientation) const;
  • trunk/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.mm

    r114476 r116469  
    197197void BuiltInPDFView::updateScrollbars()
    198198{
     199    bool hadScrollbars = m_horizontalScrollbar || m_verticalScrollbar;
     200
    199201    if (m_horizontalScrollbar) {
    200202        if (m_pluginSize.width() >= m_pdfDocumentSize.width())
     
    235237        return;
    236238
    237     if (m_verticalScrollbar || m_horizontalScrollbar)
    238         frameView->addScrollableArea(this);
    239     else
    240         frameView->removeScrollableArea(this);
     239    bool hasScrollbars = m_horizontalScrollbar || m_verticalScrollbar;
     240    if (hadScrollbars != hasScrollbars) {
     241        if (hasScrollbars)
     242            frameView->addScrollableArea(this);
     243        else
     244            frameView->removeScrollableArea(this);
     245
     246        frameView->setNeedsLayout();
     247    }
    241248}
    242249
     
    689696}
    690697
     698IntRect BuiltInPDFView::scrollableAreaBoundingBox() const
     699{
     700    return pluginView()->frameRect();
     701}
     702
    691703void BuiltInPDFView::setScrollOffset(const IntPoint& offset)
    692704{
Note: See TracChangeset for help on using the changeset viewer.