Commit Graph

14 Commits

Author SHA1 Message Date
Andreas Kling
35f359c51c LibWeb: Fix infinite loop in ChildNode's before() and after()
The loop that was supposed to check the chain of previous or next
siblings had a logic mistake where it would never traverse the chain,
so we would get stuck looking at the immediate sibling forever.
2024-03-11 18:29:10 +01:00
Shannon Booth
57d7637b59 LibWeb: Remove DeprecatedString support from {Child,Parent}Node
No interface pulls this in that requires DeprecatedString support.
2023-10-06 08:25:40 +02:00
Shannon Booth
3b12a13f17 LibWeb: Add String variants of functions in ChildNode
This is required in porting over CharacterData from DeprecatedString to
String.

Unfortunately, as with ParentNode, we cannot yet remove the
DeprecatedString variants of these functions as the Element interface
includes ChildNode and has not yet been ported over from
DeprecatedString.
2023-09-19 10:54:07 +02:00
Shannon Booth
bfc0773285 LibWeb: Add String versions for some functions in ParentNode
These functions are required in the porting of the DocumentFragment
interface from DeprecatedString to String. Unfortunately since
ParentNode is used by Document, we can't fully remove the deprecated
versions of these functions yet.
2023-09-11 12:07:36 +01:00
Matthew Olsson
c0b2fa74ac LibWeb: Fix a few const-ness issues 2023-03-06 13:05:43 +00:00
Linus Groh
6e19ab2bbc AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
2022-12-06 08:54:33 +01:00
Linus Groh
ad04d7ac9b LibWeb: Move ExceptionOr from DOM/ to WebIDL/
This is a concept fully defined in the Web IDL spec and doesn't belong
in the DOM directory/namespace - not even DOMException, despite the name
:^)
2022-09-25 19:13:31 +01:00
Andreas Kling
6f433c8656 LibWeb+LibJS: Make the EventTarget hierarchy (incl. DOM) GC-allocated
This is a monster patch that turns all EventTargets into GC-allocated
PlatformObjects. Their C++ wrapper classes are removed, and the LibJS
garbage collector is now responsible for their lifetimes.

There's a fair amount of hacks and band-aids in this patch, and we'll
have a lot of cleanup to do after this.
2022-09-06 00:27:09 +02:00
Linus Groh
ab0a354bb4 LibWeb: Convert ChildNode to use TRY for error propagation 2022-03-22 18:05:25 +00:00
Luke Wilde
7431f6073b LibWeb: Implement ChildNode.replaceWith 2022-01-31 15:25:36 +01:00
Luke Wilde
5a5e3a6ec3 LibWeb: Implement ChildNode.after 2022-01-31 15:25:36 +01:00
Luke Wilde
1bbe40c5af LibWeb: Implement ChildNode.before 2022-01-31 15:25:36 +01:00
Luke Wilde
d5c96c3ccf LibWeb: Implement ParentNode.prepend
`convert_nodes_to_single_node` is inside its own file so ChildNode can
include and use it without having to include other headers such as
DOM/Node.h. This is to prevent circular includes.
2022-01-31 15:25:36 +01:00
Luke Wilde
7bdf0be667 LibWeb: Implement ChildNode.remove 2021-09-29 17:56:13 +02:00