Handle elem.className in webelem.js
This commit is contained in:
parent
513f83d446
commit
0c653c4703
@ -53,7 +53,6 @@ window._qutebrowser.webelem = (function() {
|
|||||||
"text": elem.text,
|
"text": elem.text,
|
||||||
"value": elem.value,
|
"value": elem.value,
|
||||||
"outer_xml": elem.outerHTML,
|
"outer_xml": elem.outerHTML,
|
||||||
"class_name": elem.className,
|
|
||||||
"rects": [], // Gets filled up later
|
"rects": [], // Gets filled up later
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -66,6 +65,13 @@ window._qutebrowser.webelem = (function() {
|
|||||||
out.tag_name = "";
|
out.tag_name = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeof elem.className === "string") {
|
||||||
|
out.class_name = elem.className;
|
||||||
|
} else {
|
||||||
|
// e.g. SVG elements
|
||||||
|
out.class_name = "";
|
||||||
|
}
|
||||||
|
|
||||||
var attributes = {};
|
var attributes = {};
|
||||||
for (var i = 0; i < elem.attributes.length; ++i) {
|
for (var i = 0; i < elem.attributes.length; ++i) {
|
||||||
var attr = elem.attributes[i];
|
var attr = elem.attributes[i];
|
||||||
|
@ -735,3 +735,9 @@ Feature: Various utility commands.
|
|||||||
And I run :click-element id theform
|
And I run :click-element id theform
|
||||||
And I wait for "Clicked editable element!" in the log
|
And I wait for "Clicked editable element!" in the log
|
||||||
Then no crash should happen
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user