Handle elem.className in webelem.js

This commit is contained in:
Florian Bruhin 2017-04-28 14:48:08 +02:00
parent 513f83d446
commit 0c653c4703
2 changed files with 13 additions and 1 deletions

View File

@ -53,7 +53,6 @@ window._qutebrowser.webelem = (function() {
"text": elem.text,
"value": elem.value,
"outer_xml": elem.outerHTML,
"class_name": elem.className,
"rects": [], // Gets filled up later
};
@ -66,6 +65,13 @@ window._qutebrowser.webelem = (function() {
out.tag_name = "";
}
if (typeof elem.className === "string") {
out.class_name = elem.className;
} else {
// e.g. SVG elements
out.class_name = "";
}
var attributes = {};
for (var i = 0; i < elem.attributes.length; ++i) {
var attr = elem.attributes[i];

View File

@ -735,3 +735,9 @@ Feature: Various utility commands.
And I run :click-element id theform
And I wait for "Clicked editable element!" in the log
Then no crash should happen
Scenario: Clicking on svg element
When I open data/issue2569.html
And I run :click-element id icon
And I wait for "Clicked non-editable element!" in the log
Then no crash should happen