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

Commit 7c3006f5 authored by Leon Clarke's avatar Leon Clarke
Browse files
When receiving a message to delete the root layer, delay it until the next
new picture message, so that the layers only disappear when we start displaying
the new page, and not the moment the DOM on the old page is destroyed.
parent 0ca25191
Loading
Loading
Loading
Loading
+20 −2
Original line number Diff line number Diff line
@@ -410,6 +410,10 @@ public class WebView extends AbsoluteLayout
    // true if onPause has been called (and not onResume)
    private boolean mIsPaused;

    // true if, during a transition to a new page, we're delaying
    // deleting a root layer until there's something to draw of the new page.
    private boolean mDelayedDeleteRootLayer;

    /**
     * Customizable constant
     */
@@ -6241,6 +6245,12 @@ public class WebView extends AbsoluteLayout
                    break;
                }
                case NEW_PICTURE_MSG_ID: {
                    // If we've previously delayed deleting a root
                    // layer, do it now.
                    if (mDelayedDeleteRootLayer) {
                        mDelayedDeleteRootLayer = false;
                        nativeSetRootLayer(0);
                    }
                    WebSettings settings = mWebViewCore.getSettings();
                    // called for new content
                    final int viewWidth = getViewWidth();
@@ -6425,8 +6435,16 @@ public class WebView extends AbsoluteLayout
                    break;
                }
                case SET_ROOT_LAYER_MSG_ID: {
                    if (0 == msg.arg1) {
                        // Null indicates deleting the old layer, but
                        // don't actually do so until we've got the
                        // new page to display.
                        mDelayedDeleteRootLayer = true;
                    } else {
                        mDelayedDeleteRootLayer = false;
                        nativeSetRootLayer(msg.arg1);
                        invalidate();
                    }
                    break;
                }
                case REQUEST_FORM_DATA: