Andreas Kling
497ead37bc
LibWeb: Make DOMException GC-allocated
2022-09-06 00:27:09 +02:00
Andreas Kling
ffad902c07
LibWeb: Use cached_web_prototype() as much as possible
...
Unlike ensure_web_prototype<T>(), the cached version doesn't require the
prototype type to be fully formed, so we can use it without including
the FooPrototype.h header. It's also a bit less verbose. :^)
2022-09-06 00:27:09 +02: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
Andreas Kling
bb547ce1c4
LibWeb: Make AbstractRange and subclasses GC-allocated
2022-09-06 00:27:09 +02:00
Andreas Kling
2fb9eb5257
LibWeb: Implement Range.deleteContents()
...
And here's another point on Acid3. :^)
2022-03-22 20:17:52 +01:00
Andreas Kling
e1c71b3f91
LibWeb: Implement Range.cloneContents()
2022-03-22 20:03:09 +01:00
Linus Groh
70b1f18e58
LibWeb: Explicitly ignore [[nodiscard]] values returned from TRY()
...
This broke the clang build.
2022-03-22 13:20:06 +00:00
Timothy Flynn
c3f9cd6dbd
LibWeb: Convert Range to use TRY for error propagation
2022-03-22 12:09:27 +00:00
Andreas Kling
8ab25f8d8c
LibWeb: Implement Range.surroundContents(newParent)
...
Here goes another Acid3 point :^)
2022-03-21 23:28:46 +01:00
Andreas Kling
4d49c607f8
LibWeb: Fix spec transcription mistake in Range.extractContents()
...
The spec text and code didn't match up.
Thanks to Tim for spotting this! :^)
2022-03-21 21:01:47 +01:00
Andreas Kling
ac8a8459d0
LibWeb: Don't allow setting Range start/end to document being destroyed
2022-03-21 20:37:49 +01:00
Andreas Kling
1254758b00
LibWeb: Update live DOM ranges on Text and CharacterData mutations
...
Taking care of the FIXMEs I added in earlier patches. :^)
2022-03-21 20:06:59 +01:00
Andreas Kling
c74b1b6d65
LibWeb: Implement Range.insertNode(node)
2022-03-21 19:14:50 +01:00
Andreas Kling
8bc3f4c186
LibWeb: Fix logic mistakes in Range stringification
...
We were passing the wrong length argument to substring() when
stringifying a range where start and end are the same text node.
Also, make sure we visit all the contained text nodes when appending
them to the output.
This was caught by an Acid3 subtest.
2022-03-21 19:14:50 +01:00
Andreas Kling
16f4c76da6
LibWeb: Implement Range.extractContents()
...
Another point on Acid3 coming through! :^)
2022-03-21 18:06:28 +01:00
Andreas Kling
394cd77467
LibWeb: Implement stringifier for DOM Range :^)
2022-03-21 16:29:19 +01:00
Lenny Maiorani
c37820b898
Libraries: Use default constructors/destructors in LibWeb
...
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules
"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-03-17 17:23:49 +00:00
Linus Groh
1422bd45eb
LibWeb: Move Window from DOM directory & namespace to HTML
...
The Window object is part of the HTML spec. :^)
https://html.spec.whatwg.org/multipage/window-object.html
2022-03-08 00:30:30 +01:00
Luke Wilde
ad5fb1fd7e
LibWeb: Implement Range.comparePoint
2022-02-26 12:53:32 +01:00
Luke Wilde
62b76e0658
LibWeb: Implement Range.isPointInRange
2022-02-26 12:53:32 +01:00
Luke Wilde
386ee5ab17
LibWeb: Implement Range.intersectsNode
2022-02-26 12:53:32 +01:00
Luke Wilde
8a755726ad
LibWeb: Implement Range.selectNodeContents
2022-02-26 12:53:32 +01:00
Luke Wilde
2b2dbdc74f
LibWeb: Implement Range.collapse
2022-02-26 12:53:32 +01:00
Luke Wilde
dfdc2ddb9e
LibWeb: Implement Range.selectNode
2022-02-26 12:53:32 +01:00
Luke Wilde
a26f1b2ff9
LibWeb: Implement Range.compareBoundaryPoints
2022-02-26 12:53:32 +01:00
Luke Wilde
d73fb7e10f
LibWeb: Implement Range.set{Start,End}{Before,After}
2022-02-26 12:53:32 +01:00
Luke Wilde
46ce50f74e
LibWeb: Make Range.setStart and Range.setEnd spec compliant
...
These functions are way more involved than simply setting their
respective boundary points :^)
2022-02-26 12:53:32 +01:00
Luke Wilde
a2acda5669
LibWeb: Abstract Range's members into AbstractRange
...
Range's member variables are stored in AbstractRange as per the spec,
as they are also shared with StaticRange.
2022-02-26 12:53:32 +01:00
Andreas Kling
c25d653c31
LibWeb: Implement Range.commonAncestorContainer
2022-02-25 20:45:03 +01:00
Andreas Kling
90cdeebfb3
LibWeb: Rename DOM::Window::document() => associated_document()
...
Match the spec nomenclature.
2021-09-09 21:25:10 +02:00
Andreas Kling
b91c49364d
AK: Rename adopt() to adopt_ref()
...
This makes it more symmetrical with adopt_own() (which is used to
create a NonnullOwnPtr from the result of a naked new.)
2021-04-23 16:46:57 +02:00
Brian Gianforcaro
1682f0b760
Everything: Move to SPDX license identifiers in all files.
...
SPDX License Identifiers are a more compact / standardized
way of representing file license information.
See: https://spdx.dev/resources/use/#identifiers
This was done with the `ambr` search and replace tool.
ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00
Andreas Kling
9194a97cbe
LibWeb: Add Document.createRange()
...
Also tidy up DOM::Range a little bit while we're here, and unify the
way we create them to use a delegating constructors.
2021-02-21 23:48:01 +01:00
Andreas Kling
13d7c09125
Libraries: Move to Userland/Libraries/
2021-01-12 12:17:46 +01:00