mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-08 19:06:15 -08:00
perf(core): [MOD-03] avoid redundant slider attribute writes
This commit is contained in:
1 parent
7b0e1d156b
commit
23a4f22b72
18 files changed
+6012
-28
No files matched your search
@@ -67,4 +67,4 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
!function(t,e){"object"===typeof exports&&"undefined"!==typeof module?module.exports=e():"function"==typeof define&&define.amd?(t.Artplayer=e(),define(function(){return t.Artplayer})):(t="undefined"!==typeof globalThis?globalThis:t||self).Artplayer=e()}(this,function(){"use strict";function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var e,r={exports:{}};var n=(e||(e=1,r.exports=function(){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}var e=Object.prototype.toString,r=function(r){if(void 0===r)return"undefined";if(null===r)return"null";var o=t(r);if("boolean"===o)return"boolean";if("string"===o)return"string";if("number"===o)return"number";if("symbol"===o)return"symbol";if("function"===o)return"GeneratorFunction"===n(r)?"generatorfunction":"function";if(function(t){return Array.isArray?Array.isArray(t):t instanceof Array}(r))return"array";if(function(t){return!(!t.constructor||"function"!=typeof t.constructor.isBuffer)&&t.constructor.isBuffer(t)}(r))return"buffer";if(function(t){try{if("number"==typeof t.length&&"function"==typeof t.callee)return!0}catch(e){if(-1!==e.message.indexOf("callee"))return!0}return!1}(r))return"arguments";if(function(t){return t instanceof Date||"function"==typeof t.toDateString&&"function"==typeof t.getDate&&"function"==typeof t.setDate}(r))return"date";if(function(t){return t instanceof Error||"string"==typeof t.message&&t.constructor&&"number"==typeof t.constructor.stackTraceLimit}(r))return"error";if(function(t){return t instanceof RegExp||"string"==typeof t.flags&&"boolean"==typeof t.ignoreCase&&"boolean"==typeof t.multiline&&"boolean"==typeof t.global}(r))return"regexp";switch(n(r)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(function(t){return"function"==typeof t.throw&&"function"==typeof t.return&&"function"==typeof t.next}(r))return"generator";switch(o=e.call(r)){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return o.slice(8,-1).toLowerCase().replace(/\s/g,"")};function n(t){return t.constructor?t.constructor.name:null}function o(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:["option"];return i(t,e,n),a(t,e,n),function(t,e,n){var s=r(e),c=r(t);if("object"===s){if("object"!==c)throw new Error("[Type Error]: '".concat(n.join("."),"' require 'object' type, but got '").concat(c,"'"));Object.keys(e).forEach(function(r){var s=t[r],c=e[r],l=n.slice();l.push(r),i(s,c,l),a(s,c,l),o(s,c,l)})}if("array"===s){if("array"!==c)throw new Error("[Type Error]: '".concat(n.join("."),"' require 'array' type, but got '").concat(c,"'"));t.forEach(function(r,s){var c=t[s],l=e[s]||e[0],d=n.slice();d.push(s),i(c,l,d),a(c,l,d),o(c,l,d)})}}(t,e,n),t}function i(t,e,n){if("string"===r(e)){var o=r(t);if("?"===e[0]&&(e=e.slice(1)+"|undefined"),!(-1<e.indexOf("|")?e.split("|").map(function(t){return t.toLowerCase().trim()}).filter(Boolean).some(function(t){return o===t}):e.toLowerCase().trim()===o))throw new Error("[Type Error]: '".concat(n.join("."),"' require '").concat(e,"' type, but got '").concat(o,"'"))}}function a(t,e,n){if("function"===r(e)){var o=e(t,r(t),n);if(!0!==o){var i=r(o);throw"string"===i?new Error(o):"error"===i?o:new Error("[Validator Error]: The scheme for '".concat(n.join("."),"' validator require return true, but got '").concat(o,"'"))}}}return o.kindOf=r,o}()),r.exports);const o=t(n),i="5.4.1";function a(t,e){let r=document.getElementById(t);r||(r=document.createElement("style"),r.id=t,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{document.head.appendChild(r)}):(document.head||document.documentElement).appendChild(r)),r.textContent=e}const s=globalThis.CUSTOM_USER_AGENT??("undefined"===typeof navigator?"":navigator.userAgent),c=/^(?:(?!chrome|android).)*safari/i.test(s),l=/iPad|iPhone|iPod/i.test(s)&&("undefined"===typeof window||!window.MSStream),d=l||s.includes("Macintosh")&&"undefined"!==typeof navigator&&navigator.maxTouchPoints>=1,u=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(s)||d,p="undefined"!==typeof window&&"undefined"!==typeof document;const f={properties:["audioTracks","autoplay","buffered","controller","controlLine truncated
|
||||
!function(t,e){"object"===typeof exports&&"undefined"!==typeof module?module.exports=e():"function"==typeof define&&define.amd?(t.Artplayer=e(),define(function(){return t.Artplayer})):(t="undefined"!==typeof globalThis?globalThis:t||self).Artplayer=e()}(this,function(){"use strict";function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var e,r={exports:{}};var n=(e||(e=1,r.exports=function(){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}var e=Object.prototype.toString,r=function(r){if(void 0===r)return"undefined";if(null===r)return"null";var o=t(r);if("boolean"===o)return"boolean";if("string"===o)return"string";if("number"===o)return"number";if("symbol"===o)return"symbol";if("function"===o)return"GeneratorFunction"===n(r)?"generatorfunction":"function";if(function(t){return Array.isArray?Array.isArray(t):t instanceof Array}(r))return"array";if(function(t){return!(!t.constructor||"function"!=typeof t.constructor.isBuffer)&&t.constructor.isBuffer(t)}(r))return"buffer";if(function(t){try{if("number"==typeof t.length&&"function"==typeof t.callee)return!0}catch(e){if(-1!==e.message.indexOf("callee"))return!0}return!1}(r))return"arguments";if(function(t){return t instanceof Date||"function"==typeof t.toDateString&&"function"==typeof t.getDate&&"function"==typeof t.setDate}(r))return"date";if(function(t){return t instanceof Error||"string"==typeof t.message&&t.constructor&&"number"==typeof t.constructor.stackTraceLimit}(r))return"error";if(function(t){return t instanceof RegExp||"string"==typeof t.flags&&"boolean"==typeof t.ignoreCase&&"boolean"==typeof t.multiline&&"boolean"==typeof t.global}(r))return"regexp";switch(n(r)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(function(t){return"function"==typeof t.throw&&"function"==typeof t.return&&"function"==typeof t.next}(r))return"generator";switch(o=e.call(r)){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return o.slice(8,-1).toLowerCase().replace(/\s/g,"")};function n(t){return t.constructor?t.constructor.name:null}function o(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:["option"];return i(t,e,n),a(t,e,n),function(t,e,n){var s=r(e),c=r(t);if("object"===s){if("object"!==c)throw new Error("[Type Error]: '".concat(n.join("."),"' require 'object' type, but got '").concat(c,"'"));Object.keys(e).forEach(function(r){var s=t[r],c=e[r],l=n.slice();l.push(r),i(s,c,l),a(s,c,l),o(s,c,l)})}if("array"===s){if("array"!==c)throw new Error("[Type Error]: '".concat(n.join("."),"' require 'array' type, but got '").concat(c,"'"));t.forEach(function(r,s){var c=t[s],l=e[s]||e[0],d=n.slice();d.push(s),i(c,l,d),a(c,l,d),o(c,l,d)})}}(t,e,n),t}function i(t,e,n){if("string"===r(e)){var o=r(t);if("?"===e[0]&&(e=e.slice(1)+"|undefined"),!(-1<e.indexOf("|")?e.split("|").map(function(t){return t.toLowerCase().trim()}).filter(Boolean).some(function(t){return o===t}):e.toLowerCase().trim()===o))throw new Error("[Type Error]: '".concat(n.join("."),"' require '").concat(e,"' type, but got '").concat(o,"'"))}}function a(t,e,n){if("function"===r(e)){var o=e(t,r(t),n);if(!0!==o){var i=r(o);throw"string"===i?new Error(o):"error"===i?o:new Error("[Validator Error]: The scheme for '".concat(n.join("."),"' validator require return true, but got '").concat(o,"'"))}}}return o.kindOf=r,o}()),r.exports);const o=t(n),i="5.4.1";function a(t,e){let r=document.getElementById(t);r||(r=document.createElement("style"),r.id=t,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{document.head.appendChild(r)}):(document.head||document.documentElement).appendChild(r)),r.textContent=e}const s=globalThis.CUSTOM_USER_AGENT??("undefined"===typeof navigator?"":navigator.userAgent),c=/^(?:(?!chrome|android).)*safari/i.test(s),l=/iPad|iPhone|iPod/i.test(s)&&("undefined"===typeof window||!window.MSStream),d=l||s.includes("Macintosh")&&"undefined"!==typeof navigator&&navigator.maxTouchPoints>=1,u=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(s)||d,p="undefined"!==typeof window&&"undefined"!==typeof document;const f={properties:["audioTracks","autoplay","buffered","controller","controlLine truncated
|
||||
@@ -67,4 +67,4 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
!function(t,e){"object"===typeof exports&&"undefined"!==typeof module?module.exports=e():"function"==typeof define&&define.amd?(t.Artplayer=e(),define(function(){return t.Artplayer})):(t="undefined"!==typeof globalThis?globalThis:t||self).Artplayer=e()}(this,function(){"use strict";var t=Object.defineProperty,e=Object.defineProperties,r=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,a=(e,r,n)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,s=(t,e)=>{for(var r in e||(e={}))o.call(e,r)&&a(t,r,e[r]);if(n)for(var r of n(e))i.call(e,r)&&a(t,r,e[r]);return t},l=(t,n)=>e(t,r(n)),c=(t,e,r)=>new Promise((n,o)=>{var i=t=>{try{s(r.next(t))}catch(e){o(e)}},a=t=>{try{s(r.throw(t))}catch(e){o(e)}},s=t=>t.done?n(t.value):Promise.resolve(t.value).then(i,a);s((r=r.apply(t,e)).next())});function d(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var u,p={exports:{}};var f=(u||(u=1,p.exports=function(){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}var e=Object.prototype.toString,r=function(r){if(void 0===r)return"undefined";if(null===r)return"null";var o=t(r);if("boolean"===o)return"boolean";if("string"===o)return"string";if("number"===o)return"number";if("symbol"===o)return"symbol";if("function"===o)return"GeneratorFunction"===n(r)?"generatorfunction":"function";if(function(t){return Array.isArray?Array.isArray(t):t instanceof Array}(r))return"array";if(function(t){return!(!t.constructor||"function"!=typeof t.constructor.isBuffer)&&t.constructor.isBuffer(t)}(r))return"buffer";if(function(t){try{if("number"==typeof t.length&&"function"==typeof t.callee)return!0}catch(e){if(-1!==e.message.indexOf("callee"))return!0}return!1}(r))return"arguments";if(function(t){return t instanceof Date||"function"==typeof t.toDateString&&"function"==typeof t.getDate&&"function"==typeof t.setDate}(r))return"date";if(function(t){return t instanceof Error||"string"==typeof t.message&&t.constructor&&"number"==typeof t.constructor.stackTraceLimit}(r))return"error";if(function(t){return t instanceof RegExp||"string"==typeof t.flags&&"boolean"==typeof t.ignoreCase&&"boolean"==typeof t.multiline&&"boolean"==typeof t.global}(r))return"regexp";switch(n(r)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(function(t){return"function"==typeof t.throw&&"function"==typeof t.return&&"function"==typeof t.next}(r))return"generator";switch(o=e.call(r)){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return o.slice(8,-1).toLowerCase().replace(/\s/g,"")};function n(t){return t.constructor?t.constructor.name:null}function o(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:["option"];return i(t,e,n),a(t,e,n),function(t,e,n){var s=r(e),l=r(t);if("object"===s){if("object"!==l)throw new Error("[Type Error]: '".concat(n.join("."),"' require 'object' type, but got '").concat(l,"'"));Object.keys(e).forEach(function(r){var s=t[r],l=e[r],c=n.slice();c.push(r),i(s,l,c),a(s,l,c),o(s,l,c)})}if("array"===s){if("array"!==l)throw new Error("[Type Error]: '".concat(n.join("."),"' require 'array' type, but got '").concat(l,"'"));t.forEach(function(r,s){var l=t[s],c=e[s]||e[0],d=n.slice();d.push(s),i(l,c,d),a(l,c,d),o(l,c,d)})}}(t,e,n),t}function i(t,e,n){if("string"===r(e)){var o=r(t);if("?"===e[0]&&(e=e.slice(1)+"|undefined"),!(-1<e.indexOf("|")?e.split("|").map(function(t){return t.toLowerCase().trim()}).filter(Boolean).some(function(t){return o===t}):e.toLowerCase().trim()===o))throw new Error("[Type Error]: '".concat(n.join("."),"' require '").concat(e,"' type, but got '").concat(o,"'"))}}function a(t,e,n){if("function"===r(e)){var o=e(t,r(t),n);if(!0!==o){var i=r(o);throw"string"===i?new Error(o):"error"===i?o:new Error("[Validator Error]: The scheme for '".concat(n.join("."),"' validator require return true, but got '").concat(o,"'"))}}}return o.kindOf=r,o}()),p.exports);const h=d(f),m="5.4.1";function v(t,e){let r=document.getElementById(t);r||(r=document.createElement("style"),r.id=t,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{document.head.apLine truncated
|
||||
!function(t,e){"object"===typeof exports&&"undefined"!==typeof module?module.exports=e():"function"==typeof define&&define.amd?(t.Artplayer=e(),define(function(){return t.Artplayer})):(t="undefined"!==typeof globalThis?globalThis:t||self).Artplayer=e()}(this,function(){"use strict";var t=Object.defineProperty,e=Object.defineProperties,r=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,a=(e,r,n)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,s=(t,e)=>{for(var r in e||(e={}))o.call(e,r)&&a(t,r,e[r]);if(n)for(var r of n(e))i.call(e,r)&&a(t,r,e[r]);return t},l=(t,n)=>e(t,r(n)),c=(t,e,r)=>new Promise((n,o)=>{var i=t=>{try{s(r.next(t))}catch(e){o(e)}},a=t=>{try{s(r.throw(t))}catch(e){o(e)}},s=t=>t.done?n(t.value):Promise.resolve(t.value).then(i,a);s((r=r.apply(t,e)).next())});function d(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var u,p={exports:{}};var f=(u||(u=1,p.exports=function(){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}var e=Object.prototype.toString,r=function(r){if(void 0===r)return"undefined";if(null===r)return"null";var o=t(r);if("boolean"===o)return"boolean";if("string"===o)return"string";if("number"===o)return"number";if("symbol"===o)return"symbol";if("function"===o)return"GeneratorFunction"===n(r)?"generatorfunction":"function";if(function(t){return Array.isArray?Array.isArray(t):t instanceof Array}(r))return"array";if(function(t){return!(!t.constructor||"function"!=typeof t.constructor.isBuffer)&&t.constructor.isBuffer(t)}(r))return"buffer";if(function(t){try{if("number"==typeof t.length&&"function"==typeof t.callee)return!0}catch(e){if(-1!==e.message.indexOf("callee"))return!0}return!1}(r))return"arguments";if(function(t){return t instanceof Date||"function"==typeof t.toDateString&&"function"==typeof t.getDate&&"function"==typeof t.setDate}(r))return"date";if(function(t){return t instanceof Error||"string"==typeof t.message&&t.constructor&&"number"==typeof t.constructor.stackTraceLimit}(r))return"error";if(function(t){return t instanceof RegExp||"string"==typeof t.flags&&"boolean"==typeof t.ignoreCase&&"boolean"==typeof t.multiline&&"boolean"==typeof t.global}(r))return"regexp";switch(n(r)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(function(t){return"function"==typeof t.throw&&"function"==typeof t.return&&"function"==typeof t.next}(r))return"generator";switch(o=e.call(r)){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return o.slice(8,-1).toLowerCase().replace(/\s/g,"")};function n(t){return t.constructor?t.constructor.name:null}function o(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:["option"];return i(t,e,n),a(t,e,n),function(t,e,n){var s=r(e),l=r(t);if("object"===s){if("object"!==l)throw new Error("[Type Error]: '".concat(n.join("."),"' require 'object' type, but got '").concat(l,"'"));Object.keys(e).forEach(function(r){var s=t[r],l=e[r],c=n.slice();c.push(r),i(s,l,c),a(s,l,c),o(s,l,c)})}if("array"===s){if("array"!==l)throw new Error("[Type Error]: '".concat(n.join("."),"' require 'array' type, but got '").concat(l,"'"));t.forEach(function(r,s){var l=t[s],c=e[s]||e[0],d=n.slice();d.push(s),i(l,c,d),a(l,c,d),o(l,c,d)})}}(t,e,n),t}function i(t,e,n){if("string"===r(e)){var o=r(t);if("?"===e[0]&&(e=e.slice(1)+"|undefined"),!(-1<e.indexOf("|")?e.split("|").map(function(t){return t.toLowerCase().trim()}).filter(Boolean).some(function(t){return o===t}):e.toLowerCase().trim()===o))throw new Error("[Type Error]: '".concat(n.join("."),"' require '").concat(e,"' type, but got '").concat(o,"'"))}}function a(t,e,n){if("function"===r(e)){var o=e(t,r(t),n);if(!0!==o){var i=r(o);throw"string"===i?new Error(o):"error"===i?o:new Error("[Validator Error]: The scheme for '".concat(n.join("."),"' validator require return true, but got '").concat(o,"'"))}}}return o.kindOf=r,o}()),p.exports);const h=d(f),m="5.4.1";function v(t,e){let r=document.getElementById(t);r||(r=document.createElement("style"),r.id=t,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{document.head.apLine truncated
|
||||
@@ -2268,6 +2268,10 @@ function installProgressInteractions(art, $control) {
|
||||
}
|
||||
}
|
||||
const directions = /* @__PURE__ */ new Map([["ArrowRight", 1], ["ArrowUp", 1], ["ArrowLeft", -1], ["ArrowDown", -1], ["PageUp", 10], ["PageDown", -10]]);
|
||||
function updateAttribute(element, name, value) {
|
||||
if (element.getAttribute(name) !== value)
|
||||
element.setAttribute(name, value);
|
||||
}
|
||||
function keyboardSlider(scope, element, label, read, write, orientation = "horizontal") {
|
||||
const valid = (range) => [range.min, range.max, range.value, range.step].every(Number.isFinite) && range.max > range.min && range.step > 0;
|
||||
const clamp2 = (value, range) => Math.min(range.max, Math.max(range.min, value));
|
||||
@@ -2277,11 +2281,11 @@ function keyboardSlider(scope, element, label, read, write, orientation = "horiz
|
||||
const range = read();
|
||||
const enabled = valid(range);
|
||||
const value = enabled ? clamp2(range.value, range) : 0;
|
||||
element.setAttribute("aria-disabled", String(!enabled));
|
||||
element.setAttribute("aria-valuemin", String(enabled ? range.min : 0));
|
||||
element.setAttribute("aria-valuemax", String(enabled ? range.max : 0));
|
||||
element.setAttribute("aria-valuenow", String(value));
|
||||
element.setAttribute("aria-valuetext", range.text(value));
|
||||
updateAttribute(element, "aria-disabled", String(!enabled));
|
||||
updateAttribute(element, "aria-valuemin", String(enabled ? range.min : 0));
|
||||
updateAttribute(element, "aria-valuemax", String(enabled ? range.max : 0));
|
||||
updateAttribute(element, "aria-valuenow", String(value));
|
||||
updateAttribute(element, "aria-valuetext", range.text(value));
|
||||
};
|
||||
if (scope.closed)
|
||||
return update;
|
||||
|
||||
@@ -1369,7 +1369,17 @@ entry scope. Native focus updates existing isFocus/isInput flags without emittin
|
||||
extra public pointer focus/blur events. `style/accessibility.less` supplies visible
|
||||
focus and keyboard control-bar visibility without changing existing class hooks.
|
||||
|
||||
`accessibility/slider.ts` owns range keyboard input and ARIA state. Arrow keys use
|
||||
`accessibility/slider.ts` owns range keyboard input and ARIA state. Each refresh
|
||||
still reads the live range and formats its text, but compares each ARIA value with
|
||||
the actual DOM before writing. There is no cross-event value cache: external
|
||||
attribute changes/removals are repaired by the next update. This avoids duplicate
|
||||
attribute mutations on repeated timeupdate/volumechange without changing media
|
||||
events, keyboard writes, range validation or closed-scope behavior. The
|
||||
`slider-updates.spec.js` browser check records duplicate-event mutation counts and
|
||||
native playback updates; optional ARTPLAYER_SLIDER_BASELINE supplies a prechange
|
||||
artifact for three alternating paired groups. Synthetic paused-event timings are
|
||||
diagnostic, not overall playback or initialization performance acceptance.
|
||||
Arrow keys use
|
||||
the configured step, PageUp/PageDown use ten steps, and Home/End select endpoints.
|
||||
Unavailable or non-finite ranges remain focusable but disabled; their navigation
|
||||
keys cannot fall through to player shortcuts. Values and accessible text follow
|
||||
|
||||
Vendored
+1
-1
@@ -67,4 +67,4 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
!function(t,e){"object"===typeof exports&&"undefined"!==typeof module?module.exports=e():"function"==typeof define&&define.amd?(t.Artplayer=e(),define(function(){return t.Artplayer})):(t="undefined"!==typeof globalThis?globalThis:t||self).Artplayer=e()}(this,function(){"use strict";function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var e,r={exports:{}};var n=(e||(e=1,r.exports=function(){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}var e=Object.prototype.toString,r=function(r){if(void 0===r)return"undefined";if(null===r)return"null";var o=t(r);if("boolean"===o)return"boolean";if("string"===o)return"string";if("number"===o)return"number";if("symbol"===o)return"symbol";if("function"===o)return"GeneratorFunction"===n(r)?"generatorfunction":"function";if(function(t){return Array.isArray?Array.isArray(t):t instanceof Array}(r))return"array";if(function(t){return!(!t.constructor||"function"!=typeof t.constructor.isBuffer)&&t.constructor.isBuffer(t)}(r))return"buffer";if(function(t){try{if("number"==typeof t.length&&"function"==typeof t.callee)return!0}catch(e){if(-1!==e.message.indexOf("callee"))return!0}return!1}(r))return"arguments";if(function(t){return t instanceof Date||"function"==typeof t.toDateString&&"function"==typeof t.getDate&&"function"==typeof t.setDate}(r))return"date";if(function(t){return t instanceof Error||"string"==typeof t.message&&t.constructor&&"number"==typeof t.constructor.stackTraceLimit}(r))return"error";if(function(t){return t instanceof RegExp||"string"==typeof t.flags&&"boolean"==typeof t.ignoreCase&&"boolean"==typeof t.multiline&&"boolean"==typeof t.global}(r))return"regexp";switch(n(r)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(function(t){return"function"==typeof t.throw&&"function"==typeof t.return&&"function"==typeof t.next}(r))return"generator";switch(o=e.call(r)){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return o.slice(8,-1).toLowerCase().replace(/\s/g,"")};function n(t){return t.constructor?t.constructor.name:null}function o(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:["option"];return i(t,e,n),a(t,e,n),function(t,e,n){var s=r(e),c=r(t);if("object"===s){if("object"!==c)throw new Error("[Type Error]: '".concat(n.join("."),"' require 'object' type, but got '").concat(c,"'"));Object.keys(e).forEach(function(r){var s=t[r],c=e[r],l=n.slice();l.push(r),i(s,c,l),a(s,c,l),o(s,c,l)})}if("array"===s){if("array"!==c)throw new Error("[Type Error]: '".concat(n.join("."),"' require 'array' type, but got '").concat(c,"'"));t.forEach(function(r,s){var c=t[s],l=e[s]||e[0],d=n.slice();d.push(s),i(c,l,d),a(c,l,d),o(c,l,d)})}}(t,e,n),t}function i(t,e,n){if("string"===r(e)){var o=r(t);if("?"===e[0]&&(e=e.slice(1)+"|undefined"),!(-1<e.indexOf("|")?e.split("|").map(function(t){return t.toLowerCase().trim()}).filter(Boolean).some(function(t){return o===t}):e.toLowerCase().trim()===o))throw new Error("[Type Error]: '".concat(n.join("."),"' require '").concat(e,"' type, but got '").concat(o,"'"))}}function a(t,e,n){if("function"===r(e)){var o=e(t,r(t),n);if(!0!==o){var i=r(o);throw"string"===i?new Error(o):"error"===i?o:new Error("[Validator Error]: The scheme for '".concat(n.join("."),"' validator require return true, but got '").concat(o,"'"))}}}return o.kindOf=r,o}()),r.exports);const o=t(n),i="5.4.1";function a(t,e){let r=document.getElementById(t);r||(r=document.createElement("style"),r.id=t,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{document.head.appendChild(r)}):(document.head||document.documentElement).appendChild(r)),r.textContent=e}const s=globalThis.CUSTOM_USER_AGENT??("undefined"===typeof navigator?"":navigator.userAgent),c=/^(?:(?!chrome|android).)*safari/i.test(s),l=/iPad|iPhone|iPod/i.test(s)&&("undefined"===typeof window||!window.MSStream),d=l||s.includes("Macintosh")&&"undefined"!==typeof navigator&&navigator.maxTouchPoints>=1,u=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(s)||d,p="undefined"!==typeof window&&"undefined"!==typeof document;const f={properties:["audioTracks","autoplay","buffered","controller","controlLine truncated
|
||||
!function(t,e){"object"===typeof exports&&"undefined"!==typeof module?module.exports=e():"function"==typeof define&&define.amd?(t.Artplayer=e(),define(function(){return t.Artplayer})):(t="undefined"!==typeof globalThis?globalThis:t||self).Artplayer=e()}(this,function(){"use strict";function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var e,r={exports:{}};var n=(e||(e=1,r.exports=function(){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}var e=Object.prototype.toString,r=function(r){if(void 0===r)return"undefined";if(null===r)return"null";var o=t(r);if("boolean"===o)return"boolean";if("string"===o)return"string";if("number"===o)return"number";if("symbol"===o)return"symbol";if("function"===o)return"GeneratorFunction"===n(r)?"generatorfunction":"function";if(function(t){return Array.isArray?Array.isArray(t):t instanceof Array}(r))return"array";if(function(t){return!(!t.constructor||"function"!=typeof t.constructor.isBuffer)&&t.constructor.isBuffer(t)}(r))return"buffer";if(function(t){try{if("number"==typeof t.length&&"function"==typeof t.callee)return!0}catch(e){if(-1!==e.message.indexOf("callee"))return!0}return!1}(r))return"arguments";if(function(t){return t instanceof Date||"function"==typeof t.toDateString&&"function"==typeof t.getDate&&"function"==typeof t.setDate}(r))return"date";if(function(t){return t instanceof Error||"string"==typeof t.message&&t.constructor&&"number"==typeof t.constructor.stackTraceLimit}(r))return"error";if(function(t){return t instanceof RegExp||"string"==typeof t.flags&&"boolean"==typeof t.ignoreCase&&"boolean"==typeof t.multiline&&"boolean"==typeof t.global}(r))return"regexp";switch(n(r)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(function(t){return"function"==typeof t.throw&&"function"==typeof t.return&&"function"==typeof t.next}(r))return"generator";switch(o=e.call(r)){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return o.slice(8,-1).toLowerCase().replace(/\s/g,"")};function n(t){return t.constructor?t.constructor.name:null}function o(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:["option"];return i(t,e,n),a(t,e,n),function(t,e,n){var s=r(e),c=r(t);if("object"===s){if("object"!==c)throw new Error("[Type Error]: '".concat(n.join("."),"' require 'object' type, but got '").concat(c,"'"));Object.keys(e).forEach(function(r){var s=t[r],c=e[r],l=n.slice();l.push(r),i(s,c,l),a(s,c,l),o(s,c,l)})}if("array"===s){if("array"!==c)throw new Error("[Type Error]: '".concat(n.join("."),"' require 'array' type, but got '").concat(c,"'"));t.forEach(function(r,s){var c=t[s],l=e[s]||e[0],d=n.slice();d.push(s),i(c,l,d),a(c,l,d),o(c,l,d)})}}(t,e,n),t}function i(t,e,n){if("string"===r(e)){var o=r(t);if("?"===e[0]&&(e=e.slice(1)+"|undefined"),!(-1<e.indexOf("|")?e.split("|").map(function(t){return t.toLowerCase().trim()}).filter(Boolean).some(function(t){return o===t}):e.toLowerCase().trim()===o))throw new Error("[Type Error]: '".concat(n.join("."),"' require '").concat(e,"' type, but got '").concat(o,"'"))}}function a(t,e,n){if("function"===r(e)){var o=e(t,r(t),n);if(!0!==o){var i=r(o);throw"string"===i?new Error(o):"error"===i?o:new Error("[Validator Error]: The scheme for '".concat(n.join("."),"' validator require return true, but got '").concat(o,"'"))}}}return o.kindOf=r,o}()),r.exports);const o=t(n),i="5.4.1";function a(t,e){let r=document.getElementById(t);r||(r=document.createElement("style"),r.id=t,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{document.head.appendChild(r)}):(document.head||document.documentElement).appendChild(r)),r.textContent=e}const s=globalThis.CUSTOM_USER_AGENT??("undefined"===typeof navigator?"":navigator.userAgent),c=/^(?:(?!chrome|android).)*safari/i.test(s),l=/iPad|iPhone|iPod/i.test(s)&&("undefined"===typeof window||!window.MSStream),d=l||s.includes("Macintosh")&&"undefined"!==typeof navigator&&navigator.maxTouchPoints>=1,u=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(s)||d,p="undefined"!==typeof window&&"undefined"!==typeof document;const f={properties:["audioTracks","autoplay","buffered","controller","controlLine truncated
|
||||
+1
-1
@@ -67,4 +67,4 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
!function(t,e){"object"===typeof exports&&"undefined"!==typeof module?module.exports=e():"function"==typeof define&&define.amd?(t.Artplayer=e(),define(function(){return t.Artplayer})):(t="undefined"!==typeof globalThis?globalThis:t||self).Artplayer=e()}(this,function(){"use strict";var t=Object.defineProperty,e=Object.defineProperties,r=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,a=(e,r,n)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,s=(t,e)=>{for(var r in e||(e={}))o.call(e,r)&&a(t,r,e[r]);if(n)for(var r of n(e))i.call(e,r)&&a(t,r,e[r]);return t},l=(t,n)=>e(t,r(n)),c=(t,e,r)=>new Promise((n,o)=>{var i=t=>{try{s(r.next(t))}catch(e){o(e)}},a=t=>{try{s(r.throw(t))}catch(e){o(e)}},s=t=>t.done?n(t.value):Promise.resolve(t.value).then(i,a);s((r=r.apply(t,e)).next())});function d(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var u,p={exports:{}};var f=(u||(u=1,p.exports=function(){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}var e=Object.prototype.toString,r=function(r){if(void 0===r)return"undefined";if(null===r)return"null";var o=t(r);if("boolean"===o)return"boolean";if("string"===o)return"string";if("number"===o)return"number";if("symbol"===o)return"symbol";if("function"===o)return"GeneratorFunction"===n(r)?"generatorfunction":"function";if(function(t){return Array.isArray?Array.isArray(t):t instanceof Array}(r))return"array";if(function(t){return!(!t.constructor||"function"!=typeof t.constructor.isBuffer)&&t.constructor.isBuffer(t)}(r))return"buffer";if(function(t){try{if("number"==typeof t.length&&"function"==typeof t.callee)return!0}catch(e){if(-1!==e.message.indexOf("callee"))return!0}return!1}(r))return"arguments";if(function(t){return t instanceof Date||"function"==typeof t.toDateString&&"function"==typeof t.getDate&&"function"==typeof t.setDate}(r))return"date";if(function(t){return t instanceof Error||"string"==typeof t.message&&t.constructor&&"number"==typeof t.constructor.stackTraceLimit}(r))return"error";if(function(t){return t instanceof RegExp||"string"==typeof t.flags&&"boolean"==typeof t.ignoreCase&&"boolean"==typeof t.multiline&&"boolean"==typeof t.global}(r))return"regexp";switch(n(r)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(function(t){return"function"==typeof t.throw&&"function"==typeof t.return&&"function"==typeof t.next}(r))return"generator";switch(o=e.call(r)){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return o.slice(8,-1).toLowerCase().replace(/\s/g,"")};function n(t){return t.constructor?t.constructor.name:null}function o(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:["option"];return i(t,e,n),a(t,e,n),function(t,e,n){var s=r(e),l=r(t);if("object"===s){if("object"!==l)throw new Error("[Type Error]: '".concat(n.join("."),"' require 'object' type, but got '").concat(l,"'"));Object.keys(e).forEach(function(r){var s=t[r],l=e[r],c=n.slice();c.push(r),i(s,l,c),a(s,l,c),o(s,l,c)})}if("array"===s){if("array"!==l)throw new Error("[Type Error]: '".concat(n.join("."),"' require 'array' type, but got '").concat(l,"'"));t.forEach(function(r,s){var l=t[s],c=e[s]||e[0],d=n.slice();d.push(s),i(l,c,d),a(l,c,d),o(l,c,d)})}}(t,e,n),t}function i(t,e,n){if("string"===r(e)){var o=r(t);if("?"===e[0]&&(e=e.slice(1)+"|undefined"),!(-1<e.indexOf("|")?e.split("|").map(function(t){return t.toLowerCase().trim()}).filter(Boolean).some(function(t){return o===t}):e.toLowerCase().trim()===o))throw new Error("[Type Error]: '".concat(n.join("."),"' require '").concat(e,"' type, but got '").concat(o,"'"))}}function a(t,e,n){if("function"===r(e)){var o=e(t,r(t),n);if(!0!==o){var i=r(o);throw"string"===i?new Error(o):"error"===i?o:new Error("[Validator Error]: The scheme for '".concat(n.join("."),"' validator require return true, but got '").concat(o,"'"))}}}return o.kindOf=r,o}()),p.exports);const h=d(f),m="5.4.1";function v(t,e){let r=document.getElementById(t);r||(r=document.createElement("style"),r.id=t,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{document.head.apLine truncated
|
||||
!function(t,e){"object"===typeof exports&&"undefined"!==typeof module?module.exports=e():"function"==typeof define&&define.amd?(t.Artplayer=e(),define(function(){return t.Artplayer})):(t="undefined"!==typeof globalThis?globalThis:t||self).Artplayer=e()}(this,function(){"use strict";var t=Object.defineProperty,e=Object.defineProperties,r=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,a=(e,r,n)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,s=(t,e)=>{for(var r in e||(e={}))o.call(e,r)&&a(t,r,e[r]);if(n)for(var r of n(e))i.call(e,r)&&a(t,r,e[r]);return t},l=(t,n)=>e(t,r(n)),c=(t,e,r)=>new Promise((n,o)=>{var i=t=>{try{s(r.next(t))}catch(e){o(e)}},a=t=>{try{s(r.throw(t))}catch(e){o(e)}},s=t=>t.done?n(t.value):Promise.resolve(t.value).then(i,a);s((r=r.apply(t,e)).next())});function d(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var u,p={exports:{}};var f=(u||(u=1,p.exports=function(){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}var e=Object.prototype.toString,r=function(r){if(void 0===r)return"undefined";if(null===r)return"null";var o=t(r);if("boolean"===o)return"boolean";if("string"===o)return"string";if("number"===o)return"number";if("symbol"===o)return"symbol";if("function"===o)return"GeneratorFunction"===n(r)?"generatorfunction":"function";if(function(t){return Array.isArray?Array.isArray(t):t instanceof Array}(r))return"array";if(function(t){return!(!t.constructor||"function"!=typeof t.constructor.isBuffer)&&t.constructor.isBuffer(t)}(r))return"buffer";if(function(t){try{if("number"==typeof t.length&&"function"==typeof t.callee)return!0}catch(e){if(-1!==e.message.indexOf("callee"))return!0}return!1}(r))return"arguments";if(function(t){return t instanceof Date||"function"==typeof t.toDateString&&"function"==typeof t.getDate&&"function"==typeof t.setDate}(r))return"date";if(function(t){return t instanceof Error||"string"==typeof t.message&&t.constructor&&"number"==typeof t.constructor.stackTraceLimit}(r))return"error";if(function(t){return t instanceof RegExp||"string"==typeof t.flags&&"boolean"==typeof t.ignoreCase&&"boolean"==typeof t.multiline&&"boolean"==typeof t.global}(r))return"regexp";switch(n(r)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(function(t){return"function"==typeof t.throw&&"function"==typeof t.return&&"function"==typeof t.next}(r))return"generator";switch(o=e.call(r)){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return o.slice(8,-1).toLowerCase().replace(/\s/g,"")};function n(t){return t.constructor?t.constructor.name:null}function o(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:["option"];return i(t,e,n),a(t,e,n),function(t,e,n){var s=r(e),l=r(t);if("object"===s){if("object"!==l)throw new Error("[Type Error]: '".concat(n.join("."),"' require 'object' type, but got '").concat(l,"'"));Object.keys(e).forEach(function(r){var s=t[r],l=e[r],c=n.slice();c.push(r),i(s,l,c),a(s,l,c),o(s,l,c)})}if("array"===s){if("array"!==l)throw new Error("[Type Error]: '".concat(n.join("."),"' require 'array' type, but got '").concat(l,"'"));t.forEach(function(r,s){var l=t[s],c=e[s]||e[0],d=n.slice();d.push(s),i(l,c,d),a(l,c,d),o(l,c,d)})}}(t,e,n),t}function i(t,e,n){if("string"===r(e)){var o=r(t);if("?"===e[0]&&(e=e.slice(1)+"|undefined"),!(-1<e.indexOf("|")?e.split("|").map(function(t){return t.toLowerCase().trim()}).filter(Boolean).some(function(t){return o===t}):e.toLowerCase().trim()===o))throw new Error("[Type Error]: '".concat(n.join("."),"' require '").concat(e,"' type, but got '").concat(o,"'"))}}function a(t,e,n){if("function"===r(e)){var o=e(t,r(t),n);if(!0!==o){var i=r(o);throw"string"===i?new Error(o):"error"===i?o:new Error("[Validator Error]: The scheme for '".concat(n.join("."),"' validator require return true, but got '").concat(o,"'"))}}}return o.kindOf=r,o}()),p.exports);const h=d(f),m="5.4.1";function v(t,e){let r=document.getElementById(t);r||(r=document.createElement("style"),r.id=t,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{document.head.apLine truncated
|
||||
+9
-5
@@ -2268,6 +2268,10 @@ function installProgressInteractions(art, $control) {
|
||||
}
|
||||
}
|
||||
const directions = /* @__PURE__ */ new Map([["ArrowRight", 1], ["ArrowUp", 1], ["ArrowLeft", -1], ["ArrowDown", -1], ["PageUp", 10], ["PageDown", -10]]);
|
||||
function updateAttribute(element, name, value) {
|
||||
if (element.getAttribute(name) !== value)
|
||||
element.setAttribute(name, value);
|
||||
}
|
||||
function keyboardSlider(scope, element, label, read, write, orientation = "horizontal") {
|
||||
const valid = (range) => [range.min, range.max, range.value, range.step].every(Number.isFinite) && range.max > range.min && range.step > 0;
|
||||
const clamp2 = (value, range) => Math.min(range.max, Math.max(range.min, value));
|
||||
@@ -2277,11 +2281,11 @@ function keyboardSlider(scope, element, label, read, write, orientation = "horiz
|
||||
const range = read();
|
||||
const enabled = valid(range);
|
||||
const value = enabled ? clamp2(range.value, range) : 0;
|
||||
element.setAttribute("aria-disabled", String(!enabled));
|
||||
element.setAttribute("aria-valuemin", String(enabled ? range.min : 0));
|
||||
element.setAttribute("aria-valuemax", String(enabled ? range.max : 0));
|
||||
element.setAttribute("aria-valuenow", String(value));
|
||||
element.setAttribute("aria-valuetext", range.text(value));
|
||||
updateAttribute(element, "aria-disabled", String(!enabled));
|
||||
updateAttribute(element, "aria-valuemin", String(enabled ? range.min : 0));
|
||||
updateAttribute(element, "aria-valuemax", String(enabled ? range.max : 0));
|
||||
updateAttribute(element, "aria-valuenow", String(value));
|
||||
updateAttribute(element, "aria-valuetext", range.text(value));
|
||||
};
|
||||
if (scope.closed)
|
||||
return update;
|
||||
|
||||
@@ -12,6 +12,11 @@ interface Range {
|
||||
|
||||
const directions = new Map([['ArrowRight', 1], ['ArrowUp', 1], ['ArrowLeft', -1], ['ArrowDown', -1], ['PageUp', 10], ['PageDown', -10]])
|
||||
|
||||
function updateAttribute(element: HTMLElement, name: string, value: string): void {
|
||||
if (element.getAttribute(name) !== value)
|
||||
element.setAttribute(name, value)
|
||||
}
|
||||
|
||||
export function keyboardSlider(scope: ResourceScope, element: HTMLElement, label: string, read: () => Range, write: (value: number) => void, orientation = 'horizontal'): () => void {
|
||||
const valid = (range: Range) => [range.min, range.max, range.value, range.step].every(Number.isFinite) && range.max > range.min && range.step > 0
|
||||
const clamp = (value: number, range: Range) => Math.min(range.max, Math.max(range.min, value))
|
||||
@@ -21,11 +26,11 @@ export function keyboardSlider(scope: ResourceScope, element: HTMLElement, label
|
||||
const range = read()
|
||||
const enabled = valid(range)
|
||||
const value = enabled ? clamp(range.value, range) : 0
|
||||
element.setAttribute('aria-disabled', String(!enabled))
|
||||
element.setAttribute('aria-valuemin', String(enabled ? range.min : 0))
|
||||
element.setAttribute('aria-valuemax', String(enabled ? range.max : 0))
|
||||
element.setAttribute('aria-valuenow', String(value))
|
||||
element.setAttribute('aria-valuetext', range.text(value))
|
||||
updateAttribute(element, 'aria-disabled', String(!enabled))
|
||||
updateAttribute(element, 'aria-valuemin', String(enabled ? range.min : 0))
|
||||
updateAttribute(element, 'aria-valuemax', String(enabled ? range.max : 0))
|
||||
updateAttribute(element, 'aria-valuenow', String(value))
|
||||
updateAttribute(element, 'aria-valuetext', range.text(value))
|
||||
}
|
||||
if (scope.closed)
|
||||
return update
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,64 @@
|
||||
# MOD-03 进度与音量 ARIA 更新检查点
|
||||
|
||||
MOD-03保持doing。本轮处理已经进入播放热路径的重复DOM写入,尚未完成该任务要求的
|
||||
初始化、持久化、全部DOM读写及正式安装包BASE-06配对验收。ENG-PERF-01/02不关闭。
|
||||
|
||||
## 实现与兼容边界
|
||||
|
||||
`accessibility/slider.ts`每次刷新仍读取完整range、校验有限数值并计算显示文本。
|
||||
仅把五个动态ARIA属性改成与当前getAttribute值比较后再写入;辅助函数不导出,
|
||||
不添加实例字段、不跨事件缓存、不延后更新。外部修改或删除属性仍在下一刷新修复。
|
||||
范围/步长/禁用逻辑、键盘动作、焦点、公开媒体/进度事件、声明及DOM/CSS名称保持。
|
||||
|
||||
这是减少冗余DOM变更的内部优化。观察这些ARIA属性的MutationObserver将不再收到
|
||||
值完全不变的重复记录,实际值变更仍会记录;不能声称MutationObserver记录序列
|
||||
完全不变。这些键盘ARIA是本次重构增加的能力,不是静默删掉已发布的播放器事件。
|
||||
没有修改公共setStyle、Storage方法、autoPlayback写入频率或原生媒体时钟。
|
||||
|
||||
不缓存上次range:它可能由外部代码改变,不缓存已写文本:外部代码可能修改DOM。
|
||||
这样保留动态行为,代价是每次仍进行五次轻量属性读取;不产生布局尺寸读取。
|
||||
|
||||
## 验证设计
|
||||
|
||||
Node新用例在旧源码明确失败:重复update产生10次属性写入;其余10项旧键盘/范围/
|
||||
清理用例通过。新实现11项通过,并覆盖只改变小数值、显示文本改变、外部DOM修复、
|
||||
每次调用文本格式器及销毁后无更新。全项目2859项单元测试通过,严格核心TS和lint通过。
|
||||
|
||||
`test/browser/slider-updates.spec.js`默认验证当前候选,显式
|
||||
ARTPLAYER_SLIDER_BASELINE增加修改前真实产物对照。每个引擎运行三组,按旧新/新旧/
|
||||
旧新顺序;两边使用相同本地pattern.mp4和viewport,各自重新导航、创建并实际播放。
|
||||
旧产物冻结自Git `7b0e1d156b8e21e422200ee345afa63950f9d5a2`,不是npm发布基线。
|
||||
旧脚本通过单个路由替换,附件单独保存该文件和SHA;server manifest仍描述候选路由
|
||||
原始文件,不能将其误当为替换后旧脚本的身份。
|
||||
|
||||
计时阶段暂停原生video,预热300个合成timeupdate,再记录五组各1000次的原始耗时。
|
||||
没有在计时循环安装MutationObserver。随后单独用原生观察器统计100次重复事件,
|
||||
验证公开订阅仍收到每次事件,并核对外部ARIA改写恢复。最后恢复真实播放,观察
|
||||
真实timeupdate和ARIA数值,静态范围属性不应重复写入。这些计时只代表合成重复
|
||||
事件的执行成本,不是帧率、输入延迟或真实页面端到端性能。
|
||||
|
||||
main/legacy各三引擎×三组通过;全部重复事件窗口均由500次ARIA写入降到0,
|
||||
外部修复由5次降到2次,实际播放继续更新valuenow。主构建真实播放窗口中,旧版
|
||||
4–5个媒体事件产生20–25次属性变更,候选相应窗口为4–5次;窗口事件数并非全部
|
||||
相等,因此不以合计总数计算统一百分比。
|
||||
|
||||
主构建1000次合成事件的各组中位数:Chromium旧4.6–5.2ms、新3.2–3.6ms;
|
||||
Firefox旧9–10ms、新7–8ms;WebKit旧9–10ms、新7–10ms,其中第二组候选10ms
|
||||
比旧9ms慢。保留所有原始样本,不把操作数量下降等同所有环境计时都改善。
|
||||
legacy的完整配对值同样保留在机器记录中,不按有利组筛选。
|
||||
|
||||
## 构建成本与继续工作
|
||||
|
||||
由正常`yarn build artplayer --analyze`和`yarn build:i18n`生成三种产物及docs副本,
|
||||
没有手写产物。相较修改前,现代raw +12/gzip9 +10/Brotli6 +12字节;legacy
|
||||
+12/+17/+11;ESM +154/+34/+44。此项是热路径更新优化,不是体积优化。
|
||||
现代当前208943 raw / 58756 gzip9仍高于已发布5.4.0的134037 / 35486,原阈值不变。
|
||||
|
||||
本次浏览器验收包含普通键盘/进度/音量及回调清理,具体最终执行范围、报告和文件
|
||||
指纹见[机器记录](../baselines/slider-updates-validation.json)。未运行此次候选的完整
|
||||
真实安装/初始化配对、物理设备或远端CI;旧安装证据不自动覆盖此次候选。
|
||||
|
||||
接下来继续MOD-03的持久化/初始化/布局测量,再使用新的实际安装包完成正式三组
|
||||
BASE-06性能/资源对比。不能通过提高阈值、节流公开事件、延迟销毁或删除兼容逻辑
|
||||
制造收益。回退本检查点并正常重建核心/i18n可恢复旧的冗余写入行为;不涉及依赖、
|
||||
版本或公开声明变更,没有推送或发布。
|
||||
@@ -2,6 +2,11 @@
|
||||
|
||||
本文由 ENG-08 维护。覆盖率和资源/性能配对链路已通过工程验收,见 [冻结证据](baselines/quality-validation.json)。报告工具通过不等于核心或发布验收通过。
|
||||
|
||||
MOD-03的[slider更新检查点](changes/2026-09-14-MOD-03-slider-updates.md)增加了正式
|
||||
main/legacy三组交替的重复事件诊断,减少不变ARIA属性写入。其合成事件计时与
|
||||
真实播放的DOM记录分开保存;不替代下文要求的实际安装包初始化/资源配对,也
|
||||
不关闭既有体积/计时风险。新候选的完整门槛仍须重新执行。
|
||||
|
||||
## Node 单元覆盖率
|
||||
|
||||
使用固定 Node 24.21.0、Yarn 1.22.22,运行 `yarn test:coverage`。新增开发依赖 c8 12.0.0 仅在仓库测试中使用,不进入发布包的运行时依赖。版本由根 package.json 和 yarn.lock 固定。
|
||||
|
||||
+3
-2
@@ -4,7 +4,7 @@
|
||||
|
||||
基线:`40fcda6a37d0049d42e49c1e64e70d4fd9ba5f7f`。总任务 254 项,范围 22 个包及工作区/示例。
|
||||
|
||||
状态:todo 54 / doing 17 / blocked 0 / done 183 / deferred 0。风险 L/M/H 表示兼容风险,不表示工期。
|
||||
状态:todo 53 / doing 18 / blocked 0 / done 183 / deferred 0。风险 L/M/H 表示兼容风险,不表示工期。
|
||||
|
||||
前置依赖是启动条件;验收是完成条件。任务可以继续拆分,但不能复用或悄悄删除旧 ID。
|
||||
|
||||
@@ -412,7 +412,7 @@
|
||||
| MOD-PLUGIN-01 | workspace<br>迁移插件生成器与类型化模板 | ENG-06, SITE-03 | 保留 create:plugin CLI;纯渲染/文件发布边界、TS 工厂/声明/测试/示例及维护指南 | 防止覆盖现有包或示例;失败回退;生成包可构建并通过严格类型、旧模块消费及测试;不自动修改既有包或运行安装发布 | M | done |
|
||||
| MOD-02 | workspace<br>整理剩余开发/构建脚本与插件模板 | ENG-06, SITE-03, MOD-PLUGIN-01 | dev/build/utils/create-plugin 的 TS 与可测 CLI,模板同时提供旧 API | 旧脚本入口保留、新插件类型/测试/示例齐全,Lerna 改动单独取证 | M | done |
|
||||
| MOD-DEV-01 | workspace<br>修复开发服务器失败状态并明确资源生命周期 | MOD-02 | 修复 Servor 占用端口却退出 0 的已复现问题;明确 HTTP/监听/热刷新连接与定时器的启动、失败和关闭责任 | 保持默认 8082、docs 页面、自动刷新和旧 dev 命令;端口冲突退出非零且不终止其他服务,连续启动/停止及编译错误恢复有实际验证;跨平台监听差异单独留证 | M | done |
|
||||
| MOD-03 | workspace<br>测量并优化核心热路径 | CORE-22, ENG-08 | DOM 读写、进度更新、持久化、初始化的测量与改进 | 相同设备媒体多次比较,契约不变,收益及无效尝试记录;复用 BASE-06 的原始样本与测量限制,至少三组同环境旧新配对,不以单次变快宣称收益 | M | todo |
|
||||
| MOD-03 | workspace<br>测量并优化核心热路径 | CORE-22, ENG-08 | DOM 读写、进度更新、持久化、初始化的测量与改进 | 相同设备媒体多次比较,契约不变,收益及无效尝试记录;复用 BASE-06 的原始样本与测量限制,至少三组同环境旧新配对,不以单次变快宣称收益 | M | doing |
|
||||
| MOD-04 | workspace<br>测量并优化重型插件/proxy | PKG-DANMUKU-09, PKG-MASK-06, PKG-MB-10, ENG-08 | 帧/队列/推理/音画同步与资源长期运行比较 | 不改默认算法/阈值,性能改善有证据;无收益则保留旧实现 | M | todo |
|
||||
| MOD-05 | workspace<br>完成工具链与性能采用决策 | MOD-01, MOD-02, MOD-03, MOD-04, MOD-DEV-01 | 最终 runtime/packageManager/构建配置及性能台账 | 干净安装和全包检查通过;Bun 未采用有理由,不为状态强行切换 | M | todo |
|
||||
|
||||
@@ -636,6 +636,7 @@
|
||||
- MOD-PLUGIN-01: [记录](changes/2026-09-14-MOD-PLUGIN-01-scaffold.md) [记录](baselines/scaffold-validation.json)
|
||||
- MOD-02: [记录](changes/2026-09-14-MOD-02-library-tooling.md) [记录](baselines/library-tooling-validation.json)
|
||||
- MOD-DEV-01: [记录](changes/2026-09-14-MOD-DEV-01-dev-server.md) [记录](baselines/dev-server-validation.json)
|
||||
- MOD-03: [记录](changes/2026-09-14-MOD-03-slider-updates.md) [记录](baselines/slider-updates-validation.json)
|
||||
- REL-08: [记录](changes/2026-09-14-REL-08-release-ledger.md) [记录](baselines/release-ledger-validation.json) [记录](release-ledger.md) [记录](release-ledger.json)
|
||||
- PKG-FACTORY-01: [记录](baselines/factory-assignment-gaps.json) [记录](baselines/factory-compatibility-proposals.json) [记录](factory-compatibility-decision.md) [记录](changes/2026-09-12-PKG-FACTORY-01-decision.md) [记录](type-compatibility-policy.md) [记录](baselines/factory-compatibility-validation.json) [记录](changes/2026-09-13-PKG-FACTORY-01-compatible-types.md)
|
||||
- CORE-25: [记录](changes/2026-09-13-CORE-25-defaults-ssr.md) [记录](baselines/defaults-ssr-validation.json)
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
# 进度与证据
|
||||
|
||||
## MOD-03 进度/音量重复ARIA写入优化检查点(仍doing)
|
||||
|
||||
核心slider保留每次读取range/文本、即时更新和外部DOM修复,仅在属性值实际改变
|
||||
时写入。新受控回归旧10通过1失败、新11通过;全项目2859项单元、严格核心TS、
|
||||
lint、37份声明无漂移和工具链通过。main/legacy三引擎各三组旧新交替配对全部
|
||||
通过,100次重复事件的ARIA变更由500次降到0;实际播放仍更新进度数值。
|
||||
main另有54项新旧进度/质量/键盘回归,legacy另有12项键盘/音量回归通过。
|
||||
计时保留原始值,含变慢组;这些是合成重复事件诊断,不是整体帧率或正式
|
||||
BASE-06安装包性能准入。现代gzip增加10字节,原体积及间歇计时风险保持open。
|
||||
见[变更](changes/2026-09-14-MOD-03-slider-updates.md)及
|
||||
[证据](baselines/slider-updates-validation.json)。正常构建同步三格式/docs并恢复i18n。
|
||||
254项:183 done、18 doing、53 todo;MOD-03仍需持久化、初始化/布局热点和新的
|
||||
实际安装包三组完整性能/资源对比。没有调整公开事件频率、默认行为、依赖或版本。
|
||||
|
||||
## PKG-JASSUB-10 绘制异常后的位图释放完成
|
||||
|
||||
主线程asyncRender在清屏、调整尺寸或绘制抛错时,现在通过finally释放整批收到的
|
||||
|
||||
+8
-4
@@ -22,11 +22,13 @@
|
||||
"refactor/baselines/core-setting-navigation-partial.json",
|
||||
"refactor/changes/2026-09-11-CORE-22-core-acceptance.md",
|
||||
"refactor/core-acceptance.md",
|
||||
"refactor/baselines/core-acceptance-validation.json"
|
||||
"refactor/baselines/core-acceptance-validation.json",
|
||||
"refactor/changes/2026-09-14-MOD-03-slider-updates.md",
|
||||
"refactor/baselines/slider-updates-validation.json"
|
||||
],
|
||||
"compatibleResolution": "Attribute the growth to actual modules and build output, remove avoidable overhead while preserving APIs, and document any justified remaining cost against matching published entries.",
|
||||
"closureCriteria": "Fresh isolated artifacts have reproducible raw/gzip9/Brotli6 results and an explicit size review; do not raise or overwrite the historical threshold to pass.",
|
||||
"workspaceState": "First ENG-08 modern core measurement: 134037 to 207875 raw bytes, 35486 to 58374 gzip9, 32533 to 53326 Brotli6. Chapter remains below the combined relative/absolute review threshold. This is a review requirement, not a release approval. CORE-22 navigation phase: 208030 raw / 58429 gzip9 / 53361 Brotli6 modern bytes. Preferred-target revalidation removes a second panel scan at a cost of 55 gzip bytes over ENG-08; it does not resolve total bundle growth. Final CORE-22: modern 208037 raw / 58434 gzip9 / 53372 Brotli6; legacy 212218 / 59686 / 54412; ESM 361496 / 77141 / 70030. Navigation and initial-layout work were reduced, but total size remains above the historical threshold. MOD-03 and REVIEW-01 must review this before release."
|
||||
"workspaceState": "First ENG-08 modern core measurement: 134037 to 207875 raw bytes, 35486 to 58374 gzip9, 32533 to 53326 Brotli6. Chapter remains below the combined relative/absolute review threshold. This is a review requirement, not a release approval. CORE-22 navigation phase: 208030 raw / 58429 gzip9 / 53361 Brotli6 modern bytes. Preferred-target revalidation removes a second panel scan at a cost of 55 gzip bytes over ENG-08; it does not resolve total bundle growth. Final CORE-22: modern 208037 raw / 58434 gzip9 / 53372 Brotli6; legacy 212218 / 59686 / 54412; ESM 361496 / 77141 / 70030. Navigation and initial-layout work were reduced, but total size remains above the historical threshold. MOD-03 and REVIEW-01 must review this before release. MOD-03 slider checkpoint: dynamic ARIA writes compare actual DOM before mutation. Main/legacy three paired groups per desktop engine pass operation/native-playback checks. Synthetic repeated-event timings include slower groups; main is 208943 raw / 58756 gzip9 / 53660 Brotli6, +10 gzip bytes from the immediate prechange artifact. Full installed BASE-06 pairing and remaining hotspots are still outstanding; this risk stays open."
|
||||
},
|
||||
{
|
||||
"id": "ENG-PERF-02",
|
||||
@@ -45,11 +47,13 @@
|
||||
"refactor/baselines/core-setting-navigation-partial.json",
|
||||
"refactor/changes/2026-09-11-CORE-22-core-acceptance.md",
|
||||
"refactor/core-acceptance.md",
|
||||
"refactor/baselines/core-acceptance-validation.json"
|
||||
"refactor/baselines/core-acceptance-validation.json",
|
||||
"refactor/changes/2026-09-14-MOD-03-slider-updates.md",
|
||||
"refactor/baselines/slider-updates-validation.json"
|
||||
],
|
||||
"compatibleResolution": "Repeat paired measurements on the same environment, distinguish initialization and teardown work from host jitter, and optimize only after identifying a reproducible cost.",
|
||||
"closureCriteria": "Explain repeat-group timing signals with retained samples and source fingerprints; do not infer a regression or improvement from a single group or expand timing allowances.",
|
||||
"workspaceState": "First ENG-08 run: Firefox group 2 had core/chapter constructor delta 3/5 ms, WebKit group 3 chapter delta 3 ms, versus 2 ms absolute allowance. Other groups did not trigger. Candidate resource checks passed independently. Final run: Chromium/Firefox had no timing signals; WebKit group 1 core/chapter each increased 3 ms, with no signals in the other two groups. The intermittent review remains open. CORE-22 navigation phase: Chromium group 1 core/chapter destroy deltas 3.1/2.5 ms and group 3 chapter constructor delta 2.8 ms; WebKit group 1 chapter destroy delta 27 ms (71 to 98 ms); Firefox has no timing signals. Other groups do not reproduce those destroy signals. All 54 candidate resource probes pass. The timed fixture uses default settings disabled, so these measurements do not establish any timing effect from setting navigation changes. Final CORE-22: no constructor timing signals in any of the three engines; Chromium/Firefox have no timing signals. WebKit group 1 chapter destruction delta 44 ms and group 2 core delta 30 ms remain, group 3 has no signal. All 54 candidate resource probes pass. Chromium sampling identifies native load/DOM teardown cost but does not establish the cause of WebKit signals. MOD-03/REVIEW-01 retain the open review without changing allowances."
|
||||
"workspaceState": "First ENG-08 run: Firefox group 2 had core/chapter constructor delta 3/5 ms, WebKit group 3 chapter delta 3 ms, versus 2 ms absolute allowance. Other groups did not trigger. Candidate resource checks passed independently. Final run: Chromium/Firefox had no timing signals; WebKit group 1 core/chapter each increased 3 ms, with no signals in the other two groups. The intermittent review remains open. CORE-22 navigation phase: Chromium group 1 core/chapter destroy deltas 3.1/2.5 ms and group 3 chapter constructor delta 2.8 ms; WebKit group 1 chapter destroy delta 27 ms (71 to 98 ms); Firefox has no timing signals. Other groups do not reproduce those destroy signals. All 54 candidate resource probes pass. The timed fixture uses default settings disabled, so these measurements do not establish any timing effect from setting navigation changes. Final CORE-22: no constructor timing signals in any of the three engines; Chromium/Firefox have no timing signals. WebKit group 1 chapter destruction delta 44 ms and group 2 core delta 30 ms remain, group 3 has no signal. All 54 candidate resource probes pass. Chromium sampling identifies native load/DOM teardown cost but does not establish the cause of WebKit signals. MOD-03/REVIEW-01 retain the open review without changing allowances. MOD-03 slider checkpoint: dynamic ARIA writes compare actual DOM before mutation. Main/legacy three paired groups per desktop engine pass operation/native-playback checks. Synthetic repeated-event timings include slower groups; main is 208943 raw / 58756 gzip9 / 53660 Brotli6, +10 gzip bytes from the immediate prechange artifact. Full installed BASE-06 pairing and remaining hotspots are still outstanding; this risk stays open."
|
||||
},
|
||||
{
|
||||
"id": "BASE-LIFE-06",
|
||||
|
||||
+5
-2
@@ -4537,11 +4537,14 @@
|
||||
"CORE-22",
|
||||
"ENG-08"
|
||||
],
|
||||
"status": "todo",
|
||||
"status": "doing",
|
||||
"risk": "M",
|
||||
"deliverable": "DOM 读写、进度更新、持久化、初始化的测量与改进",
|
||||
"acceptance": "相同设备媒体多次比较,契约不变,收益及无效尝试记录;复用 BASE-06 的原始样本与测量限制,至少三组同环境旧新配对,不以单次变快宣称收益",
|
||||
"evidence": []
|
||||
"evidence": [
|
||||
"changes/2026-09-14-MOD-03-slider-updates.md",
|
||||
"baselines/slider-updates-validation.json"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "MOD-04",
|
||||
|
||||
@@ -40,6 +40,41 @@ function fixture() {
|
||||
return { scope, element, range, values, update }
|
||||
}
|
||||
|
||||
test('slider refreshes live values without rewriting unchanged ARIA attributes', () => {
|
||||
const f = fixture()
|
||||
const writes = []
|
||||
const setAttribute = f.element.setAttribute.bind(f.element)
|
||||
f.element.setAttribute = (name, value) => {
|
||||
writes.push([name, value])
|
||||
setAttribute(name, value)
|
||||
}
|
||||
let reads = 0
|
||||
f.range.text = (value) => {
|
||||
reads++
|
||||
return `${Math.floor(value)}%`
|
||||
}
|
||||
f.update()
|
||||
f.update()
|
||||
assert.equal(reads, 2)
|
||||
assert.deepEqual(writes, [])
|
||||
f.range.value = 50.25
|
||||
f.update()
|
||||
assert.deepEqual(writes.splice(0), [['aria-valuenow', '50.25']])
|
||||
f.range.value = 51
|
||||
f.update()
|
||||
assert.deepEqual(writes.splice(0), [['aria-valuenow', '51'], ['aria-valuetext', '51%']])
|
||||
// Read the actual DOM each time; callers can edit or remove these attributes.
|
||||
setAttribute('aria-valuemax', '999')
|
||||
f.element.attributes.delete('aria-disabled')
|
||||
f.update()
|
||||
assert.deepEqual(writes.splice(0), [['aria-disabled', 'false'], ['aria-valuemax', '100']])
|
||||
f.scope.dispose()
|
||||
f.range.value = 75
|
||||
f.update()
|
||||
assert.equal(reads, 5)
|
||||
assert.deepEqual(writes, [])
|
||||
})
|
||||
|
||||
test('slider keys repeat, clamp and expose the value actually written', () => {
|
||||
const f = fixture()
|
||||
for (const [key, value] of [['ArrowRight', 55], ['ArrowUp', 60], ['ArrowLeft', 55], ['ArrowDown', 50], ['PageUp', 100], ['PageDown', 50], ['Home', 0], ['End', 100], ['ArrowUp', 100]]) {
|
||||
|
||||
@@ -223,6 +223,14 @@ public resize(force) verifies a visible subtitle again. Select actual main/legac
|
||||
with ARTPLAYER_JASSUB_ARTIFACT. This main-thread fault injection does not reproduce
|
||||
spontaneous Worker corruption or resolve the separate Firefox offscreen stall.
|
||||
|
||||
`slider-updates.spec.js` checks live progress ARIA, external attribute repair and
|
||||
duplicate-event mutation counts. ARTPLAYER_SLIDER_BASELINE optionally supplies a
|
||||
prechange core script for three alternating paired groups. The regular candidate
|
||||
comes from the browser server, including ARTPLAYER_BROWSER_ARTIFACTS when supplied.
|
||||
Five timings of 1000 synthetic paused updates follow a 300-update warmup; operation
|
||||
counts and actual playback are measured separately. Keep raw samples and do not
|
||||
interpret these diagnostics as full initialization/resource or playback-FPS gates.
|
||||
|
||||
JASSUB Firefox diagnostics retain the canonical failing cases. Set
|
||||
`ARTPLAYER_JASSUB_OFFSCREEN=default` to exercise native capability selection.
|
||||
`ARTPLAYER_JASSUB_ASYNC_RENDER=false` explicitly selects synchronous rendering;
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
import fs from 'node:fs'
|
||||
import process from 'node:process'
|
||||
import { hash } from '../../refactor/scripts/releases.mjs'
|
||||
import { expect, test } from './fixtures.js'
|
||||
|
||||
const baseline = process.env.ARTPLAYER_SLIDER_BASELINE
|
||||
const before = baseline ? fs.readFileSync(baseline, 'utf8') : undefined
|
||||
const attributes = ['aria-disabled', 'aria-valuemin', 'aria-valuemax', 'aria-valuenow', 'aria-valuetext']
|
||||
|
||||
for (let group = 0; group < 3; group++) {
|
||||
test(`slider DOM updates and duplicate-event timing group ${group + 1}`, async ({ page }, testInfo) => {
|
||||
const results = []
|
||||
const variants = before ? (group % 2 ? ['candidate', 'before'] : ['before', 'candidate']) : ['candidate']
|
||||
for (const variant of variants) {
|
||||
if (variant === 'before')
|
||||
await page.route('**/candidate/artplayer.js', route => route.fulfill({ contentType: 'text/javascript', body: before }))
|
||||
else
|
||||
await page.unroute('**/candidate/artplayer.js')
|
||||
await page.goto('/test/player.html?core=candidate&chapter=published')
|
||||
await page.evaluate(() => window.createPlayer('/test/pattern.mp4'))
|
||||
await page.locator('#play').click()
|
||||
await expect.poll(() => page.evaluate(() => window.art.currentTime)).toBeGreaterThan(0.2)
|
||||
await page.evaluate(() => window.art.pause())
|
||||
const result = await page.evaluate((attributes) => {
|
||||
const art = window.art
|
||||
const element = document.querySelector('.art-control-progress')
|
||||
const refresh = () => art.emit('video:timeupdate', new Event('timeupdate'))
|
||||
refresh()
|
||||
const initial = Object.fromEntries(attributes.map(name => [name, element.getAttribute(name)]))
|
||||
// Keep MutationObserver out of the timing loop: these are synthetic duplicate events.
|
||||
for (let i = 0; i < 300; i++)
|
||||
refresh()
|
||||
const timings = []
|
||||
for (let sample = 0; sample < 5; sample++) {
|
||||
const started = performance.now()
|
||||
for (let i = 0; i < 1000; i++)
|
||||
refresh()
|
||||
timings.push(performance.now() - started)
|
||||
}
|
||||
const observer = new MutationObserver(() => {})
|
||||
observer.observe(element, { attributes: true, attributeFilter: attributes })
|
||||
let events = 0
|
||||
const count = () => events++
|
||||
art.on('video:timeupdate', count)
|
||||
for (let i = 0; i < 100; i++)
|
||||
refresh()
|
||||
const duplicates = observer.takeRecords().map(record => record.attributeName)
|
||||
// External DOM changes must still be repaired on the next refresh.
|
||||
element.setAttribute('aria-valuemax', '999')
|
||||
element.removeAttribute('aria-disabled')
|
||||
observer.takeRecords()
|
||||
refresh()
|
||||
const repaired = observer.takeRecords().map(record => record.attributeName)
|
||||
const final = Object.fromEntries(attributes.map(name => [name, element.getAttribute(name)]))
|
||||
observer.disconnect()
|
||||
art.off('video:timeupdate', count)
|
||||
window.sliderNativeUpdates = { updates: [], events: 0 }
|
||||
const nativeObserver = new MutationObserver(records => window.sliderNativeUpdates.updates.push(...records.map(record => record.attributeName)))
|
||||
nativeObserver.observe(element, { attributes: true, attributeFilter: attributes })
|
||||
const nativeCount = () => window.sliderNativeUpdates.events++
|
||||
art.on('video:timeupdate', nativeCount)
|
||||
window.finishSliderNativeUpdates = () => {
|
||||
window.sliderNativeUpdates.updates.push(...nativeObserver.takeRecords().map(record => record.attributeName))
|
||||
nativeObserver.disconnect()
|
||||
art.off('video:timeupdate', nativeCount)
|
||||
return { ...window.sliderNativeUpdates, value: Number(element.getAttribute('aria-valuenow')), time: art.currentTime }
|
||||
}
|
||||
return { initial, final, timings, duplicates, repaired, events, time: art.currentTime, duration: art.duration }
|
||||
}, attributes)
|
||||
await page.locator('#play').click()
|
||||
await expect.poll(() => page.evaluate(() => window.art.currentTime)).toBeGreaterThan(result.time + 0.8)
|
||||
await page.evaluate(() => window.art.pause())
|
||||
const native = await page.evaluate(() => window.finishSliderNativeUpdates())
|
||||
const record = { group, variant, before: variant === 'before' ? { file: baseline, sha256: hash(before) } : null, result, native }
|
||||
results.push(record)
|
||||
try {
|
||||
expect(result.events).toBe(101)
|
||||
expect(result.final).toEqual(result.initial)
|
||||
expect(Number(result.final['aria-valuemax'])).toBe(result.duration)
|
||||
expect(result.duplicates).toHaveLength(variant === 'before' ? 500 : 0)
|
||||
expect(result.repaired).toEqual(variant === 'before' ? attributes : ['aria-disabled', 'aria-valuemax'])
|
||||
expect(native.events).toBeGreaterThan(0)
|
||||
expect(Math.abs(native.value - native.time)).toBeLessThan(0.3)
|
||||
if (variant === 'candidate') {
|
||||
expect(native.updates).not.toContain('aria-disabled')
|
||||
expect(native.updates).not.toContain('aria-valuemin')
|
||||
expect(native.updates).not.toContain('aria-valuemax')
|
||||
expect(native.updates).toContain('aria-valuenow')
|
||||
}
|
||||
}
|
||||
finally {
|
||||
await page.evaluate(() => window.art.destroy(false))
|
||||
await testInfo.attach(`slider-updates-${variant}`, { contentType: 'application/json', body: JSON.stringify(record) })
|
||||
}
|
||||
}
|
||||
await testInfo.attach('slider-paired-summary', { contentType: 'application/json', body: JSON.stringify({ results, limitation: 'Three alternating same-engine groups when a baseline artifact is supplied; 300-event warmup plus five samples of 1000 synthetic paused timeupdate events, without a MutationObserver in the timed loop. Separate DOM operation counts and actual native playback checks. Not total playback FPS, input latency or full BASE-06 initialization/resource acceptance.' }) })
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user