Commit graph

54778 commits

Author SHA1 Message Date
Tim Schumacher 40808fe1cd Ports: Properly update submodules when checking out Git repositories 2023-09-24 23:54:56 +02:00
Tim Schumacher e12e833eaa Ports: Clone Git repositories to the actual workdir 2023-09-24 23:54:56 +02:00
Sam Atkins 34940821f6 Utilities: Use new ArgsParser method for enum values 2023-09-24 23:41:22 +02:00
Sam Atkins f71d74ed65 LibCore: Add ArgsParser::add_option for setting enum values from a flag
Previously, argument-less options could only set a boolean to true. This
lets them also set an enum variable to a specific value, as is currently
done by the `ls` utility.
2023-09-24 23:41:22 +02:00
Daniel Bertalan 4d2af7c3d6 AK: Implement reverse iterators for OrderedHashTable 2023-09-24 23:36:43 +02:00
surrealegg d94a374001 Ports: Add libenet
Libenet is a UDP networking library that is used by Love2D,
a game framework I would like to port.
2023-09-24 21:05:44 +02:00
Aliaksandr Kalenik 719a00df3a LibJS: Add source location for Handle nodes in GC graph dumper output
With this change JS::Handle root nodes will contain source location
where they were constructed like:
```
    "94675029575744": {
        "root": "Handle activate_event_handler \
           serenity/Userland/Libraries/LibWeb/DOM/EventTarget.cpp:564",
        "class_name": "HTMLButtonElement",
        "edges": [
            "94675025955904",
            "94675026899520",
            "94675030831168",
```
2023-09-24 14:55:32 +02:00
Aliaksandr Kalenik 4b06cef93a AK: Add copy assignment operator for SourceLocation 2023-09-24 14:55:32 +02:00
Tim Ledbetter 01ec695ae3 ls: Add the -S option to sort files by size
This option will override the `-t` option and vice-versa.
2023-09-24 08:22:11 +01:00
Aliaksandr Kalenik f9520af71e LibWeb: Do page_did_start_loading if history state is pushed/replaced
page_did_start_loading need to be called when current history entry
changes to update URL in UI.
2023-09-23 17:59:10 -06:00
Aliaksandr Kalenik 7cdbd59e92 LibWeb: Update session history when History entry is pushed/replaced
With this change `shared_history_push_replace_state()` starts to
actually add/replace session history entry.
2023-09-23 17:59:10 -06:00
Aliaksandr Kalenik 699ead0939 LibWeb: Start fleshing out update document for history step application 2023-09-23 17:59:10 -06:00
Aliaksandr Kalenik 40cbe9e72b LibWeb: Add index and length into HTML::History 2023-09-23 17:59:10 -06:00
Andrew Kaster 0f8ae12d44 LibWeb: Implement fire a download request navigate event 2023-09-23 18:57:31 +02:00
Andrew Kaster 67bc3629a9 LibWeb: Implement fire a push/replace/reload navigate event 2023-09-23 18:57:31 +02:00
Andrew Kaster 5549371b52 LibWeb: Implement fire a traverse navigate event on Navigation 2023-09-23 18:57:31 +02:00
Andrew Kaster 3935105d0a LibWeb: Implement the inner navigate event firing algorithm
This algorithm is the meat of firing the NavigateEvent at navigation.
In order to implement it, we also need to add some getters/setters on
NavigateEvent. The implemetentation deviates from the spec in when
exactly the NavigateEvent is created. In following the pattern for other
events. we construct the event from the NavigateEventInit structure from
our native code. This makes the code a lot simpler than adding 10
getters to the NavigateEvent that are only ever used just after
construction. I'm not 100% conviced the promise resolution code is
correct, but we can add tests for that later :^).
2023-09-23 18:57:31 +02:00
Andrew Kaster 0650edc7d7 LibWeb: Implement Navigation AOs that are called during event firing
These Navigation API Method Tracker AOs are called by the inner navigate
event firing algorithm. Implement them beforehand to make the diff look
pretty :^).
2023-09-23 18:57:31 +02:00
Andrew Kaster 2a24dda44d LibWeb: Implement NavigateEvent AOs that are called during event firing
The potentially scroll/focus and finish AOs are called by the inner
navigate event firing algorithm. Implement them beforehand to make the
diff look pretty :^).
2023-09-23 18:57:31 +02:00
Andrew Kaster e05a6f6aa2 LibWeb: Add getter to NavigationDestination to get its URL as an AK::URL
Other parts of LibWeb are going to want to mess with the URL object, not
its serialzied representation. So let's add a backdoor getter.
2023-09-23 18:57:31 +02:00
Andrew Kaster a5e05c5082 LibWeb/WebIDL: Implement the wait for all AO
This abstract operation takes a list of IDL promises and chains them
together with .then() until all are completed or rejected.
2023-09-23 18:57:31 +02:00
Andrew Kaster b07badb832 LibWeb: Make the can have its url rewritten AO publicly accessible
We'll need this from the Navigation API
2023-09-23 18:57:31 +02:00
Sam Atkins f98659dd76 LibWeb: Remove UA style sheet rules from <symbol> presentational hints 2023-09-23 16:27:14 +02:00
Sam Atkins ae4b8d86df LibWeb: Include standard SVG user agent style sheet
For now, part of this is commented-out. Our current implementations of
`<mask>` and `<symbol>` rely on creating layout nodes, so they can't be
`display: none`.
2023-09-23 16:27:14 +02:00
Andreas Kling a6131634f1 LibWeb: Add fast_is<T>() for HTMLSlotElement
2.4x speed-up on StyleBench :^)
2023-09-23 13:04:38 +02:00
Shannon Booth 07b332e17c LibWeb: Add IDL definition for SVGScriptElement
It does not currently handle any of the actual scripting, but this
should at least allow us to create an instance of the element.

