fix(runtime-dom): compatibility of createElement in older versions of Chrome (#9614) #9615
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#9614
Detail: https://github.com/peixin/vue3-custom-component
Issue
Vue3 custom element (Web Component) does not render below Chrome 65 (Android 8 built-in webview)
Reason
When
isCustomizedBuiltIn
is false, Vue3 passesundefined
as the second argument todocument.createElement
throughnodeOps.createElement
when the built-in tag name is not used as a custom element. This usage does not work in Chrome versions prior to 66, meaning that theconstructor
andconnectedCallback
of the custom element will not be triggered.Interestingly, starting from version 66, the
constructor
will not be triggered upon creation, but when appended to the DOM, theconstructor
andconnectedCallback
will be triggered in sequence, allowing it to function properly. In the latest version, theconstructor
will be triggered upon creation, and when appended to the DOM, theconnectedCallback
will be triggered.Temporary solution