⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 125733 in webkit


Ignore:
Timestamp:
Aug 15, 2012, 6:27:41 PM (14 years ago)
Author:
tkent@chromium.org
Message:

Merge 123637 - https://bugs.webkit.org/show_bug.cgi?id=89114
REGRESSION (r112919): Setting scrollTop after setting display from none to block
fails
-and corresponding-
<rdar://problem/11656050>

Reviewed by Simon Fraser.

Source/WebCore:

ScrollAnimatorMac::immediateScrollTo() and ScrollAnimatorMac::immediateScrollBy()
both have an optimization in place so that they do not call
notifyPositionChanged() if the new scroll offset matches the ScrollAnimator's
cached m_currentPosX and m_currentPosY. So revision 112919 caused troubled with
this optimization because it allowed RenderLayers to restore a scrollOffset from
the Element if there is one cached there. This caused the RenderLayer to have a
scrollOffset that is improperly out-of-synch with the ScrollAnimator's
currentPosition (which will just be 0,0 since it is being re-created like the
RenderLayer). This fix makes sure they are in synch by calling
setCurrentPosition() on the ScrollAnimator when the cached position is non-zero.

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::RenderLayer):

LayoutTests:

  • fast/overflow/setting-scrollTop-after-hide-show-expected.txt: Added.
  • fast/overflow/setting-scrollTop-after-hide-show.html: Added.

TBR=karen@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10823356

Location:
branches/chromium/1180
Files:
1 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/chromium/1180/Source/WebCore/rendering/RenderLayer.cpp

    r123234 r125733  
    8787#include "RenderView.h"
    8888#include "ScaleTransformOperation.h"
     89#include "ScrollAnimator.h"
    8990#include "Scrollbar.h"
    9091#include "ScrollbarTheme.h"
     
    191192        Element* element = toElement(node);
    192193        m_scrollOffset = element->savedLayerScrollOffset();
     194        if (!m_scrollOffset.isZero())
     195            scrollAnimator()->setCurrentPosition(FloatPoint(m_scrollOffset.width(), m_scrollOffset.height()));
    193196        element->setSavedLayerScrollOffset(IntSize());
    194197    }
Note: See TracChangeset for help on using the changeset viewer.