Commit graph

28491 commits

Author SHA1 Message Date
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
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
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
Tim Ledbetter
3aa49f268c Userland: Make Window::set_main_widget() non-fallible 2023-09-21 10:20:23 +02:00
Liav A
c9297126db SystemServer: Use correct unix device numbers for null, full and random
This fixes regression made in 446200d6f3
2023-09-20 13:27:09 -06:00
Sam Atkins
0634d11318 LibWeb: Stop adding extra whitespace when serializing CSS Functions
Otherwise `attr(|name, "fallback")` becomes `attr(| name ,  "fallback")`

The test here is slightly aspirational. There are other rules for
serialization we don't follow (like stripping whitespace entirely from
many places) so these are marked with FIXMEs.
2023-09-20 18:29:37 +02:00
Andreas Kling
f31b39ca18 LibWeb: Remove unused BrowsingContext::for_each_child() 2023-09-20 18:29:17 +02:00
Andreas Kling
413cc1774e LibWeb: Remove unused BrowsingContext::scroll_offset_did_change() 2023-09-20 18:29:17 +02:00
Andreas Kling
93e4a0de16 LibWeb: Move has_a_rendering_opportunity() to Navigable 2023-09-20 18:29:17 +02:00
Andreas Kling
a02d42dea2 LibWeb: Remove two unused BrowsingContext member variables 2023-09-20 18:29:17 +02:00
Andreas Kling
8e669c14c8 LibWeb: Remove unused BrowsingContext::document_family*() 2023-09-20 18:29:17 +02:00
Andreas Kling
38cb15ff49 LibWeb: Move system visibility state to TraversableNavigable
This no longer belongs in BrowsingContext.
2023-09-20 18:29:17 +02:00
Andreas Kling
046ae7fe86 LibWeb: Remove unused BrowsingContext::scroll_to_anchor() 2023-09-20 18:29:17 +02:00
Andreas Kling
94236c2532 LibWeb: Remove unused "frame nesting" tracking from BrowsingContext 2023-09-20 18:29:17 +02:00
Andreas Kling
51caa14381 LibWeb: Remove FrameLoader
This class is no longer used, now that we've moved to navigables.
2023-09-20 18:29:17 +02:00
Aliaksandr Kalenik
693d602b2f LibWeb: Fix infinite loop in GFC growth limit distribution
This change is bd85e1b30b ported from
base size to growth limit distribution.

Fixes https://github.com/SerenityOS/serenity/issues/21056
2023-09-20 18:28:11 +02:00
Sam Atkins
9b4ddff6a9 LibWeb: Replace FontStyleValue with ShorthandStyleValue
Also, actually include font-variant since we were already parsing it but
throwing it away.
2023-09-20 12:17:16 +01:00
Sam Atkins
34591549b1 LibWeb: Replace BorderRadiusShorthandStyleValue with ShorthandStyleValue 2023-09-20 12:17:16 +01:00
Sam Atkins
34e0899ab0 LibWeb: Replace BackgroundStyleValue with ShorthandStyleValue
The `to_string()` for this is modified a little from the original,
because we have to calculate what the layer-count is then, instead of
having it already calculated.
2023-09-20 12:17:16 +01:00
Sam Atkins
1ae515c0b7 LibWeb: Replace FlexFlowStyleValue with ShorthandStyleValue 2023-09-20 12:17:16 +01:00