compatible with Chrome 109.x

This commit is contained in:
2024-04-15 16:30:47 +08:00
parent 5cbbcf8d81
commit d91630212f
4 changed files with 106 additions and 91 deletions

View File

@ -213,8 +213,9 @@
>.ui-video-time-label {
position: absolute;
font-family: var(--font-family);
font-size: 14px;
font-weight: bold;
font-weight: 600;
left: 48px;
bottom: 40px;
color: #eee;

View File

@ -1165,8 +1165,7 @@ export class Grid {
* @type {HTMLTableRowElement[]}
*/
get _tableRows() {
// return [...this._var.refs.body.children];
return Array.prototype.slice.call(this._var.refs.body.querySelectorAll('&>.ui-grid-row'));
return Array.from(this._var.refs.body.children).filter(r => r.classList.contains('ui-grid-row'));
}
/**
@ -1174,7 +1173,7 @@ export class Grid {
* @type {HTMLTableCellElement[]}
*/
get _headerCells() {
return Array.prototype.slice.call(this._var.refs.header.querySelectorAll('&>th.column'));
return Array.from(this._var.refs.header.children).filter(h => h.tagName === 'TH' && h.classList.contains('column'));
}
/**
@ -1182,7 +1181,7 @@ export class Grid {
* @type {HTMLTableCellElement[]}
*/
get _footerCells() {
return Array.prototype.slice.call(this._var.refs.footer.querySelectorAll('&>.ui-grid-cell'));
return Array.from(this._var.refs.footer.children).filter(f => f.classList.contains('ui-grid-cell'));
}
/**
@ -2614,7 +2613,8 @@ export class Grid {
count = this._var.currentSource?.length ?? 0;
}
const cols = this.columns;
const exists = content.querySelectorAll('&>.ui-grid-row').length;
const rows = Array.from(content.children).filter(r => r.classList.contains('ui-grid-row'));
const exists = rows.length;
count -= exists;
if (count > 0) {
const readonly = this.readonly;
@ -2696,7 +2696,7 @@ export class Grid {
content.appendChild(row);
}
} else if (count < 0) {
let last = content.querySelectorAll('&>.ui-grid-row')[exists + count];
let last = rows[exists + count];
while (last != null) {
const next = last.nextElementSibling;
last.remove();