diff options
author | Florian Bruhin <git@the-compiler.org> | 2017-05-12 09:13:19 +0200 |
---|---|---|
committer | Florian Bruhin <git@the-compiler.org> | 2017-05-12 09:41:12 +0200 |
commit | 203a5dff746917d0dc5d1366eb2fd9e408700483 (patch) | |
tree | ee96cd6f7beb821365509fd9bfb8495c681368fd /tests/unit/browser/webkit/test_webkitelem.py | |
parent | d50a08d159deff04791e4736343b4d42e5e0d4e2 (diff) | |
download | qutebrowser-203a5dff746917d0dc5d1366eb2fd9e408700483.tar.gz qutebrowser-203a5dff746917d0dc5d1366eb2fd9e408700483.zip |
Get rid of webelem.FILTERS
There's actually no good reason to filter javascript links as we might want to
click them (or copy their URL) just like any other link - this fixes #2404.
With that being gone, we don't need FILTERS at all anymore, as we can check for
existence of the href attribute in the CSS selector instead.
Diffstat (limited to 'tests/unit/browser/webkit/test_webkitelem.py')
-rw-r--r-- | tests/unit/browser/webkit/test_webkitelem.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/tests/unit/browser/webkit/test_webkitelem.py b/tests/unit/browser/webkit/test_webkitelem.py index 6258508ff..4915c1fba 100644 --- a/tests/unit/browser/webkit/test_webkitelem.py +++ b/tests/unit/browser/webkit/test_webkitelem.py @@ -149,19 +149,17 @@ class SelectionAndFilterTests: ('<a href="foo" />', [webelem.Group.all, webelem.Group.links, webelem.Group.prevnext, webelem.Group.url]), ('<a href="javascript://foo" />', [webelem.Group.all, + webelem.Group.links, + webelem.Group.prevnext, webelem.Group.url]), ('<area />', [webelem.Group.all]), ('<area href="foo" />', [webelem.Group.all, webelem.Group.links, webelem.Group.prevnext, webelem.Group.url]), - ('<area href="javascript://foo" />', [webelem.Group.all, - webelem.Group.url]), ('<link />', [webelem.Group.all]), ('<link href="foo" />', [webelem.Group.all, webelem.Group.links, webelem.Group.prevnext, webelem.Group.url]), - ('<link href="javascript://foo" />', [webelem.Group.all, - webelem.Group.url]), ('<textarea />', [webelem.Group.all, webelem.Group.inputs]), ('<select />', [webelem.Group.all]), @@ -180,8 +178,6 @@ class SelectionAndFilterTests: ('<button />', [webelem.Group.all]), ('<button href="foo" />', [webelem.Group.all, webelem.Group.prevnext, webelem.Group.url]), - ('<button href="javascript://foo" />', [webelem.Group.all, - webelem.Group.url]), # We can't easily test <frame>/<iframe> as they vanish when setting # them via QWebFrame::setHtml... @@ -224,8 +220,6 @@ class TestSelectorsAndFilters: assert len(webframe.findAllElements('*')) == 3 elems = webframe.findAllElements(webelem.SELECTORS[group]) elems = [webkitelem.WebKitElement(e, tab=None) for e in elems] - filterfunc = webelem.FILTERS.get(group, lambda e: True) - elems = [e for e in elems if filterfunc(e)] assert bool(elems) == matching |