Commit Graph

62039 Commits

Author SHA1 Message Date
Timothy Flynn
d634039c10 LibJS: Implement the latest Intl.DurationFormat proposal
The proposal has undergone quite a few normative changes since we last
synced with it. There was a time when it could not be implemented as it
was written, which is no longer the case. The resulting proposal has had
so many changes compared to our implementation, that it wouldn't make
sense to implement them commit-by-commit as we normally do. So instead,
this just implements the HEAD revision of the spec in one pass.
2024-06-14 07:59:42 +02:00
Timothy Flynn
0e5cd2c45a LibLocale: Add a method to access a locale's digital format options
For Intl.DurationFormat, we will need to know a locale's hours-minutes
time separator, minutes-seconds time separator, and whether the locale
prefers digital hours to always display as 2 digits.
2024-06-14 07:59:42 +02:00
Timothy Flynn
98a437d9a8 LibLocale: Initialize TrailingZeroDisplay number format rounding option
This was missed in commit 67f3de2320.
2024-06-14 07:59:42 +02:00
Aliaksandr Kalenik
b2dcdf0096 LibWeb: Use button layout for input elements with button type 2024-06-14 07:58:55 +02:00
Aliaksandr Kalenik
8feaecd5c8 LibWeb: Create BlockContainer layout node for <input type="button">
...and shadow tree with TextNode for "value" attribute is created.
This means InlineFormattingContext is used, and button's text now
respects CSS text-decoration properties and unicode-ranges.
2024-06-14 07:58:55 +02:00
Tim Ledbetter
572ebe00ea LibWeb: Avoid null dereference when performing mixed content checks
Previously, navigating to or from `about:newtab` caused a crash due to
inadvertent null dereferences when checking whether a request or
response to a request should be blocked as mixed content.
2024-06-14 07:52:18 +02:00
Aliaksandr Kalenik
7a04a95c8a LibWeb+LibGfx: Replace usage of Gfx::PaintStyle in fill{stoke}_commands
...with a struct defined in LibWeb. This is a step towards uncoupling
LibWeb from LibGfx, so we can try third-party libraries for painting.
2024-06-13 20:17:10 +03:00
Diego
6e419db26c LibWasm: Tighten validation algorithm
The big improvement included in this commit is stack height mismatch
validation. There are other minor improvements included (related to the
validation algorithm). The method of supporting stack polymorphism has
changed to be more like the spec, which was necessary for confidently
handling stack height mismatches.

See:
https://webassembly.github.io/spec/core/appendix/algorithm.html
2024-06-13 17:21:23 +02:00
Diego
8217a77728 LibWasm: Refactor validator to use one stack for frame information
Previously, the validator had a lot of extraneous information related to
frames. Now, there's just one stack with all the necessary information
derived from it.
2024-06-13 17:21:23 +02:00
Diego
991759f453 LibWasm: Enable the loop.wast test file 2024-06-13 12:15:20 +02:00
Diego
b92bd12a8e LibWasm: Make loops work
This commit should hopefully allow for `loop.wast` to be run in CI.
2024-06-13 12:15:20 +02:00
Diego
cf7937e369 LibWasm: Make memory.fill fill with single bytes
Previously, `memory.fill` filled memory with 4-byte values, even though
`memory.fill` should fill with just one byte. Also fixes some other
issues with some of the bulk memory instructions, like `memory.init`.
2024-06-13 12:13:18 +02:00
Luke Warlow
ee64684565 LibWeb: Add Contrast preference 2024-06-13 11:18:38 +02:00
Hexeption
7ac6fd2746 LibWeb: Added HTMLLinkElement.as Tests 2024-06-13 07:58:11 +02:00
Hexeption
2f4668edce LibWeb: Added HTMLLinkElement.as 2024-06-13 07:58:11 +02:00
Timothy Flynn
4b3e26c583 LibJS+LibLocale: Replace calendar weekday information with ICU 2024-06-13 07:42:09 +02:00
Timothy Flynn
9cb1857dc6 LibJS+LibLocale: Replace preferred hour cycle lookups with ICU 2024-06-13 07:42:09 +02:00
Timothy Flynn
e2bffe5612 LibJS+LibLocale: Replace time zone display names with ICU 2024-06-13 07:42:09 +02:00
Timothy Flynn
273694d8de LibJS+LibLocale: Replace date-time formatting with ICU
This uses ICU for the Intl.DateTimeFormat `format` `formatToParts`,
`formatRange`, and `formatRangeToParts`.

