Changeset 48064 in webkit


Ignore:
Timestamp:
Sep 4, 2009 10:59:46 AM (15 years ago)
Author:
Dimitri Glazkov
Message:

WebCore:

2009-09-04 Mark Mentovai <mark@chromium.org>

Reviewed by Dave Hyatt.

https://bugs.webkit.org/show_bug.cgi?id=28614

Account for scrollbar state changes that occur during layout.

  • platform/ScrollView.cpp: (WebCore::ScrollView::updateScrollbars):

Perform a layout prior to checking whether the scrollbar modes are
off, on, or automatic. The modes may change during layout.

  • WebCore.base.exp:
  • WebCore.order:
  • page/Frame.cpp: (WebCore::Frame::createView):
  • page/FrameView.cpp: (WebCore::FrameView::FrameView): (WebCore::FrameView::resetScrollbars): (WebCore::FrameView::layout):
  • page/FrameView.h:
  • platform/ScrollView.h:

Eliminate duplicated (and incorrect) scrollbar mode tracking between
FrameView and ScrollView.

WebKit/mac:

2009-09-04 Mark Mentovai <mark@chromium.org>

Reviewed by Dave Hyatt.

https://bugs.webkit.org/show_bug.cgi?id=28614

Account for scrollbar state changes that occur during layout.

  • WebView/WebDynamicScrollBarsView.mm: (-[WebDynamicScrollBarsView updateScrollers]):

Perform a layout prior to checking whether the scrollbar modes are
off, on, or automatic. The modes may change during layout.

  • WebView/WebFrameView.mm: (-[WebFrameView _install]):

Eliminate duplicated (and incorrect) scrollbar mode tracking between
FrameView and ScrollView.

WebKit/qt:

2009-09-04 Mark Mentovai <mark@chromium.org>

Reviewed by Dave Hyatt.

https://bugs.webkit.org/show_bug.cgi?id=28614

Account for scrollbar state changes that occur during layout.

  • Api/qwebframe.cpp: (QWebFrame::setScrollBarPolicy):

