Don't access caretElement if it's gone
This commit is contained in:
parent
8c0366f0a7
commit
45eece372f
@ -1271,14 +1271,18 @@ window._qutebrowser.caret = (function() {
|
||||
};
|
||||
|
||||
CaretBrowsing.startAnimation = function() {
|
||||
CaretBrowsing.caretElement.style.animationIterationCount = "infinite";
|
||||
if (CaretBrowsing.caretElement) {
|
||||
CaretBrowsing.caretElement.style.animationIterationCount = "infinite";
|
||||
}
|
||||
};
|
||||
|
||||
CaretBrowsing.stopAnimation = function() {
|
||||
CaretBrowsing.caretElement.style.animationIterationCount = 0;
|
||||
window.setTimeout(() => {
|
||||
CaretBrowsing.startAnimation();
|
||||
}, 1000);
|
||||
if (CaretBrowsing.caretElement) {
|
||||
CaretBrowsing.caretElement.style.animationIterationCount = 0;
|
||||
window.setTimeout(() => {
|
||||
CaretBrowsing.startAnimation();
|
||||
}, 1000);
|
||||
}
|
||||
};
|
||||
|
||||
CaretBrowsing.init = function() {
|
||||
|
@ -156,11 +156,12 @@ def greasemonkey_manager(data_tmpdir):
|
||||
def webkit_tab(qtbot, tab_registry, cookiejar_and_cache, mode_manager,
|
||||
session_manager_stub, greasemonkey_manager, fake_args,
|
||||
host_blocker_stub, config_stub):
|
||||
# Make sure error logging via JS fails tests
|
||||
config_stub.val.content.javascript.log = {
|
||||
'info': 'info',
|
||||
'error': 'info',
|
||||
'unknown': 'info',
|
||||
'warning': 'info'
|
||||
'error': 'error',
|
||||
'unknown': 'error',
|
||||
'warning': 'error',
|
||||
}
|
||||
|
||||
webkittab = pytest.importorskip('qutebrowser.browser.webkit.webkittab')
|
||||
@ -185,12 +186,13 @@ def webkit_tab(qtbot, tab_registry, cookiejar_and_cache, mode_manager,
|
||||
def webengine_tab(qtbot, tab_registry, fake_args, mode_manager,
|
||||
session_manager_stub, greasemonkey_manager,
|
||||
redirect_webengine_data, tabbed_browser_stubs,
|
||||
config_stub):
|
||||
config_stub, qapp):
|
||||
# Make sure error logging via JS fails tests
|
||||
config_stub.val.content.javascript.log = {
|
||||
'info': 'info',
|
||||
'error': 'info',
|
||||
'unknown': 'info',
|
||||
'warning': 'info'
|
||||
'error': 'error',
|
||||
'unknown': 'error',
|
||||
'warning': 'error',
|
||||
}
|
||||
|
||||
tabwidget = tabbed_browser_stubs[0].widget
|
||||
|
Loading…
Reference in New Issue
Block a user