Revert "Merge "Reload page when A11y is on and the JavaScript state changes." into jb-mr1-dev"
This reverts commit6d00c72433, reversing changes made to41bfb75f7c.
This commit is contained in:
@@ -279,7 +279,6 @@ class AccessibilityInjector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!shouldInjectJavaScript(url)) {
|
if (!shouldInjectJavaScript(url)) {
|
||||||
mAccessibilityScriptInjected = false;
|
|
||||||
toggleFallbackAccessibilityInjector(true);
|
toggleFallbackAccessibilityInjector(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -292,23 +291,6 @@ class AccessibilityInjector {
|
|||||||
mAccessibilityScriptInjected = true;
|
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.
|
* Toggles the non-JavaScript method for handling accessibility.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1135,7 +1135,6 @@ public class WebSettingsClassic extends WebSettings {
|
|||||||
if (mJavaScriptEnabled != flag) {
|
if (mJavaScriptEnabled != flag) {
|
||||||
mJavaScriptEnabled = flag;
|
mJavaScriptEnabled = flag;
|
||||||
postSync();
|
postSync();
|
||||||
mWebView.updateJavaScriptEnabled(flag);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1626,12 +1626,6 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
|
|||||||
mZoomManager.updateMultiTouchSupport(context);
|
mZoomManager.updateMultiTouchSupport(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateJavaScriptEnabled(boolean enabled) {
|
|
||||||
if (isAccessibilityEnabled()) {
|
|
||||||
getAccessibilityInjector().updateJavaScriptEnabled(enabled);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void init() {
|
private void init() {
|
||||||
OnTrimMemoryListener.init(mContext);
|
OnTrimMemoryListener.init(mContext);
|
||||||
mWebView.setWillNotDraw(false);
|
mWebView.setWillNotDraw(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user