feat: process certain attrs as properties
This commit is contained in:
parent
47a2b25a95
commit
93d724382e
@ -1,3 +1,13 @@
|
|||||||
|
const xlinkNS = 'http://www.w3.org/1999/xlink'
|
||||||
|
|
||||||
|
function isXlink(name: string): boolean {
|
||||||
|
return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'
|
||||||
|
}
|
||||||
|
|
||||||
|
function getXlinkProp(name: string): string {
|
||||||
|
return isXlink(name) ? name.slice(6, name.length) : ''
|
||||||
|
}
|
||||||
|
|
||||||
export function patchAttr(
|
export function patchAttr(
|
||||||
el: Element,
|
el: Element,
|
||||||
key: string,
|
key: string,
|
||||||
@ -19,13 +29,3 @@ export function patchAttr(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const xlinkNS = 'http://www.w3.org/1999/xlink'
|
|
||||||
|
|
||||||
function isXlink(name: string): boolean {
|
|
||||||
return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'
|
|
||||||
}
|
|
||||||
|
|
||||||
function getXlinkProp(name: string): string {
|
|
||||||
return isXlink(name) ? name.slice(6, name.length) : ''
|
|
||||||
}
|
|
||||||
|
@ -6,7 +6,9 @@ import { patchDOMProp } from './modules/props'
|
|||||||
import { patchEvent } from './modules/events'
|
import { patchEvent } from './modules/events'
|
||||||
|
|
||||||
export const onRE = /^on/
|
export const onRE = /^on/
|
||||||
const domPropsRE = /^domProps/
|
|
||||||
|
// value, checked, selected & muted are always patched as properties
|
||||||
|
const domPropsRE = /^domProps|^(?:value|checked|selected|muted)$/
|
||||||
|
|
||||||
export function patchData(
|
export function patchData(
|
||||||
el: Element,
|
el: Element,
|
||||||
|
Loading…
Reference in New Issue
Block a user