Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c566185c authored by Shimeng (Simon) Wang's avatar Shimeng (Simon) Wang
Browse files

Don't send scroll events in case of new picture from webkit.

When user goes back to a page, the new picture may potentially cause
a scroll event which overrides the history scroll position, since
the scroll position may be bigger than the initial new picture.

Setting the scroll event to be not-user-scrolled will preserve the
history scroll position.

issue: 3433562
Change-Id: Ida176a4bc3a22de0385aed71e11f8b8e0db06f24
parent a81c2193
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -7213,8 +7213,13 @@ public class WebView extends AbsoluteLayout
                    // received in the fixed dimension.
                    final boolean updateLayout = viewSize.x == mLastWidthSent
                            && viewSize.y == mLastHeightSent;
                    // Don't send scroll event for picture coming from webkit,
                    // since the new picture may cause a scroll event to override
                    // the saved history scroll position.
                    mSendScrollEvent = false;
                    recordNewContentSize(draw.mContentSize.x,
                            draw.mContentSize.y, updateLayout);
                    mSendScrollEvent = true;
                    if (DebugFlags.WEB_VIEW) {
                        Rect b = draw.mInvalRegion.getBounds();
                        Log.v(LOGTAG, "NEW_PICTURE_MSG_ID {" +