The test being added here isn't actually testing much, but before the
previous commit we used to crash parsing the page due to a TODO().
2023-09-23 11:41:57 +02:00
Shannon Booth 60c32f39a1 LibWeb: Do not crash when parsing a SVG script element
Just leave a FIXME dbgln message instead. This works around a crash seen
in html5test.com.
2023-09-23 11:41:57 +02:00
Shannon Booth 6de9d2820f LibWeb: Add spec comments to 'process the rules for foreign content' 2023-09-23 11:41:57 +02:00
Andrew Kaster 5949e3c3e8 LibWeb: Implement named property access AOs on Window
These allow accessing embeds, forms, images and objects with a given
name attribute, and any element with a given id attribute, as top level
properties on the global object.

It also allows accessing NavigableContainers by target name as top level
properties on the global object.

The current implementation feels very expensive. It's likely that
these values will need smarter caching in the future.
2023-09-22 19:55:59 -06:00
Andrew Kaster 247f12d7b0 LibWeb: Insert WindowProperties object into Window's prototype chain
And implement WindowProperties, the "named properties object" for Window
according to the spec.

This involves moving an AO out of LegacyPlatformObject and into a common
place that the WindowProperties class can access.

This doesn't implement the AOs on Window that actually name lookup for
the unenumerable named properties on the window yet, just the
scaffolding.
2023-09-22 19:55:59 -06:00
Andrew Kaster 64899dba44 LibWeb: Implement document-tree child navigable target name property set
This AO allows accessing child navigables by their name as named
properties on the WindowProxy object.
2023-09-22 19:55:59 -06:00
Andrew Kaster 7e277797ad LibWeb: Add about base url to the various AOs that construct documents
And some assorted cleanup along the way. The browsing context and
document AOs in particular need re-alignment with the spec.
2023-09-22 19:45:11 -06:00
Andrew Kaster dc0f7c4c54 LibWeb: Align NavigationParams and the creation AOs to the spec
And remove assorted spec FIXMEs along the way. Also align
populate_session_history_entry_document to the spec, with a bonus spec
bug to be filed.

