[Webkit-unassigned] [Bug 33150] Do not render the full frame when there is some elements with fixed positioning

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jan 24 03:25:23 PST 2010


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





--- Comment #49 from Simon Hausmann <hausmann at webkit.org>  2010-01-24 03:25:19 PST ---
(From update of attachment 47283)

> +void FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
> +{
> +    const size_t fixedObjectNumberThreshold = 5;
> +
> +    if (m_fixedPositionedObjects.isEmpty())
> +        hostWindow()->scroll(scrollDelta, rectToScroll, clipRect);
> +    else {
> +        Vector<RenderObject*, fixedObjectNumberThreshold> fixedObjectsInViewport;
> +
> +        bool updateInvalidatedSubRect = true;
> +        // Get a list of fixed objects that are not in transformations
> +        HashSet<RenderObject*>::const_iterator end = m_fixedPositionedObjects.end();
> +        HashSet<RenderObject*>::const_iterator it = m_fixedPositionedObjects.begin();
> +        for (; it != end; ++it) {
> +            RenderObject* obj = *it;
> +            // make sure the parent layer has not been transformed
> +            if (obj->containingBlock() == obj->view()) {
> +                fixedObjectsInViewport.append(obj);
> +                if (fixedObjectsInViewport.size() > fixedObjectNumberThreshold) {

After my suggestion there is now one little problem with the above code:

append() will be called for the 6th render object, and then the vector will be
re-allocated on the heap. Right afterwards we find out that we crossed the
threshold.

I suggest to either allocate the vector with fixedObjectNumberThreshold + 1 or
check  size against capacity later on.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list