This lets us remove most data from our date-time format generator. All
that remains are time zone data and locale week info, which are relied
upon still for other interfaces. So they will be removed in a future
patch.

Note: All of the changes to the test files in this patch are now aligned
with other browsers. This includes:

* Some very incorrect formatting of Japanese symbols. (Looking at the
  old results now, it's very obvious they were wrong.)
* Old FIXMEs regarding range formatting not including the start/end date
  when only time fields were requested, but the dates differ.
* Day period inconsistencies.
2024-06-13 07:42:09 +02:00
Tim Ledbetter
2f5cf8ac20 LibIDL+LibWeb: Mark [FIXME] interfaces as [[Unimplemented]]
Methods and attributes marked with [FIXME] are now implemented as
direct properties with the value `undefined` and are marked with the
[[Unimplemented]] attribute. This allows accesses to these properties
to be reported, while having no other side-effects.

This fixes an issue where [FIXME] methods broke feature detection on
some sites.
2024-06-11 16:33:30 +02:00
Tim Ledbetter
88d425f32b LibJS: Add the [[Unimplemented]] attribute
Properties marked with the [[Unimplemented]] attribute behave as normal
but invoke the `VM::on_unimplemented_property_access callback` when
they are accessed.
2024-06-11 16:33:30 +02:00
Tim Ledbetter
ebfb847d34 UI/Qt: Ensure we don't add the same zoom shortcut key more than once
On my system `QKeySequence::StandardKey::ZoomIn` includes both `Ctrl++`
and `Ctrl+=`, so explicitly adding the secondary `Ctrl+=` shortcut
ourselves results in an ambiguous shortcut error message being shown.

According to the Qt documentation the key bindings returned by
`QKeySequence::StandardKey::*` are platform specific, so we may still
need to add the secondary shortcut on some systems. Therefore, we now
check whether our secondary shortcut is already in the shortcut list
before adding it.
2024-06-11 09:19:01 -04:00
circl
990cf9b4e9 LibWeb: Use viewport position for did_enter_tooltip_area
This now matches the behavior of did_request_link_context_menu and
friends. Previously the coordinates relative to the page rather than
viewport were sent to the chrome.
2024-06-11 09:51:39 +02:00
Hugh Davenport
cb657a038f UI/Qt: Update placeholder text if search disabled
The placeholder text is there to prompt the user as to what could be
added in the address bar. The current text tells the user that they can
"Search or enter web address" even when the search setting is disabled.
When attempting to "Search" the user is instead sent to page ":", with
an error in the console:
    WebContent(575249): (FIXME) Don't know how to navigate to :

This patch fixes this by checking whether the search feature is enabled
and setting the placeholder appropriately. This provides a slightly
better user experience.

Closes #132
2024-06-11 09:50:46 +02:00
Timothy Flynn
54183b8eef UI/AppKit: Display query results on the find-in-page panel 2024-06-11 09:50:13 +02:00
Diego
40fcb00c14 LibWasm: Add missing spec-test imports 2024-06-11 02:43:55 +02:00
Diego
d20f1a99f8 LibWasm: Validate imports 2024-06-11 02:43:55 +02:00
Tim Ledbetter
1a4b042664 LibURL: Convert ASCII only URLs to lowercase during parsing
This fixes an issue where entering EXAMPLE.COM into the URL bar in the
browser would fail to load as expected.
2024-06-10 20:34:57 -04:00
Tim Ledbetter
fd98076aca Meta: Ensure LibURL tests are built 2024-06-10 20:34:57 -04:00
Tim Ledbetter
e9f34c7bd1 LibWebView: Don't query public suffix list when sanitizing URLs
Previously, part of the procedure we used to sanitize URLs entered via
the command line would check the host against the public suffix
database. This led to some valid, but not publicly accessible URLs
being treated as invalid.
2024-06-10 20:34:57 -04:00
Diego
94c2b85959 LibWasm: Validate that function and code sections match 2024-06-11 01:45:12 +02:00
Diego
67749300c3 LibWasm: Validate that data section exists for some instructions 2024-06-11 01:45:12 +02:00
Diego
a7b1a9ded7 LibWasm: Disallow multiple start sections 2024-06-11 01:45:12 +02:00
Diego
3d7c824607 LibWasm: Make sure no duplicate export names are possible 2024-06-11 01:45:12 +02:00
Diego
e64ac8c177 LibWasm: Validate number of data sections 2024-06-11 01:45:12 +02:00
circl
a9f3afc29b LibAudio: Remove support for Serenity's AudioServer 2024-06-10 13:53:01 +02:00
circl
c169e43e13 Userland: Remove some SerenityOS checks 2024-06-10 13:53:01 +02:00
circl
5d2095279d Meta: Remove references to SerenityOS in the gn build README 2024-06-10 13:53:01 +02:00
circl
4509d08dde Meta: Add BINDINGS_GENERATOR_DEBUG macro back to gn build 2024-06-10 13:53:01 +02:00
Timothy Flynn
3b68bb6e73 LibJS: Store Intl mathematical values as strings when appropriate
The IntlMV is meant to be arbitrarily precise. If the user provides a
string value to be formatted, we lose precision by converting extremely
large values to a double. We were never able to address this, as support
for arbitrary precision was a big FIXME. But ICU can handle it by just
passing the raw string on through.
2024-06-10 13:51:51 +02:00
Timothy Flynn
f6bee0f5a8 LibJS+LibLocale: Replace number range formatting with ICU
This uses ICU for the Intl.NumberFormat `formatRange` and
`formatRangeToParts` prototypes.

Note: All of the changes to the test files in this patch are now aligned
with both Chrome and Safari.
2024-06-10 13:51:51 +02:00
Timothy Flynn
67f3de2320 LibJS+LibLocale: Begin replacing number formatting with ICU
This uses ICU for the Intl.NumberFormat `format` and `formatToParts`
prototypes. It does not yet port the range formatter prototypes.

Most of the new code in LibLocale/NumberFormat is simply mapping from
ECMA-402 types to ICU types. Beyond that, the only algorithmic change is
that we have to mutate the output from ICU for `formatToParts` to match
what is expected by ECMA-402. This is explained in NumberFormat.cpp in
`flatten_partitions`.

This lets us remove most data from our number format generator. All that
remains are numbering system digits and symbols, which are relied upon
still for other interfaces (e.g. Intl.DateTimeFormat). So they will be
removed in a future patch.

Note: All of the changes to the test files in this patch are now aligned
with both Chrome and Safari.
2024-06-10 13:51:51 +02:00
Aliaksandr Kalenik
cbd566a354 LibWeb+WebContent: Move PageClient::paint() into TraversableNavigable
This way we leak less LibWeb implementation details into WebContent.
2024-06-10 14:30:20 +03:00
Aliaksandr Kalenik
c7133faf26 LibWeb: Rename Navigable::paint() to record_painting_commands()
This method does not paint, but only records painting commands that
could be passed to painting commands executor, which will perform
actual painting.
2024-06-10 14:30:20 +03:00
Timothy Flynn
28927d6a0f CI: Release only arm64 JS artifacts on macOS for now
Turns out vcpkg does not yet support Universal binaries. While they are
working on it, lets produce arm64 binaries only for now to unblock the
pipeline.
2024-06-09 22:20:15 -04:00
Kenneth Myhra
e70886595a LibWeb: Implement and wire up TransformStream's cancel callback 2024-06-09 21:27:26 -04:00
Kenneth Myhra
6d7885e250 LibWeb: Update steps for transform_stream_default_sink_abort_algorithm
Updating these steps enables the writable side of a TransformStream to
raise the cancel callback when it's aborted.
2024-06-09 21:27:26 -04:00
Kenneth Myhra
38142eaf53 LibWeb: Update cancel_algorithm steps in AO initialize_transform_stream 2024-06-09 21:27:26 -04:00
Kenneth Myhra
e848249b8d LibWeb: Implement AO transform_stream_default_source_cancel_algorithm 2024-06-09 21:27:26 -04:00
Kenneth Myhra
ff5be1fd36 LibWeb: Add internal slots [[cancelAlgorithm]] and [[finishPromise]]
This adds internal slots [[cancelAlgorithm]] and [[finishPromise]] to
TransformStreamDefaultController.
2024-06-09 21:27:26 -04:00