From 86669600ff90bc90a1307a8fa4989a5c626ea8b6 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 1 Aug 2016 15:49:50 +0200 Subject: [PATCH] Consider input elements without type for hinting --- qutebrowser/browser/webkit/webelem.py | 3 ++- tests/end2end/data/hints/input.html | 11 +++++++++++ tests/end2end/features/hints.feature | 9 +++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 tests/end2end/data/hints/input.html diff --git a/qutebrowser/browser/webkit/webelem.py b/qutebrowser/browser/webkit/webelem.py index 9b84a7379..d73341178 100644 --- a/qutebrowser/browser/webkit/webelem.py +++ b/qutebrowser/browser/webkit/webelem.py @@ -51,7 +51,8 @@ SELECTORS = { 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'), + 'input[type=password], input[type=search], ' + 'input:not([type]), textarea'), } diff --git a/tests/end2end/data/hints/input.html b/tests/end2end/data/hints/input.html new file mode 100644 index 000000000..87cc3b347 --- /dev/null +++ b/tests/end2end/data/hints/input.html @@ -0,0 +1,11 @@ + + + + + + Simple input + + +
+ + diff --git a/tests/end2end/features/hints.feature b/tests/end2end/features/hints.feature index 1aa4cb53b..341bbaa96 100644 --- a/tests/end2end/features/hints.feature +++ b/tests/end2end/features/hints.feature @@ -119,6 +119,15 @@ Feature: Using hints And I run :follow-hint a Then the error "Invalid link clicked - *" should be shown + Scenario: Hinting inputs without type + When I open data/hints/input.html + And I run :hint inputs + And I run :follow-hint a + And I wait for "Entering mode KeyMode.insert (reason: click)" in the log + And I run :leave-mode + # The actual check is already done above + Then no crash should happen + ### iframes Scenario: Using :follow-hint inside an iframe