1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 05:15:07 +00:00

LibWeb: Add Comment and DocumentFragment bindings, move querySelector...

...{All} to ParentNode. Exposes createDocumentFragment and
createComment on Document. Stubs out the document.body setter. 

Also adds ParentNode back :^).
This commit is contained in:
Luke 2020-08-17 19:14:30 +01:00 committed by Andreas Kling
parent 7b755e6a58
commit 8b807e65d7
17 changed files with 223 additions and 54 deletions

View file

@ -26,8 +26,10 @@
*/
#include <LibWeb/Bindings/CharacterDataWrapper.h>
#include <LibWeb/Bindings/DocumentTypeWrapper.h>
#include <LibWeb/Bindings/CommentWrapper.h>
#include <LibWeb/Bindings/DocumentWrapper.h>
#include <LibWeb/Bindings/DocumentFragmentWrapper.h>
#include <LibWeb/Bindings/DocumentTypeWrapper.h>
#include <LibWeb/Bindings/HTMLAnchorElementWrapper.h>
#include <LibWeb/Bindings/HTMLAreaElementWrapper.h>
#include <LibWeb/Bindings/HTMLAudioElementWrapper.h>
@ -315,6 +317,10 @@ NodeWrapper* wrap(JS::GlobalObject& global_object, DOM::Node& node)
return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLElement>(node)));
if (is<DOM::Element>(node))
return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<DOM::Element>(node)));
if (is<DOM::DocumentFragment>(node))
return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<DOM::DocumentFragment>(node)));
if (is<DOM::Comment>(node))
return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<DOM::Comment>(node)));
if (is<DOM::Text>(node))
return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<DOM::Text>(node)));
if (is<DOM::CharacterData>(node))