diff --git a/rust/DESIGN.md b/rust/DESIGN.md index d34ffb52ac6..51778504c6d 100644 --- a/rust/DESIGN.md +++ b/rust/DESIGN.md @@ -165,6 +165,17 @@ model of jsdom's"), since the vectors record what jsdom does: Unlike jsdom it keeps most values it can't parse, collapsing their whitespace, as Swift's does; it rejects a shadow of nothing but identifiers, as jsdom does. +- **The nodes' DOM hooks are `LexicalNode` methods** behind the feature: + `create_dom(this, config, editor)`, `export_dom(this, editor)` and + `import_dom()` (the class's static `importDOM`, read from a default + value when the class registers). Like the other hooks they get the + node's value and its handle, so an export can run on a value that isn't + in the editor state (the text a selection cuts short). The base classes' + behavior is the hooks' defaults (`TextNode` renders its text, + `ElementNode` adds the indent and direction), as for + `get_text_content`. The theme is the JSON of `EditorThemeClasses` + (`CreateEditorArgs.theme`), and a `DOMConversionMap` is a list of + name and importer pairs in the order JS's object keys would be. - **`DOMParser` is a WHATWG tokenizer and tree builder**, checked against jsdom's by the `html/parse` and `html/entities` vectors. As in Swift it leaves out templates, framesets, the `