Commit graph

14 commits

Author SHA1 Message Date
Shannon Booth
f87041bf3a LibGC+Everywhere: Factor out a LibGC from LibJS
Resulting in a massive rename across almost everywhere! Alongside the
namespace change, we now have the following names:

 * JS::NonnullGCPtr -> GC::Ref
 * JS::GCPtr -> GC::Ptr
 * JS::HeapFunction -> GC::Function
 * JS::CellImpl -> GC::Cell
 * JS::Handle -> GC::Root
2024-11-15 14:49:20 +01:00
Timothy Flynn
93712b24bf Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Andreas Kling
13d7c09125 Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Andreas Kling
865f524d5b AK+LibGUI+LibWeb: Remove AK::TypeTraits in favor of RTTI-based helpers
Now that we have RTTI in userspace, we can do away with all this manual
hackery and use dynamic_cast.

We keep the is<T> and downcast<T> helpers since they still provide good
readability improvements. Note that unlike dynamic_cast<T>, downcast<T>
does not fail in a recoverable way, but will assert if the object being
casted is not a T.
2021-01-01 15:33:30 +01:00
Luke
e8b3a65581 LibWeb: Make event dispatching spec-compliant
Specification: https://dom.spec.whatwg.org/#concept-event-dispatch

This also introduces shadow roots due to it being a requirement of
the event dispatcher.

However, it does not introduce the full shadow DOM, that can be
left for future work.

This changes some event dispatches which require certain attributes
to be initialised to a value.
2020-11-22 18:20:56 +01:00
Ben Wiederhake
08f9bc26a6 Meta+LibHTTP through LibWeb: Make clang-format-10 clean 2020-09-25 21:18:17 +02:00
Luke
7902d215b3 LibWeb: Implement <template> parsing
Note that there is currently no way to display them as we can't
currently clone nodes.

Adds special case for templates for dumping to console.
Doesn't add it to the DOM inspector as I'm not sure how to do it.
2020-08-21 11:57:11 +02:00
Luke
8b807e65d7 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 :^).
2020-08-17 22:57:05 +02:00
Andreas Kling
11ff9d0f17 LibWeb: Move DOM classes into the Web::DOM namespace
LibWeb keeps growing and the Web namespace is filling up fast.
Let's put DOM stuff into Web::DOM, just like we already started doing
with SVG stuff in Web::SVG.
2020-07-26 20:05:15 +02:00
Andreas Kling
71556e39a4 LibWeb: Switch to using AK::is and AK::downcast 2020-07-26 17:51:00 +02:00
Andreas Kling
6242e029ed LibWeb: Make Element::tag_name() return a const FlyString&
The more generic virtual variant is renamed to node_name() and now only
Element has tag_name(). This removes a huge amount of String ctor/dtor
churn in selector matching.
2020-06-16 19:09:14 +02:00
Andreas Kling
660ec504ca LibWeb: Move get_element_by_id() to a NonElementParentNode mixin class
This matches the current version of the DOM spec. And since C++ doesn't
have mixins this is actually a CRTP class.
2020-03-28 09:13:29 +01:00
Andreas Kling
7309642ca8 LibWeb: Use FlyString for Element tag names
This makes selector matching a lot more efficient, and also reduces the
number of strings on the heap.
2020-03-22 19:12:10 +01:00
Andreas Kling
830a57c6b2 LibWeb: Rename directory LibHTML => LibWeb
Let's rename this to LibWeb since it aims to provide more parts of the
web platform than just HTML. :^)
2020-03-07 10:32:51 +01:00
Renamed from Libraries/LibHTML/DOM/DocumentFragment.h (Browse further)