Upgrade the DOM mutation observer

This is an important patch contains some crtical bug fixes for
the DOM mutation observer.
Previously the observer did not handle complex DOM movement very
well. So in this patch we optimized this by distinguishing moved
node better and added a resolving queue to avoid the error caused
by ordering.
This commit is contained in:
Yanzhen Yu
2019-06-05 16:39:29 +08:00
parent c1b8651c11
commit 6d3b9c2345
6 changed files with 522 additions and 149 deletions

View File

@@ -167,7 +167,7 @@ exports[`async-checkout 1`] = `
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\\\n \\\\n \\",
\\"id\\": 6
\\"id\\": 7
},
{
\\"type\\": 2,
@@ -182,13 +182,13 @@ exports[`async-checkout 1`] = `
{
\\"type\\": 3,
\\"textContent\\": \\"test\\",
\\"id\\": 9
\\"id\\": 10
}
],
\\"id\\": 8
\\"id\\": 9
}
],
\\"id\\": 7
\\"id\\": 8
}
],
\\"id\\": 4
@@ -213,31 +213,31 @@ exports[`async-checkout 1`] = `
\\"attributes\\": [],
\\"removes\\": [
{
\\"parentId\\": 7,
\\"id\\": 8
\\"parentId\\": 8,
\\"id\\": 9
}
],
\\"adds\\": [
{
\\"parentId\\": 4,
\\"previousId\\": 7,
\\"previousId\\": 8,
\\"nextId\\": null,
\\"node\\": {
\\"type\\": 2,
\\"tagName\\": \\"span\\",
\\"attributes\\": {},
\\"childNodes\\": [],
\\"id\\": 10
\\"id\\": 9
}
},
{
\\"parentId\\": 10,
\\"parentId\\": 9,
\\"previousId\\": null,
\\"nextId\\": null,
\\"node\\": {
\\"type\\": 3,
\\"textContent\\": \\"test\\",
\\"id\\": 11
\\"id\\": 10
}
}
]