Commit 0617131
committed
feat(ie-js): implement JavaScript DOM bindings #81
DOM bindings via Rc<RefCell<Document>> shared between Rust and JS:
document global:
- getElementById(id) → element or null
- createElement(tag) → element
- createTextNode(text) → element
- getElementsByTagName(tag) → array of elements
Element methods (each carries __nodeId):
- appendChild(child), removeChild(child)
- getAttribute(name), setAttribute(name, value)
- getTextContent(), setTextContent(text)
- getTagName()
JsRuntime::new_with_document(doc) registers document global.
Uses unsafe NativeFunction::from_closure to capture Rc<RefCell<Document>>
(safe: no GC-traced types in closure captures).
13 new tests covering creation, lookup, attributes, tree mutation,
text content. 20 total ie-js tests.1 parent f523b42 commit 0617131
2 files changed
Lines changed: 464 additions & 1 deletion
0 commit comments