3 if (!window.internals) {
4 testFailed('Test must be run with --expose-internals-for-testing flag.');
8 // FIXME(https://crbug.com/43394):
9 // These properties should live in the element prototypes instead of on the individual instances.
10 function listElementProperties(type) {
11 debug('[' + type.toUpperCase() + ' NAMESPACE ELEMENT PROPERTIES]');
12 var namespace = internals[type + 'Namespace']();
13 debug('namespace ' + namespace);
14 var tags = internals[type + 'Tags']();
15 var tagProperties = {};
16 var commonProperties = null; // Will be a map containing the intersection of properties across all elements as keys.
17 tags.forEach(function(tag) {
18 var element = document.createElement(tag, namespace);
19 // We don't read out the property descriptors here to avoid the test timing out.
20 var properties = getAllPropertyNames(element);
21 tagProperties[tag] = properties;
22 if (commonProperties === null) {
23 commonProperties = {};
24 properties.forEach(function(property) {
25 commonProperties[property] = true;
29 properties.forEach(function(property) {
30 hasProperty[property] = true;
32 Object.getOwnPropertyNames(commonProperties).forEach(function(property) {
33 if (!hasProperty[property])
34 delete commonProperties[property];
38 debug(escapeHTML('<common>'));
39 Object.getOwnPropertyNames(commonProperties).sort().forEach(function(property) {
40 debug(' property ' + property);
42 tags.forEach(function(tag) {
43 debug(type + ' element ' + tag);
44 tagProperties[tag].forEach(function(property) {
45 if (!(property in commonProperties))
46 debug(' property ' + property);
51 listElementProperties('html');
52 listElementProperties('svg');