Changeset 56854 in webkit


Ignore:
Timestamp:
Mar 31, 2010 11:03:40 AM (14 years ago)
Author:
kenneth@webkit.org
Message:

Do not draw scrollbars for subframes when frame flattening is
enabled. Implemented using a virtual method in ScrollView as
suggested by Dave Hyatt.

Reviewed by Antti Koivisto.

Do not suppress scrollbars as that is wrong according to
Dave Hyatt.

Covered by current tests.

  • page/FrameView.cpp:

(WebCore::FrameView::avoidScrollbarCreation):

  • page/FrameView.h:
  • platform/ScrollView.cpp:

(WebCore::ScrollView::setHasHorizontalScrollbar):
(WebCore::ScrollView::setHasVerticalScrollbar):

  • platform/ScrollView.h:

(WebCore::ScrollView::avoidScrollbarCreation):

  • rendering/RenderPart.cpp:

(WebCore::RenderPart::layoutWithFlattening):

Location:
trunk/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r56852 r56854  
     12010-03-31  Kenneth Rohde Christiansen  <kenneth@webkit.org>
     2
     3        Reviewed by Antti Koivisto.
     4
     5        iframe flattening doesn't flatten
     6        https://bugs.webkit.org/show_bug.cgi?id=36798
     7
     8        Do not draw scrollbars for subframes when frame flattening is
     9        enabled. Implemented using a virtual method in ScrollView as
     10        suggested by Dave Hyatt.
     11
     12        Do not suppress scrollbars as that is wrong according to
     13        Dave Hyatt.
     14
     15        Covered by current tests.
     16
     17        * page/FrameView.cpp:
     18        (WebCore::FrameView::avoidScrollbarCreation):
     19        * page/FrameView.h:
     20        * platform/ScrollView.cpp:
     21        (WebCore::ScrollView::setHasHorizontalScrollbar):
     22        (WebCore::ScrollView::setHasVerticalScrollbar):
     23        * platform/ScrollView.h:
     24        (WebCore::ScrollView::avoidScrollbarCreation):
     25        * rendering/RenderPart.cpp:
     26        (WebCore::RenderPart::layoutWithFlattening):
     27
    1282010-03-30  Kenneth Rohde Christiansen  <kenneth@webkit.org>
    229
  • trunk/WebCore/page/FrameView.cpp

    r56764 r56854  
    326326}
    327327
     328bool FrameView::avoidScrollbarCreation()
     329{
     330    // with frame flattening no subframe can have scrollbars
     331    // but we also cannot turn scrollbars of as we determine
     332    // our flattening policy using that.
     333
     334    if (!m_frame->ownerElement())
     335        return false;
     336
     337    if (!m_frame->settings() || m_frame->settings()->frameFlatteningEnabled())
     338        return true;
     339
     340    return false;
     341}
     342
    328343void FrameView::setCanHaveScrollbars(bool canHaveScrollbars)
    329344{
  • trunk/WebCore/page/FrameView.h

    r56209 r56854  
    7878    virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarOrientation);
    7979
     80    virtual bool avoidScrollbarCreation();
     81
    8082    virtual void setContentsSize(const IntSize&);
    8183
  • trunk/WebCore/platform/ScrollView.cpp

    r56526 r56854  
    3535#include <wtf/StdLibExtras.h>
    3636
     37
    3738using std::max;
    3839
     
    8182void ScrollView::setHasHorizontalScrollbar(bool hasBar)
    8283{
     84    if (avoidScrollbarCreation())
     85        return;
     86
    8387    if (hasBar && !m_horizontalScrollbar) {
    8488        m_horizontalScrollbar = createScrollbar(HorizontalScrollbar);
     
    9397void ScrollView::setHasVerticalScrollbar(bool hasBar)
    9498{
     99    if (avoidScrollbarCreation())
     100        return;
     101
    95102    if (hasBar && !m_verticalScrollbar) {
    96103        m_verticalScrollbar = createScrollbar(VerticalScrollbar);
  • trunk/WebCore/platform/ScrollView.h

    r55890 r56854  
    9393    bool canHaveScrollbars() const { return horizontalScrollbarMode() != ScrollbarAlwaysOff || verticalScrollbarMode() != ScrollbarAlwaysOff; }
    9494
     95    virtual bool avoidScrollbarCreation() { return false; }
     96
    9597    // By default you only receive paint events for the area that is visible. In the case of using a
    9698    // tiled backing store, this method can be set, so that the view paints the entire contents.
  • trunk/WebCore/rendering/RenderPart.cpp

    r56718 r56854  
    6363    HTMLFrameElement* element = static_cast<HTMLFrameElement*>(node());
    6464
    65     // suppress scrollbars as we might have fixed width or height
    66     childFrameView->setScrollbarsSuppressed(true, true);
    67 
    6865    // Do not expand frames which has zero width or height
    6966    if (!width() || !height() || !childRoot) {
Note: See TracChangeset for help on using the changeset viewer.