This involves creating a new NonFetchSchemeNavigationParams spec, and
having the associated AOs take a Variant rather than Optional to
accomodate the fact that this extra struct could be returned by the
algorithm. We don't actually *do* anything with these params, but the
scaffolding is there now, with less TODOs.
2023-09-22 19:45:11 -06:00
Andrew Kaster f296382e1a LibWeb: Implement inform the navigation api about aborting navigation
This also requires implementing the abort the ongoing navigation AO on
Navigation, which will be used from other NavigateEvent AOs.
2023-09-22 19:45:11 -06:00
Andrew Kaster 25ffe6becb LibWeb: Correct spelling of UserNavigationTiming enum
With luck we can Naviagate these typo-filled waters.
2023-09-22 19:45:11 -06:00
Hendiadyoin1 cfba182b61 Kernel/PCI: Make SATAProgIF comparable with ProgrammingInterface
This makes checking it a bit nicer
2023-09-22 18:39:37 -06:00
Hendiadyoin1 d64d03e0d6 Kernel: Make Graphics device detection a bit more idomatic 2023-09-22 18:39:37 -06:00
Hendiadyoin1 e7012a9245 Kernel: Use PCI/Definitions.h for PCI-USB controller magic numbers 2023-09-22 18:39:37 -06:00
Hendiadyoin1 693f3ad33e Kernel: Add some more PCI [Sub]Class IDs 2023-09-22 18:39:37 -06:00
Hendiadyoin1 66647b58d4 Kernel: Make PCI [Sub]ClassCode comparable to the corresponding ID enums 2023-09-22 18:39:37 -06:00
Hendiadyoin1 3273ef1e3f AK: Add helper to make DistinctNumeric types comparable to enums 2023-09-22 18:39:37 -06:00
Ali Mohammad Pur 1b2007cc7f AK: Use outline Function storage if alignment requirements are not met
Instead of ballooning the size of the Function object, simply place the
callable on the heap with a properly aligned address.
This brings the alignment of Function down from ridiculous sizes like 64
bytes down to a manageable 8 bytes.
2023-09-22 22:10:16 +03:30
Ali Mohammad Pur 5e0a28c947 Revert "AK: Align Function storage to __BIGGEST_ALIGNMENT__ outside…
…kernel"
This reverts commit d4d92184b3.
The alignemnt requirements imposed by this are overkill at best and
ridiculous at worst, a future commit will tackle this problem in a
different, more space-efficient way.
2023-09-22 22:10:16 +03:30
Aliaksandr Kalenik 06d05b3c55 LibWeb: Boxes that establish FFC or GFC should avoid overlapping floats
Before, we only ensured that boxes establishing BFC did not overlap
with floats because that is what CSS 2.2 specification says. However,
we should also apply the same for boxes establishing FFC or GFC as this
aligns with the behavior of other browsers.

Fixes https://github.com/SerenityOS/serenity/issues/21095
2023-09-22 16:48:28 +02:00
Daniel Bertalan 1cfaadec02 Meta: Add myself to CODEOWNERS
This covers the few core things I'm likely to have strong opinions
about.
2023-09-22 09:05:45 +02:00
Andreas Kling 3d5cd23393 LibJS: Remove unused Instruction::is_terminator() 2023-09-21 16:19:13 +02:00
Andreas Kling 3ccac0cf6e LibJS: Remove unused realm parameter from run_and_return_frame() 2023-09-21 16:19:13 +02:00
Andreas Kling d6e959686d LibJS: Remove automatic ExecutionContext creation in BC interpreter
This was a remnant from the AST/BC hybrid interpreter times. We've had
a VERIFY in here for weeks now that would catch anything depending on
this behavior, and nothing has hit it, so let's remove the unnecessary
code (but leave the VERIFY) :^)
2023-09-21 16:19:13 +02:00
Shannon Booth 30ab198b40 LibJS: Create const variables in ForIn/OfBodyEvaluation in strict mode
Our implementation of environment.CreateImmutableBinding(name, true)
in this AO was not correctly initializing const variables in strict
mode. This would mean that constant declarations in for loop bodies
would not throw if they were modified.

To fix this, add a new parameter to CreateVariable to set strict mode.
Also remove the vm.is_strict mode check here, as it doesn't look like
anywhere in the spec will change strict mode depending on whether the
script itself is running in script mode or not.

This fixes two of our test-js tests, no change to test262.
2023-09-21 16:19:05 +02:00
Shannon Booth e67dd54878 LibJS: Add spec comments to ScopeNode::block_declaration_instantiation 2023-09-21 16:19:05 +02:00