mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-04 07:40:42 +00:00

When setting empty value by input.value, we remove text node and insert bogus node. But creating and removing node are expensive. So we should keep text node for performance if possible. Now, DocumentIsEmpty only checks bogus node to detect empty. So, keeping text node change causes that document cannot detect as empty. If root has only text node and all is empty, we should detect empty document. This change should be only plain text editor. HTML editor already allows multiple text nodes, so we should keep old behaviour on HTML editor. MozReview-Commit-ID: Gt8GmdWAA3E --HG-- extra : rebase_source : 4c5deba024cab3d7e2e1e2a8ec53a29f2fdf8cd9