Changeset 15722 in webkit


Ignore:
Timestamp:
Jul 31, 2006 7:25:43 PM (18 years ago)
Author:
hyatt
Message:

Fix for bug 10179, digg.com scrolls slowly. Improve fixed positioning
and fixed backgrounds so that a count of them is kept on the FrameView.
This allows us to switch slow scrolling on and off as these objects come
and go.

  • css/cssstyleselector.cpp: (WebCore::CSSStyleSelector::adjustRenderStyle): (WebCore::CSSStyleSelector::applyProperty):
  • page/FrameView.cpp: (WebCore::FrameViewPrivate::reset): (WebCore::FrameView::layout): (WebCore::FrameView::useSlowRepaints): (WebCore::FrameView::setUseSlowRepaints): (WebCore::FrameView::addSlowRepaintObject): (WebCore::FrameView::removeSlowRepaintObject):
  • page/FrameView.h:
  • rendering/RenderBox.cpp: (WebCore::RenderBox::paintBackgroundExtended):
  • rendering/RenderObject.cpp: (WebCore::RenderObject::setStyle):
  • rendering/RenderView.cpp: (WebCore::RenderView::paintBoxDecorations):
Location:
trunk/WebCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r15721 r15722  
     12006-07-31  David Hyatt  <hyatt@apple.com>
     2
     3        Fix for bug 10179, digg.com scrolls slowly.  Improve fixed positioning
     4        and fixed backgrounds so that a count of them is kept on the FrameView.
     5        This allows us to switch slow scrolling on and off as these objects come
     6        and go.
     7
     8        * css/cssstyleselector.cpp:
     9        (WebCore::CSSStyleSelector::adjustRenderStyle):
     10        (WebCore::CSSStyleSelector::applyProperty):
     11        * page/FrameView.cpp:
     12        (WebCore::FrameViewPrivate::reset):
     13        (WebCore::FrameView::layout):
     14        (WebCore::FrameView::useSlowRepaints):
     15        (WebCore::FrameView::setUseSlowRepaints):
     16        (WebCore::FrameView::addSlowRepaintObject):
     17        (WebCore::FrameView::removeSlowRepaintObject):
     18        * page/FrameView.h:
     19        * rendering/RenderBox.cpp:
     20        (WebCore::RenderBox::paintBackgroundExtended):
     21        * rendering/RenderObject.cpp:
     22        (WebCore::RenderObject::setStyle):
     23        * rendering/RenderView.cpp:
     24        (WebCore::RenderView::paintBoxDecorations):
     25
    1262006-07-31  David Hyatt  <hyatt@apple.com>
    227
  • trunk/WebCore/css/cssstyleselector.cpp

    r15514 r15722  
    10871087            theme()->adjustStyle(this, style, e);
    10881088    }
    1089 
    1090     // Only use slow repaints if we actually have a background image.
    1091     // FIXME: We only need to invalidate the fixed regions when scrolling.  It's total overkill to
    1092     // prevent the entire view from blitting on a scroll.
    1093     if (style->hasFixedBackgroundImage() && view)
    1094         view->useSlowRepaints();
    10951089}
    10961090
     
    22122206        {
    22132207        case CSS_VAL_STATIC:
    2214             p = StaticPosition; break;
     2208            p = StaticPosition;
     2209            break;
    22152210        case CSS_VAL_RELATIVE:
    2216             p = RelativePosition; break;
     2211            p = RelativePosition;
     2212            break;
    22172213        case CSS_VAL_ABSOLUTE:
    2218             p = AbsolutePosition; break;
     2214            p = AbsolutePosition;
     2215            break;
    22192216        case CSS_VAL_FIXED:
    2220             {
    2221                 if (view)
    2222                     view->useSlowRepaints();
    2223                 p = FixedPosition;
    2224                 break;
    2225             }
     2217            p = FixedPosition;
     2218            break;
    22262219        default:
    22272220            return;
  • trunk/WebCore/page/FrameView.cpp

    r15644 r15722  
    9090        linkPressed = false;
    9191        useSlowRepaints = false;
     92        slowRepaintObjectCount = 0;
    9293        dragTarget = 0;
    9394        borderTouched = false;
     
    128129    bool linkPressed;
    129130    bool useSlowRepaints;
     131    unsigned slowRepaintObjectCount;
    130132    bool ignoreWheelEvents;
    131133
     
    513515        return;
    514516    }
    515     setStaticBackground(d->useSlowRepaints);
     517    setStaticBackground(useSlowRepaints());
    516518
    517519    if (document->hasListenerType(Document::OVERFLOWCHANGED_LISTENER))
     
    10201022}
    10211023
    1022 void FrameView::useSlowRepaints()
     1024bool FrameView::useSlowRepaints() const
     1025{
     1026    return d->useSlowRepaints || d->slowRepaintObjectCount > 0;
     1027}
     1028
     1029void FrameView::setUseSlowRepaints()
    10231030{
    10241031    d->useSlowRepaints = true;
    10251032    setStaticBackground(true);
     1033}
     1034
     1035void FrameView::addSlowRepaintObject()
     1036{
     1037    if (d->slowRepaintObjectCount == 0)
     1038        setStaticBackground(true);
     1039    d->slowRepaintObjectCount++;
     1040}
     1041
     1042void FrameView::removeSlowRepaintObject()
     1043{
     1044    d->slowRepaintObjectCount--;
     1045    if (d->slowRepaintObjectCount == 0)
     1046        setStaticBackground(d->useSlowRepaints);
    10261047}
    10271048
  • trunk/WebCore/page/FrameView.h

    r15498 r15722  
    208208    void focusNextPrevNode(bool next);
    209209
    210     void useSlowRepaints();
     210    bool useSlowRepaints() const;
     211    void setUseSlowRepaints();
     212    void addSlowRepaintObject();
     213    void removeSlowRepaintObject();
    211214
    212215    void setIgnoreWheelEvents(bool e);
  • trunk/WebCore/rendering/RenderBox.cpp

    r15666 r15722  
    500500       
    501501        if (isTransparent)
    502             view()->frameView()->useSlowRepaints(); // The parent must show behind the child.
     502            view()->frameView()->setUseSlowRepaints(); // The parent must show behind the child.
    503503        else
    504504            bgColor = Color::white;
  • trunk/WebCore/rendering/RenderObject.cpp

    r15639 r15722  
    21292129    }
    21302130
     2131    if (view()->frameView()) {
     2132        // FIXME: A better solution would be to only invalidate the fixed regions when scrolling.  It's overkill to
     2133        // prevent the entire view from blitting on a scroll.
     2134        bool oldStyleSlowScroll = style && (style->position() == FixedPosition || style->hasFixedBackgroundImage());
     2135        bool newStyleSlowScroll = m_style && (m_style->position() == FixedPosition || m_style->hasFixedBackgroundImage());
     2136        if (oldStyleSlowScroll != newStyleSlowScroll) {
     2137            if (oldStyleSlowScroll)
     2138                view()->frameView()->removeSlowRepaintObject();
     2139            if (newStyleSlowScroll)
     2140                view()->frameView()->addSlowRepaintObject();
     2141        }
     2142    }
     2143
    21312144    RenderStyle *oldStyle = m_style;
    21322145    m_style = style;
  • trunk/WebCore/rendering/RenderView.cpp

    r15581 r15722  
    189189        RenderLayer* layer = elt->renderer()->enclosingLayer();
    190190        if (layer->isTransparent() || layer->transparentAncestor())
    191             frameView()->useSlowRepaints();
     191            frameView()->setUseSlowRepaints();
    192192    }
    193193   
     
    199199    // no background in the child document should show the parent's background.
    200200    if (elt || view()->isTransparent())
    201         frameView()->useSlowRepaints(); // The parent must show behind the child.
     201        frameView()->setUseSlowRepaints(); // The parent must show behind the child.
    202202    else
    203203        i.p->fillRect(i.r, Color(Color::white));
Note: See TracChangeset for help on using the changeset viewer.