Merge branch 'hint_inputs' of https://github.com/Liambeguin/qutebrowser into Liambeguin-hint_inputs

This commit is contained in:
Florian Bruhin 2016-05-18 07:30:46 +02:00
commit 324fcfadb0
2 changed files with 13 additions and 2 deletions

View File

@ -38,7 +38,7 @@ from qutebrowser.utils import log, usertypes, utils
Group = usertypes.enum('Group', ['all', 'links', 'images', 'url', 'prevnext',
'focus'])
'focus', 'inputs'])
SELECTORS = {
@ -50,6 +50,9 @@ SELECTORS = {
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], textarea'),
}

View File

@ -128,11 +128,19 @@ class SelectionAndFilterTests:
('<link href="javascript://foo" />', [webelem.Group.all,
webelem.Group.url]),
('<textarea />', [webelem.Group.all]),
('<textarea />', [webelem.Group.all, webelem.Group.inputs]),
('<select />', [webelem.Group.all]),
('<input />', [webelem.Group.all]),
('<input type="hidden" />', []),
('<input type="text" />', [webelem.Group.inputs, webelem.Group.all]),
('<input type="email" />', [webelem.Group.inputs, webelem.Group.all]),
('<input type="url" />', [webelem.Group.inputs, webelem.Group.all]),
('<input type="tel" />', [webelem.Group.inputs, webelem.Group.all]),
('<input type="number" />', [webelem.Group.inputs, webelem.Group.all]),
('<input type="password" />', [webelem.Group.inputs,
webelem.Group.all]),
('<input type="search" />', [webelem.Group.inputs, webelem.Group.all]),
('<button />', [webelem.Group.all]),
('<button href="foo" />', [webelem.Group.all, webelem.Group.prevnext,