Get rid of prevnext_rel selector group
This commit is contained in:
parent
be460afc1c
commit
1f3b39eb75
@ -368,12 +368,12 @@ class HintManager(QObject):
|
|||||||
"""Find a prev/next element in frame."""
|
"""Find a prev/next element in frame."""
|
||||||
# First check for <link rel="prev(ious)|next">
|
# First check for <link rel="prev(ious)|next">
|
||||||
elems = frame.findAllElements(
|
elems = frame.findAllElements(
|
||||||
webelem.SELECTORS[webelem.Group.prevnext_rel])
|
webelem.SELECTORS[webelem.Group.links])
|
||||||
rel_values = ('prev', 'previous') if prev else ('next')
|
rel_values = ('prev', 'previous') if prev else ('next')
|
||||||
for e in elems:
|
for e in elems:
|
||||||
if e.attribute('rel') in rel_values:
|
if e.attribute('rel') in rel_values:
|
||||||
return e
|
return e
|
||||||
# Then check for regular links
|
# Then check for regular links/buttons.
|
||||||
elems = frame.findAllElements(
|
elems = frame.findAllElements(
|
||||||
webelem.SELECTORS[webelem.Group.prevnext])
|
webelem.SELECTORS[webelem.Group.prevnext])
|
||||||
option = 'prev-regexes' if prev else 'next-regexes'
|
option = 'prev-regexes' if prev else 'next-regexes'
|
||||||
|
@ -36,18 +36,16 @@ from qutebrowser.utils.usertypes import enum
|
|||||||
from qutebrowser.utils.misc import compact_text
|
from qutebrowser.utils.misc import compact_text
|
||||||
|
|
||||||
|
|
||||||
Group = enum('all', 'links', 'images', 'editable', 'url', 'prevnext_rel',
|
Group = enum('all', 'links', 'images', 'editable', 'url', 'prevnext', 'focus')
|
||||||
'prevnext', 'focus')
|
|
||||||
|
|
||||||
|
|
||||||
SELECTORS = {
|
SELECTORS = {
|
||||||
Group.all: ('a, area, textarea, select, input:not([type=hidden]), button, '
|
Group.all: ('a, area, textarea, select, input:not([type=hidden]), button, '
|
||||||
'frame, iframe, [onclick], [onmousedown], [role=link], '
|
'frame, iframe, [onclick], [onmousedown], [role=link], '
|
||||||
'[role=option], [role=button], img'),
|
'[role=option], [role=button], img'),
|
||||||
Group.links: 'a, area, link',
|
Group.links: 'a, area, link, [role=link]',
|
||||||
Group.images: 'img',
|
Group.images: 'img',
|
||||||
Group.url: '[src], [href]',
|
Group.url: '[src], [href]',
|
||||||
Group.prevnext_rel: 'a, area, link, [role=link]',
|
|
||||||
Group.prevnext: 'a, area, button, [role=button]',
|
Group.prevnext: 'a, area, button, [role=button]',
|
||||||
Group.focus: '*:focus',
|
Group.focus: '*:focus',
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user