Changeset 90478 in webkit


Ignore:
Timestamp:
Jul 6, 2011 12:04:47 PM (13 years ago)
Author:
ryuan.choi@samsung.com
Message:

2011-07-06 Ryuan Choi <ryuan.choi@samsung.com>

[Performance] Only call sendContentResizeNotification when the scrollbar actually did change
https://bugs.webkit.org/show_bug.cgi?id=47320

Reviewed by Eric Seidel.

Move avoidScrollbarCreation checking code from setHasHorizontalScrollbar
and setHasVerticalScrollbar to their caller in order to keep sendContentResizedNotification
false in case scrollbar is not really changed.
As a result, it will remove unnecessary relayout in the above case.

No new tests as this is very hard to write tests for. The bug only
occured when scrolling the sites which contain frame in browser with
frameFlattening. This should not change functionality in other case.

  • platform/ScrollView.cpp: (WebCore::ScrollView::setHasHorizontalScrollbar): (WebCore::ScrollView::setHasVerticalScrollbar): (WebCore::ScrollView::updateScrollbars):
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r90471 r90478  
     12011-07-06  Ryuan Choi  <ryuan.choi@samsung.com>
     2
     3        [Performance] Only call sendContentResizeNotification when the scrollbar actually did change
     4        https://bugs.webkit.org/show_bug.cgi?id=47320
     5
     6        Reviewed by Eric Seidel.
     7
     8        Move avoidScrollbarCreation checking code from setHasHorizontalScrollbar
     9        and setHasVerticalScrollbar to their caller in order to keep sendContentResizedNotification
     10        false in case scrollbar is not really changed.
     11        As a result, it will remove unnecessary relayout in the above case.
     12
     13        No new tests as this is very hard to write tests for. The bug only
     14        occured when scrolling the sites which contain frame in browser with
     15        frameFlattening. This should not change functionality in other case.
     16
     17        * platform/ScrollView.cpp:
     18        (WebCore::ScrollView::setHasHorizontalScrollbar):
     19        (WebCore::ScrollView::setHasVerticalScrollbar):
     20        (WebCore::ScrollView::updateScrollbars):
     21
    1222011-07-06  Nate Chapin  <japhet@chromium.org>
    223
  • trunk/Source/WebCore/platform/ScrollView.cpp

    r88877 r90478  
    8989void ScrollView::setHasHorizontalScrollbar(bool hasBar)
    9090{
    91     if (hasBar && avoidScrollbarCreation())
    92         return;
    93 
     91    ASSERT(!hasBar || !avoidScrollbarCreation());
    9492    if (hasBar && !m_horizontalScrollbar) {
    9593        m_horizontalScrollbar = createScrollbar(HorizontalScrollbar);
     
    109107void ScrollView::setHasVerticalScrollbar(bool hasBar)
    110108{
    111     if (hasBar && avoidScrollbarCreation())
    112         return;
    113 
     109    ASSERT(!hasBar || !avoidScrollbarCreation());
    114110    if (hasBar && !m_verticalScrollbar) {
    115111        m_verticalScrollbar = createScrollbar(VerticalScrollbar);
     
    473469
    474470    if (m_scrollbarsSuppressed || (hScroll != ScrollbarAuto && vScroll != ScrollbarAuto)) {
    475         if (hasHorizontalScrollbar != newHasHorizontalScrollbar)
     471        if (hasHorizontalScrollbar != newHasHorizontalScrollbar && (hasHorizontalScrollbar || !avoidScrollbarCreation()))
    476472            setHasHorizontalScrollbar(newHasHorizontalScrollbar);
    477         if (hasVerticalScrollbar != newHasVerticalScrollbar)
     473        if (hasVerticalScrollbar != newHasVerticalScrollbar && (hasVerticalScrollbar || !avoidScrollbarCreation()))
    478474            setHasVerticalScrollbar(newHasVerticalScrollbar);
    479475    } else {
     
    501497            newHasHorizontalScrollbar = false;
    502498
    503         if (hasHorizontalScrollbar != newHasHorizontalScrollbar) {
     499        if (hasHorizontalScrollbar != newHasHorizontalScrollbar && (hasHorizontalScrollbar || !avoidScrollbarCreation())) {
    504500            if (m_scrollOrigin.y() && !newHasHorizontalScrollbar)
    505501                m_scrollOrigin.setY(m_scrollOrigin.y() - m_horizontalScrollbar->height());
     
    508504        }
    509505
    510         if (hasVerticalScrollbar != newHasVerticalScrollbar) {
     506        if (hasVerticalScrollbar != newHasVerticalScrollbar && (hasVerticalScrollbar || !avoidScrollbarCreation())) {
    511507            if (m_scrollOrigin.x() && !newHasVerticalScrollbar)
    512508                m_scrollOrigin.setX(m_scrollOrigin.x() - m_verticalScrollbar->width());
Note: See TracChangeset for help on using the changeset viewer.