Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/pmb/node_modules/jsdom/lib/jsdom/living/nodes/ drwxr-xr-x | |
| Viewing file: Select action/file-type: "use strict";
const idlUtils = require("../generated/utils.js");
const { HTML_NS } = require("../helpers/namespaces");
exports.implementation = class HTMLCollectionImpl {
constructor(globalObject, args, privateData) {
this._list = [];
this._version = -1;
this._element = privateData.element;
this._query = privateData.query;
this._globalObject = globalObject;
this._update();
}
get length() {
this._update();
return this._list.length;
}
item(index) {
this._update();
return this._list[index] || null;
}
namedItem(key) {
if (key === "") {
return null;
}
this._update();
for (const element of this._list) {
if (element.getAttributeNS(null, "id") === key) {
return element;
}
if (element._namespaceURI === HTML_NS) {
const name = element.getAttributeNS(null, "name");
if (name === key) {
return element;
}
}
}
return null;
}
_update() {
if (this._version < this._element._version) {
const snapshot = this._query();
for (let i = 0; i < snapshot.length; i++) {
this._list[i] = snapshot[i];
}
this._list.length = snapshot.length;
this._version = this._element._version;
}
}
get [idlUtils.supportedPropertyIndices]() {
this._update();
return this._list.keys();
}
get [idlUtils.supportedPropertyNames]() {
this._update();
const result = new Set();
for (const element of this._list) {
const id = element.getAttributeNS(null, "id");
if (id) {
result.add(id);
}
if (element._namespaceURI === HTML_NS) {
const name = element.getAttributeNS(null, "name");
if (name) {
result.add(name);
}
}
}
return result;
}
// Inherit some useful functions from Array.
[Symbol.iterator]() {
this._update();
return this._list[Symbol.iterator]();
}
entries() {
this._update();
return this._list.entries();
}
filter(...args) {
this._update();
return this._list.filter(...args);
}
map(...args) {
this._update();
return this._list.map(...args);
}
indexOf(...args) {
this._update();
return this._list.indexOf(...args);
}
};
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0063 ]-- |