parent
e832105dd5
commit
3feb4211fe
@ -248,6 +248,7 @@ class WebKitElement(webelem.AbstractWebElement):
|
|||||||
hidden_attributes = {
|
hidden_attributes = {
|
||||||
'visibility': 'hidden',
|
'visibility': 'hidden',
|
||||||
'display': 'none',
|
'display': 'none',
|
||||||
|
'opacity': '0',
|
||||||
}
|
}
|
||||||
for k, v in hidden_attributes.items():
|
for k, v in hidden_attributes.items():
|
||||||
if self._elem.styleProperty(k, QWebElement.ComputedStyle) == v:
|
if self._elem.styleProperty(k, QWebElement.ComputedStyle) == v:
|
||||||
|
@ -115,7 +115,8 @@ window._qutebrowser.webelem = (function() {
|
|||||||
// See https://github.com/vimperator/vimperator-labs/issues/236
|
// See https://github.com/vimperator/vimperator-labs/issues/236
|
||||||
if (elem.nodeName.toLowerCase() !== "area" && (
|
if (elem.nodeName.toLowerCase() !== "area" && (
|
||||||
style.getPropertyValue("visibility") !== "visible" ||
|
style.getPropertyValue("visibility") !== "visible" ||
|
||||||
style.getPropertyValue("display") === "none")) {
|
style.getPropertyValue("display") === "none" ||
|
||||||
|
style.getPropertyValue("opacity") === "0")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
14
tests/end2end/data/hints/invisible.html
Normal file
14
tests/end2end/data/hints/invisible.html
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Invisible links</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>None of those invisible links should get a hint.</p>
|
||||||
|
<a href="/data/hello.txt" style="visibility: hidden">visibility: hidden</a>
|
||||||
|
<a href="/data/hello.txt" style="display: none">display: none</a>
|
||||||
|
<a href="/data/hello.txt" style="opacity: 0">opacity: 0</a>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -183,6 +183,11 @@ Feature: Using hints
|
|||||||
# The actual check is already done above
|
# The actual check is already done above
|
||||||
Then no crash should happen
|
Then no crash should happen
|
||||||
|
|
||||||
|
Scenario: Hinting invisible elements
|
||||||
|
When I open data/hints/invisible.html
|
||||||
|
And I run :hint
|
||||||
|
Then the error "No elements found." should be shown
|
||||||
|
|
||||||
### iframes
|
### iframes
|
||||||
|
|
||||||
@qtwebengine_todo: Hinting in iframes is not implemented yet
|
@qtwebengine_todo: Hinting in iframes is not implemented yet
|
||||||
|
Loading…
Reference in New Issue
Block a user