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

Commit 35b88a86 authored by Michael Jurka's avatar Michael Jurka Committed by Android Git Automerger
Browse files

am 524c878e: Revert "Merge "Reload page when A11y is on and the JavaScript...

am 524c878e: Revert "Merge "Reload page when A11y is on and the JavaScript state changes." into jb-mr1-dev"

* commit '524c878e':
  Revert "Merge "Reload page when A11y is on and the JavaScript state changes." into jb-mr1-dev"
parents 5de31846 524c878e
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -279,7 +279,6 @@ class AccessibilityInjector {
        }

        if (!shouldInjectJavaScript(url)) {
            mAccessibilityScriptInjected = false;
            toggleFallbackAccessibilityInjector(true);
            return;
        }
@@ -292,23 +291,6 @@ class AccessibilityInjector {
        mAccessibilityScriptInjected = true;
    }

    /**
     * Adjusts the accessibility injection state to reflect changes in the
     * JavaScript enabled state.
     *
     * @param enabled Whether JavaScript is enabled.
     */
    public void updateJavaScriptEnabled(boolean enabled) {
        if (enabled) {
            addAccessibilityApisIfNecessary();
        } else {
            removeAccessibilityApisIfNecessary();
        }

        // We have to reload the page after adding or removing APIs.
        mWebView.reload();
    }

    /**
     * Toggles the non-JavaScript method for handling accessibility.
     *
+0 −1
Original line number Diff line number Diff line
@@ -1135,7 +1135,6 @@ public class WebSettingsClassic extends WebSettings {
        if (mJavaScriptEnabled != flag) {
            mJavaScriptEnabled = flag;
            postSync();
            mWebView.updateJavaScriptEnabled(flag);
        }
    }

+0 −6
Original line number Diff line number Diff line
@@ -1626,12 +1626,6 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
        mZoomManager.updateMultiTouchSupport(context);
    }

    void updateJavaScriptEnabled(boolean enabled) {
        if (isAccessibilityEnabled()) {
            getAccessibilityInjector().updateJavaScriptEnabled(enabled);
        }
    }

    private void init() {
        OnTrimMemoryListener.init(mContext);
        mWebView.setWillNotDraw(false);