-
Notifications
You must be signed in to change notification settings - Fork 402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test(engine): shadow properties in compat mode #424
test(engine): shadow properties in compat mode #424
Conversation
Benchmark resultsBase commit: lwc-engine-benchmark
|
@@ -125,7 +125,7 @@ function lightDomChildNodesGetter(this: HTMLElement): Node[] { | |||
const customElementVM = getCustomElementVM(this); | |||
// lwc element, in which case we need to get only the nodes | |||
// that were slotted | |||
const slots = shadowRootQuerySelectorAll(customElementVM, 'slot'); | |||
const slots = nativeQuerySelectorAll.call(customElementVM.elm, 'slot'); | |||
children = ArrayReduce.call(slots, (seed, slot) => { | |||
return seed.concat(ArraySlice.call(nativeChildNodesGetter.call(slot))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should only reduce here if the slot belongs to us, otherwise we will reduce all slots in the sub-tree
children = ArrayReduce.call(slots, (seed, slot) => { | ||
return seed.concat(ArraySlice.call(nativeChildNodesGetter.call(slot))); | ||
if (isNodeOwnedByVM(customElementVM, slot)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davidturissini I have added the optimization that we talked about, plus we were using .concat, we are not using the internal cached version of the push that does the same.
Benchmark resultsBase commit: lwc-engine-benchmark
|
@davidturissini I think my optimization broke this again :( |
Benchmark resultsBase commit: lwc-engine-benchmark
|
Details
textContent
,innerHTML
, andouterHTML
to work in compat mode.textContent
,innerHTML
, andouterHTML
.Does this PR introduce a breaking change?