Because about half the code in the DM is solely there to keep this delicate data structure together, and now that we don't need ±1 cursoring it seems like a lot of effort for nothing.
The behaviour it provides (protecting metadata from deletion) can all be done in the transaction builders, and in fact we already do this for internal lists)
Going forward this will make multi user editing a lot easier to.
That said this is going to be a massive commit.
Currently, MetaItems are stored outside the main linear data structure, in a separate meta linear data structure. This complicates the processing of linear data: transaction processing, rebasing, serialization/deserialization etc, and makes it harder to reason about document correctness. Instead:
- Store metadata as block nodes in the main data list
- On conversion from HTML, hoist metadata found in a content position to a legal structural position
- On conversion back to HTML, roundtrip metadata hoisted from unmodified content branch nodes back into the original content position
- When deleting across metadata (e.g. <p>foo[-</p><meta/><p>-]bar</p>), hoist metadata to a legal structural position as necessary