Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

T/1031: Ignore mutations which lead to no changes #1039

Merged
merged 2 commits into from
Jul 25, 2017
Merged

T/1031: Ignore mutations which lead to no changes #1039

merged 2 commits into from
Jul 25, 2017

Conversation

Reinmar
Copy link
Member

@Reinmar Reinmar commented Jul 23, 2017

Suggested merge commit message (convention)

Fix: Mutation observer will ignore children mutations if as a result of several native mutations the element's children haven't changed. Closes ckeditor/ckeditor5#4121.


Additional information

In

function sameNodes( actualDomChild, expectedDomChild ) {
// Elements.
if ( actualDomChild === expectedDomChild ) {
return true;
}
// Texts.
else if ( domConverter.isText( actualDomChild ) && domConverter.isText( expectedDomChild ) ) {
return actualDomChild.data === expectedDomChild.data;
}
// Block fillers.
else if ( isBlockFiller( actualDomChild, domConverter.blockFiller ) &&
isBlockFiller( expectedDomChild, domConverter.blockFiller ) ) {
return true;
}
// Not matching types.
return false;
}
there's a very similar code to the one I wrote. However, my doesn't handle block fillers. There are no block fillers in the view so that seems to be right, but I'm mentioning just in case.

Also, I've been thinking that perhaps both functions should end up in the DomConverter's public interface one day. But not just yet.

@Reinmar Reinmar requested a review from pjasiun July 23, 2017 21:06
@pjasiun pjasiun merged commit 552198e into master Jul 25, 2017
@pjasiun pjasiun deleted the t/1031 branch July 25, 2017 13:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mutation observer should filter out empty child list mutations
2 participants