MDL-75278 VideoJS: Update VideoJS to use validation helper

This commit is contained in:
Stevani Andolo
2022-11-08 13:54:20 +00:00
committed by Jenkins
parent ec65857de0
commit d0e63f5a60
4 changed files with 67 additions and 27 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+57 -23
View File
@@ -3512,6 +3512,7 @@
_proto.createEl = function createEl$1(tagName, properties, attributes) {
return createEl(tagName, properties, attributes);
}
/**
* Localize a string given the string in english.
*
@@ -18039,13 +18040,23 @@
var _proto = MenuItem.prototype;
_proto.createEl = function createEl(type, props, attrs) {
// The control is textual, not just an icon
this.nonIconControl = true;
return _ClickableComponent.prototype.createEl.call(this, 'li', assign({
var el = _ClickableComponent.prototype.createEl.call(this, type, props, attrs);
var parentSpan = _ClickableComponent.prototype.createEl.call(this, 'li', assign({
className: 'vjs-menu-item',
innerHTML: "<span class=\"vjs-menu-item-text\">" + this.localize(this.options_.label) + "</span>",
tabIndex: -1
}, props), attrs);
parentSpan.appendChild(_ClickableComponent.prototype.createEl.call(this, 'span', {
className: 'vjs-icon-placeholder'
}, {
'aria-hidden': true
}));
parentSpan.appendChild(_ClickableComponent.prototype.createEl.call(this, 'span', {
className: 'vjs-control-text',
textContent: this.localize(this.options_.label)
}));
return el;
}
/**
* Ignore keys which are used by the menu, but pass any other ones up. See
@@ -19109,19 +19120,23 @@
var _proto = SubsCapsMenuItem.prototype;
_proto.createEl = function createEl(type, props, attrs) {
var innerHTML = "<span class=\"vjs-menu-item-text\">" + this.localize(this.options_.label);
var el = _TextTrackMenuItem.prototype.createEl.call(this, type, props, attrs);
var parentSpan = el.querySelector('.vjs-menu-item-text');
if (this.options_.track.kind === 'captions') {
innerHTML += "\n <span aria-hidden=\"true\" class=\"vjs-icon-placeholder\"></span>\n <span class=\"vjs-control-text\"> " + this.localize('Captions') + "</span>\n ";
parentSpan.appendChild(createEl('span', {
className: 'vjs-icon-placeholder'
}, {
'aria-hidden': true
}));
parentSpan.appendChild(createEl('span', {
className: 'vjs-control-text',
// space added as the text will visually flow with the
// label
textContent: " " + this.localize('Captions')
}));
}
innerHTML += '</span>';
var el = _TextTrackMenuItem.prototype.createEl.call(this, type, assign({
innerHTML: innerHTML
}, props), attrs);
return el;
};
return SubsCapsMenuItem;
@@ -19270,18 +19285,22 @@
var _proto = AudioTrackMenuItem.prototype;
_proto.createEl = function createEl(type, props, attrs) {
var innerHTML = "<span class=\"vjs-menu-item-text\">" + this.localize(this.options_.label);
var el = _MenuItem.prototype.createEl.call(this, type, props, attrs);
var parentSpan = el.querySelector('.vjs-menu-item-text');
if (this.options_.track.kind === 'main-desc') {
innerHTML += "\n <span aria-hidden=\"true\" class=\"vjs-icon-placeholder\"></span>\n <span class=\"vjs-control-text\"> " + this.localize('Descriptions') + "</span>\n ";
parentSpan.appendChild(_MenuItem.prototype.createEl.call(this, 'span', {
className: 'vjs-icon-placeholder'
}, {
'aria-hidden': true
}));
parentSpan.appendChild(_MenuItem.prototype.createEl.call(this, 'span', {
className: 'vjs-control-text',
textContent: this.localize('Descriptions')
}));
}
innerHTML += '</span>';
var el = _MenuItem.prototype.createEl.call(this, type, assign({
innerHTML: innerHTML
}, props), attrs);
return el;
}
/**
@@ -33106,7 +33125,22 @@
return buf.push(' ', node.name, '="', node.value.replace(/[<&"]/g, _xmlEncoder), '"');
case TEXT_NODE:
return buf.push(node.data.replace(/[<&]/g, _xmlEncoder));
/**
* The ampersand character (&) and the left angle bracket (<) must not appear in their literal form,
* except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section.
* If they are needed elsewhere, they must be escaped using either numeric character references or the strings
* `&amp;` and `&lt;` respectively.
* The right angle bracket (>) may be represented using the string " &gt; ", and must, for compatibility,
* be escaped using either `&gt;` or a character reference when it appears in the string `]]>` in content,
* when that string is not marking the end of a CDATA section.
*
* In the content of elements, character data is any string of characters
* which does not contain the start-delimiter of any markup
* and does not include the CDATA-section-close delimiter, `]]>`.
*
* @see https://www.w3.org/TR/xml/#NT-CharData
*/
return buf.push(node.data.replace(/[<&]/g, _xmlEncoder).replace(/]]>/g, ']]&gt;'));
case CDATA_SECTION_NODE:
return buf.push('<![CDATA[', node.data, ']]>');
+7 -1
View File
@@ -61,4 +61,10 @@ Import plugins:
with
var OGVCompat__default = /*#__PURE__*/_interopDefaultLegacy(ogvBase.OGVCompat);
var OGVLoader__default = /*#__PURE__*/_interopDefaultLegacy(ogvBase.OGVLoader);
var OGVPlayer__default = /*#__PURE__*/_interopDefaultLegacy(ogvBase.OGVPlayer);
var OGVPlayer__default = /*#__PURE__*/_interopDefaultLegacy(ogvBase.OGVPlayer);
Changes:
In order to improve the validation, a couple of minor changes have been added to the video-lazy.js:
1. Partial upgrade from VideoJS 7.17.0 for 'Subtitles' label check in 18043 - 18059
2. Partial upgrade from VideoJS 7.17.0 for 'Captions' label check from 19123 - 19138
3. Partial upgrade from VideoJS 7.17.0 for 'Description' label check from 19288 - 19302