parent
27330bd4d1
commit
0b16a36120
@ -36,7 +36,7 @@ from qutebrowser.utils import log, usertypes, utils, qtutils
|
||||
|
||||
|
||||
Group = usertypes.enum('Group', ['all', 'links', 'images', 'url', 'prevnext',
|
||||
'focus', 'inputs'])
|
||||
'inputs'])
|
||||
|
||||
|
||||
SELECTORS = {
|
||||
@ -47,7 +47,6 @@ SELECTORS = {
|
||||
Group.images: 'img',
|
||||
Group.url: '[src], [href]',
|
||||
Group.prevnext: 'a, area, button, link, [role=button]',
|
||||
Group.focus: '*:focus',
|
||||
Group.inputs: ('input[type=text], input[type=email], input[type=url], '
|
||||
'input[type=tel], input[type=number], '
|
||||
'input[type=password], input[type=search], '
|
||||
|
@ -353,5 +353,5 @@ def focus_elem(frame):
|
||||
Args:
|
||||
frame: The QWebFrame to search in.
|
||||
"""
|
||||
elem = frame.findFirstElement(webelem.SELECTORS[webelem.Group.focus])
|
||||
elem = frame.findFirstElement('*:focus')
|
||||
return WebKitElement(elem)
|
||||
|
@ -325,7 +325,7 @@ class WebView(QWebView):
|
||||
return
|
||||
frame = self.page().currentFrame()
|
||||
try:
|
||||
elem = webkitelem.WebKitElement(frame.findFirstElement(':focus'))
|
||||
elem = webkitelem.focus_elem(frame)
|
||||
except webkitelem.IsNullError:
|
||||
log.webview.debug("Focused element is null!")
|
||||
return
|
||||
|
@ -188,7 +188,7 @@ class SelectionAndFilterTests:
|
||||
webelem.Group.url]),
|
||||
]
|
||||
|
||||
GROUPS = [e for e in webelem.Group if e != webelem.Group.focus]
|
||||
GROUPS = list(webelem.Group)
|
||||
|
||||
COMBINATIONS = list(itertools.product(TESTS, GROUPS))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user