From: Evan You Date: Wed, 24 Feb 2021 20:06:51 +0000 (-0500) Subject: refactor(runtime-dom): avoid form attribtue tag check X-Git-Tag: v3.0.6~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=180310cbe9fdc04137e5bc4ad2a7cbe89c212a0e;p=thirdparty%2Fvuejs%2Fcore.git refactor(runtime-dom): avoid form attribtue tag check the tag check while technically stricter, is not really necessary and introduces too much weight --- diff --git a/packages/runtime-dom/src/patchProp.ts b/packages/runtime-dom/src/patchProp.ts index 6842b98c2b..b7ae61e214 100644 --- a/packages/runtime-dom/src/patchProp.ts +++ b/packages/runtime-dom/src/patchProp.ts @@ -3,13 +3,7 @@ import { patchStyle } from './modules/style' import { patchAttr } from './modules/attrs' import { patchDOMProp } from './modules/props' import { patchEvent } from './modules/events' -import { - isOn, - isString, - isFunction, - isModelListener, - isFormTag -} from '@vue/shared' +import { isOn, isString, isFunction, isModelListener } from '@vue/shared' import { RendererOptions } from '@vue/runtime-core' const nativeOnRE = /^on[a-z]/ @@ -99,9 +93,9 @@ function shouldSetAsProp( return false } - // #1787, #2840 the form property is readonly and can only be set as an - // attribute using a string value - if (key === 'form' && isFormTag(el.tagName)) { + // #1787, #2840 form property on form elements is readonly and must be set as + // attribute. + if (key === 'form') { return false } @@ -110,13 +104,13 @@ function shouldSetAsProp( return false } - // native onclick with string value, must be set as attribute - if (nativeOnRE.test(key) && isString(value)) { + // #2766