Eliminate duplicated (and incorrect) scrollbar mode tracking between
FrameView and ScrollView.

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r48063 r48064  
     12009-09-04  Mark Mentovai  <mark@chromium.org>
     2
     3        Reviewed by Dave Hyatt.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=28614
     6
     7        Account for scrollbar state changes that occur during layout.
     8
     9        * platform/ScrollView.cpp:
     10        (WebCore::ScrollView::updateScrollbars):
     11
     12        Perform a layout prior to checking whether the scrollbar modes are
     13        off, on, or automatic.  The modes may change during layout.
     14
     15        * WebCore.base.exp:
     16        * WebCore.order:
     17        * page/Frame.cpp:
     18        (WebCore::Frame::createView):
     19        * page/FrameView.cpp:
     20        (WebCore::FrameView::FrameView):
     21        (WebCore::FrameView::resetScrollbars):
     22        (WebCore::FrameView::layout):
     23        * page/FrameView.h:
     24        * platform/ScrollView.h:
     25
     26        Eliminate duplicated (and incorrect) scrollbar mode tracking between
     27        FrameView and ScrollView.
     28
    1292009-09-04  Yael Aharon  <yael.aharon@nokia.com>
    230
  • trunk/WebCore/WebCore.base.exp

    r48057 r48064  
    693693__ZN7WebCore9FrameView12setMediaTypeERKNS_6StringE
    694694__ZN7WebCore9FrameView14adjustViewSizeEv
    695 __ZN7WebCore9FrameView14initScrollbarsEv
    696695__ZN7WebCore9FrameView14setMarginWidthEi
    697696__ZN7WebCore9FrameView14setNeedsLayoutEv
  • trunk/WebCore/WebCore.order

    r47797 r48064  
    335335__ZN7WebCore6Widget21releasePlatformWidgetEv
    336336__ZN7WebCore6Widget20retainPlatformWidgetEv
    337 __ZN7WebCore9FrameView14initScrollbarsEv
    338 __ZN7WebCore9FrameView27updateDefaultScrollbarStateEv
    339337__ZNK7WebCore10ScrollView14scrollbarModesERNS_13ScrollbarModeES2_
    340338__ZNK7WebCore10ScrollView22platformScrollbarModesERNS_13ScrollbarModeES2_
     
    57605758__ZN7WebCore10ScrollView16platformAddChildEPNS_6WidgetE
    57615759__ZN7WebCore16RenderPartObject11viewClearedEv
    5762 __ZN7WebCore9FrameView20setCanHaveScrollbarsEb
    57635760__ZN7WebCore10ScrollView20setCanHaveScrollbarsEb
    57645761__ZNK7WebCore14SecurityOrigin9canAccessEPKS0_
  • trunk/WebCore/page/Frame.cpp

    r48057 r48064  
    17941794
    17951795    frameView->setScrollbarModes(horizontalScrollbarMode, verticalScrollbarMode);
    1796     frameView->updateDefaultScrollbarState();
    17971796
    17981797    setView(frameView);
  • trunk/WebCore/page/FrameView.cpp

    r47835 r48064  
    9494FrameView::FrameView(Frame* frame)
    9595    : m_frame(frame)
    96     , m_vmode(ScrollbarAuto)
    97     , m_hmode(ScrollbarAuto)
    9896    , m_slowRepaintObjectCount(0)
    9997    , m_layoutTimer(this, &FrameView::layoutTimerFired)
    10098    , m_layoutRoot(0)
    10199    , m_postLayoutTasksTimer(this, &FrameView::postLayoutTimerFired)
    102     , m_needToInitScrollbars(true)
    103100    , m_isTransparent(false)
    104101    , m_baseBackgroundColor(Color::white)
     
    211208    m_firstLayout = true;
    212209    setScrollbarsSuppressed(true);
    213     setScrollbarModes(m_hmode, m_vmode);
     210    setScrollbarModes(ScrollbarAuto, ScrollbarAuto);
    214211    setScrollbarsSuppressed(false);
    215212}
     
    285282}
    286283
    287 void FrameView::initScrollbars()
    288 {
    289     if (!m_needToInitScrollbars)
    290         return;
    291     m_needToInitScrollbars = false;
    292     updateDefaultScrollbarState();
    293 }
    294 
    295 void FrameView::updateDefaultScrollbarState()
    296 {
    297     m_hmode = horizontalScrollbarMode();
    298     m_vmode = verticalScrollbarMode();
    299     setScrollbarModes(m_hmode, m_vmode);
    300 }
    301 
    302284void FrameView::invalidateRect(const IntRect& rect)
    303285{
     
    331313    // make it update the rendering area when set
    332314    m_margins.setHeight(h);
    333 }
    334 
    335 void FrameView::setCanHaveScrollbars(bool canScroll)
    336 {
    337     ScrollView::setCanHaveScrollbars(canScroll);
    338     scrollbarModes(m_hmode, m_vmode);
    339315}
    340316
     
    578554    m_nestedLayoutCount++;
    579555
    580     ScrollbarMode hMode = m_hmode;
    581     ScrollbarMode vMode = m_vmode;
     556    ScrollbarMode hMode;
     557    ScrollbarMode vMode;
     558    scrollbarModes(hMode, vMode);
    582559
    583560    if (!subtree) {
  • trunk/WebCore/page/FrameView.h

    r47835 r48064  
    7070    void setMarginHeight(int);
    7171
    72     virtual void setCanHaveScrollbars(bool);
    73 
    7472    virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarOrientation);
    7573
     
    123121
    124122    void adjustViewSize();
    125     void initScrollbars();
    126     void updateDefaultScrollbarState();
    127123   
    128124    virtual IntRect windowClipRect(bool clipToContents = true) const;
     
    252248    bool m_doFullRepaint;
    253249   
    254     ScrollbarMode m_vmode;
    255     ScrollbarMode m_hmode;
    256250    bool m_useSlowRepaints;
    257251    bool m_isOverlapped;
     
    273267
    274268    bool m_firstLayout;
    275     bool m_needToInitScrollbars;
    276269    bool m_isTransparent;
    277270    Color m_baseBackgroundColor;
  • trunk/WebCore/platform/ScrollView.cpp

    r47909 r48064  
    330330        return;
    331331
     332    // If we came in here with the view already needing a layout, then go ahead and do that
     333    // first.  (This will be the common case, e.g., when the page changes due to window resizing for example).
     334    // This layout will not re-enter updateScrollbars and does not count towards our max layout pass total.
     335    if (!m_scrollbarsSuppressed) {
     336        m_inUpdateScrollbars = true;
     337        visibleContentsResized();
     338        m_inUpdateScrollbars = false;
     339    }
     340
    332341    bool hasHorizontalScrollbar = m_horizontalScrollbar;
    333342    bool hasVerticalScrollbar = m_verticalScrollbar;
     
    350359            setHasVerticalScrollbar(newHasVerticalScrollbar);
    351360    } else {
    352         // If we came in here with the view already needing a layout, then go ahead and do that
    353         // first.  (This will be the common case, e.g., when the page changes due to window resizing for example).
    354         // This layout will not re-enter updateScrollers and does not count towards our max layout pass total.
    355         m_inUpdateScrollbars = true;
    356         visibleContentsResized();
    357         m_inUpdateScrollbars = false;
    358 
    359361        bool sendContentResizedNotification = false;
    360362       
  • trunk/WebCore/platform/ScrollView.h

    r47531 r48064  
    9090    ScrollbarMode horizontalScrollbarMode() const { ScrollbarMode horizontal, vertical; scrollbarModes(horizontal, vertical); return horizontal; }
    9191    ScrollbarMode verticalScrollbarMode() const { ScrollbarMode horizontal, vertical; scrollbarModes(horizontal, vertical); return vertical; }
    92     virtual void setCanHaveScrollbars(bool flag);
     92    void setCanHaveScrollbars(bool flag);
    9393    bool canHaveScrollbars() const { return horizontalScrollbarMode() != ScrollbarAlwaysOff || verticalScrollbarMode() != ScrollbarAlwaysOff; }
    9494
  • trunk/WebKit/mac/ChangeLog

    r48057 r48064  
     12009-09-04  Mark Mentovai  <mark@chromium.org>
     2
     3        Reviewed by Dave Hyatt.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=28614
     6
     7        Account for scrollbar state changes that occur during layout.
     8
     9        * WebView/WebDynamicScrollBarsView.mm:
     10        (-[WebDynamicScrollBarsView updateScrollers]):
     11
     12        Perform a layout prior to checking whether the scrollbar modes are
     13        off, on, or automatic.  The modes may change during layout.
     14
     15        * WebView/WebFrameView.mm:
     16        (-[WebFrameView _install]):
     17
     18        Eliminate duplicated (and incorrect) scrollbar mode tracking between
     19        FrameView and ScrollView.
     20
    1212009-09-03  Dave Hyatt  <hyatt@apple.com>
    222
  • trunk/WebKit/mac/WebView/WebDynamicScrollBarsView.mm

    r47909 r48064  
    9090- (void)updateScrollers
    9191{
     92    NSView *documentView = [self documentView];
     93
     94    // If we came in here with the view already needing a layout, then go ahead and do that
     95    // first.  (This will be the common case, e.g., when the page changes due to window resizing for example).
     96    // This layout will not re-enter updateScrollers and does not count towards our max layout pass total.
     97    if (!suppressLayout && !suppressScrollers && [documentView isKindOfClass:[WebHTMLView class]]) {
     98        WebHTMLView* htmlView = (WebHTMLView*)documentView;
     99        if ([htmlView _needsLayout]) {
     100            inUpdateScrollers = YES;
     101            [(id <WebDocumentView>)documentView layout];
     102            inUpdateScrollers = NO;
     103        }
     104    }
     105
     106    BOOL hasHorizontalScroller = [self hasHorizontalScroller];
    92107    BOOL hasVerticalScroller = [self hasVerticalScroller];
    93     BOOL hasHorizontalScroller = [self hasHorizontalScroller];
    94108   
    95109    BOOL newHasHorizontalScroller = hasHorizontalScroller;
    96110    BOOL newHasVerticalScroller = hasVerticalScroller;
    97111   
    98     BOOL needsLayout = NO;
    99 
    100     NSView *documentView = [self documentView];
    101112    if (!documentView) {
    102113        newHasHorizontalScroller = NO;
     
    123134    }
    124135
    125     needsLayout = NO;
    126 
    127     // If we came in here with the view already needing a layout, then go ahead and do that
    128     // first.  (This will be the common case, e.g., when the page changes due to window resizing for example).
    129     // This layout will not re-enter updateScrollers and does not count towards our max layout pass total.
    130     if ([documentView isKindOfClass:[WebHTMLView class]]) {
    131         WebHTMLView* htmlView = (WebHTMLView*)documentView;
    132         if ([htmlView _needsLayout]) {
    133             inUpdateScrollers = YES;
    134             [(id <WebDocumentView>)documentView layout];
    135             inUpdateScrollers = NO;
    136         }
    137     }
     136    BOOL needsLayout = NO;
    138137
    139138    NSSize documentSize = [documentView frame].size;
  • trunk/WebKit/mac/WebView/WebFrameView.mm

    r45386 r48064  
    274274        // Now the render part owns the view, so we don't any more.
    275275    }
    276 
    277     view->initScrollbars();
    278276}
    279277
  • trunk/WebKit/qt/Api/qwebframe.cpp

    r47963 r48064  
    802802        if (d->frame->view()) {
    803803            d->frame->view()->setHorizontalScrollbarMode((ScrollbarMode)policy);
    804             d->frame->view()->updateDefaultScrollbarState();
    805804        }
    806805    } else {
     
    808807        if (d->frame->view()) {
    809808            d->frame->view()->setVerticalScrollbarMode((ScrollbarMode)policy);
    810             d->frame->view()->updateDefaultScrollbarState();
    811809        }
    812810    }
  • trunk/WebKit/qt/ChangeLog

    r48041 r48064  
     12009-09-04  Mark Mentovai  <mark@chromium.org>
     2
     3        Reviewed by Dave Hyatt.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=28614
     6
     7        Account for scrollbar state changes that occur during layout.
     8
     9        * Api/qwebframe.cpp:
     10        (QWebFrame::setScrollBarPolicy):
     11
     12        Eliminate duplicated (and incorrect) scrollbar mode tracking between
     13        FrameView and ScrollView.
     14
    1152009-09-04  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
    216
Note: See TracChangeset for help on using the changeset viewer.