Bug 1410796 - element.isDOMElement to match any non-XUL element. r=whimboo

This patch makes element.isDOMElement match any non-XUL element,
meaning it will henceforth match both SVG elements as well as any
custom XML namespaced element.

In the bug 1410796, Marionette does find the element, but is unable
to add it to the known web element store.  This is a result of the
changes made in bug 1400256, where I introduced a set of functions
for element type recognition needed for determining which web
element abstraction to use for an element.

We use element.isDOMElement to distinguish content elements from chrome
elements, and this change consequently makes element.isSVGElement
superfluous.

MozReview-Commit-ID: AkEHm6zroKz

--HG--
extra : rebase_source : c6f101e12839241f60c8c1b3908df3a3e4a89a51
This commit is contained in:
Andreas Tolfsen 2017-10-31 19:55:49 +00:00
Родитель c1a631a475
Коммит b91e906a0c
2 изменённых файлов: 2 добавлений и 3 удалений

Просмотреть файл

@ -34,7 +34,6 @@ const {
const SVGNS = "http://www.w3.org/2000/svg";
const XBLNS = "http://www.mozilla.org/xbl";
const XHTMLNS = "http://www.w3.org/1999/xhtml";
const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
/** XUL elements that support checked property. */
@ -1084,7 +1083,7 @@ element.isDOMElement = function(node) {
return typeof node == "object" &&
node !== null &&
node.nodeType === node.ELEMENT_NODE &&
node.namespaceURI === XHTMLNS;
!element.isXULElement(node);
};
/**

Просмотреть файл

@ -138,7 +138,7 @@ add_test(function test_isElement() {
add_test(function test_isDOMElement() {
ok(element.isDOMElement(domEl));
ok(!element.isDOMElement(svgEl));
ok(element.isDOMElement(svgEl));
ok(!element.isDOMElement(xulEl));
ok(!element.isDOMElement(domWin));
ok(!element.isDOMElement(domFrame));