Remove logic for custom built-ins (killed by safari iirc)
This commit is contained in:
parent
9bc3ce6ae7
commit
8ec8218e90
1 changed files with 2 additions and 26 deletions
28
render.js
28
render.js
|
@ -35,13 +35,6 @@ const snakeToCSS = key => key.replace(/^[A-Z]/, a => "-" + a).replace(/[A-Z]/g,
|
||||||
* @property {function(Node):boolean} [filter]
|
* @property {function(Node):boolean} [filter]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a fallback if value is fallback
|
|
||||||
* @param {any} value
|
|
||||||
* @param {any} whenUndefined
|
|
||||||
*/
|
|
||||||
const fallback = (value, whenUndefined) => typeof value != "undefined" ? value : whenUndefined
|
|
||||||
|
|
||||||
/** @typedef {EventTarget & {value: any}} Observable */
|
/** @typedef {EventTarget & {value: any}} Observable */
|
||||||
|
|
||||||
/** Cancelable event triggered when a reactive element gets replaced with something else */
|
/** Cancelable event triggered when a reactive element gets replaced with something else */
|
||||||
|
@ -367,33 +360,16 @@ export class DomHtmlRenderer extends DomRenderer {
|
||||||
return document.createElement(name.replace(/([a-z])([A-Z])/g, "$1-$2"), options)
|
return document.createElement(name.replace(/([a-z])([A-Z])/g, "$1-$2"), options)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Creates a new node and make it a custom element if necessary
|
/** Creates a new HTML node
|
||||||
* @param {String} name
|
* @param {String} name
|
||||||
* @param {Array} args
|
* @param {Array} args
|
||||||
*/
|
*/
|
||||||
node(name, args) {
|
node(name, args) {
|
||||||
const custom = this.getCustom(args)
|
const element = this.createElement(name)
|
||||||
const opts = custom && { is: String(custom) }
|
|
||||||
|
|
||||||
const element = this.createElement(name, opts)
|
|
||||||
this.constructor.apply(element, args)
|
this.constructor.apply(element, args)
|
||||||
return element
|
return element
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Recursively finds the last 'is' attribute in a list nested array of objects
|
|
||||||
* @param {Array} args
|
|
||||||
*/
|
|
||||||
getCustom(args) {
|
|
||||||
return args.reduce(
|
|
||||||
(current, argument) => Array.isArray(argument)
|
|
||||||
? fallback(this.getCustom(argument), current)
|
|
||||||
: (argument && typeof argument == "object")
|
|
||||||
? fallback(argument.is, current)
|
|
||||||
: current
|
|
||||||
, undefined
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @type {Object<string,SpecialAttributeDescriptor>} */
|
/** @type {Object<string,SpecialAttributeDescriptor>} */
|
||||||
static specialAttributes = {
|
static specialAttributes = {
|
||||||
value: {
|
value: {
|
||||||
|
|
Loading…
Reference in a new issue