mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:38:11 +00:00
LibWeb: Implement getting and setting element.innerHTML
Getting the innerHTML property will recurse through the subtree inside the element and serialize it into a string as it goes. Setting it will parse the set value as an HTML fragment. It will then remove all current children of the element and replace them with all the children inside the parsed fragment. Setting element.innerHTML will currently force a complete rebuild of the document's layout tree. This is pretty neat! :^)
This commit is contained in:
parent
632cc53e2c
commit
68b04d5c78
11 changed files with 192 additions and 5 deletions
|
@ -43,6 +43,8 @@ NodeWrapper* wrap(JS::Heap& heap, Node& node)
|
|||
return static_cast<NodeWrapper*>(wrap_impl(heap, to<Document>(node)));
|
||||
if (is<HTMLCanvasElement>(node))
|
||||
return static_cast<NodeWrapper*>(wrap_impl(heap, to<HTMLCanvasElement>(node)));
|
||||
if (is<Element>(node))
|
||||
return static_cast<NodeWrapper*>(wrap_impl(heap, to<Element>(node)));
|
||||
return static_cast<NodeWrapper*>(wrap_impl(heap, node));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue