]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor(runtime-dom): remove xlink support since it's been deprecated
authorEvan You <yyx990803@gmail.com>
Sat, 12 Oct 2019 23:25:04 +0000 (19:25 -0400)
committerEvan You <yyx990803@gmail.com>
Sat, 12 Oct 2019 23:25:04 +0000 (19:25 -0400)
packages/runtime-dom/src/modules/attrs.ts
packages/runtime-dom/src/patchProp.ts

index 3254f0fcbaa4b4175b81f5d9b0c8e2c991c75685..7bdd9ba68b91e029af16cb9e6fa4e470688c1969 100644 (file)
@@ -1,31 +1,7 @@
-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(
-  el: Element,
-  key: string,
-  value: any,
-  isSVG: boolean
-) {
-  // isSVG short-circuits isXlink check
-  if (isSVG && isXlink(key)) {
-    if (value == null) {
-      el.removeAttributeNS(xlinkNS, getXlinkProp(key))
-    } else {
-      el.setAttributeNS(xlinkNS, key, value)
-    }
+export function patchAttr(el: Element, key: string, value: any) {
+  if (value == null) {
+    el.removeAttribute(key)
   } else {
-    if (value == null) {
-      el.removeAttribute(key)
-    } else {
-      el.setAttribute(key, value)
-    }
+    el.setAttribute(key, value)
   }
 }
index 4c26b518d16d4f6550f058acecec23eebb9e0def..a74faa88e2fbf1877605f855e1c9697d53284921 100644 (file)
@@ -53,7 +53,7 @@ export function patchProp(
           unmountChildren
         )
       } else {
-        patchAttr(el, key, nextValue, isSVG)
+        patchAttr(el, key, nextValue)
       }
       break
   }