Commit Graph

34193 Commits

Author SHA1 Message Date
Andreas Kling
a91bb72dab LibJS: Don't overwrite cached this value on async/generator reentry
When resuming execution of a suspended function, we must not overwrite
any cached `this` value with something from the ExecutionContext.

This was causing an empty JS::Value to leak into the VM when resuming
an async arrow function, since the "this mode" for such functions is
lexical and thus ExecutionContext will have an empty `this`.

It became a problem due to the bytecode optimization where we allow
ourselves to assume that `this` remains cached after we've executed a
ResolveThisBinding in this (or the first) basic block of the executable.

Fixes https://github.com/LadybirdBrowser/ladybird/issues/138
2024-06-20 10:17:18 +02:00
Timothy Flynn
ad10705615 LibLocale: Move definition of Range structure to dedicated header
We were redefining a Range type in a few formatters. Move it to its own
header to avoid ODR violations (and give it a more descriptive name).
2024-06-19 13:11:38 -04:00
Aliaksandr Kalenik
8a509a8023 LibWeb: Take into account specified winding rule in Skia painter 2024-06-19 16:51:52 +02:00
Aliaksandr Kalenik
0b48c1ea3f Everywhere: Remove AffineCommandExecutorCPU
No need to have it after introduction of Skia painter that supports
transforms.
2024-06-19 17:22:30 +03:00
Aliaksandr Kalenik
de6d99e940 LibWeb: Respect selected painter in SVGDecodedImageData
Now SVGDecodedImageData uses Skia painter, if it's selected.
2024-06-19 16:26:37 +03:00
Aliaksandr Kalenik
6dd124fc87 LibWeb+WebContent+WebWorker: Allow to query painter type from PageClient
Now it's possible to query selected type from SVGPageClient.
2024-06-19 16:26:37 +03:00
Ali Mohammad Pur
8c9d3b30cf LibWeb/CSS: Avoid capturing structured binding in generic lambda
Apple Clang doesn't like this, rather than waiting for their version of
random-clang-commit-to-call-a-release to catch up with llvm trunk, just
work around the issue.

Fixes #186.
2024-06-19 12:46:27 +02:00
Andreas Kling
847243b706 LibWeb: Only inject "User-Agent"/"Accept" headers when they're missing
...otherwise we send out HTTP requests with duplicates of these headers.
2024-06-19 08:09:10 +02:00
Aliaksandr Kalenik
bd16648b71 LibWeb: Support bitmap scaling mode in Skia painter
Co-authored-by: Andreas Kling <kling@serenityos.org>
2024-06-19 07:52:14 +02:00
Aliaksandr Kalenik
ef1f54b6b0 LibWeb: Accept value by reference in Skia type conversion helpers 2024-06-19 07:52:14 +02:00
Aliaksandr Kalenik
8f721e5b1a LibWeb: Drop gfx_{type} prefix from helpers that convert LibGfx to Skia
Having it was unnecessary verbosity.
2024-06-19 07:52:14 +02:00
Aliaksandr Kalenik
e9658356c4 LibWeb: Skip missing glyphs in Skia painter
Port fbc42e7d42
2024-06-19 07:52:14 +02:00
Zaggy1024
5a6950be8e LibMedia: Make Media::Sample final using Variant for auxiliary data
We don't need to allocate these little things onto the heap, that's
silly.
2024-06-19 07:51:55 +02:00
Zaggy1024
7c10e1a08d LibMedia: Rename LibVideo to LibMedia
This change is in preparation for implementing audio codecs into the
library and using audio as timing for video playback.
2024-06-19 07:51:55 +02:00
Timothy Flynn
8d7216f4e0 LibUnicode: Replace IDNA ASCII conversion with ICU 2024-06-18 21:07:56 +02:00
Timothy Flynn
83475c5380 LibUnicode: Replace Unicode string normalization with ICU
In a benchmark, ICU's implementation was over 3x faster than ours.
2024-06-18 21:07:56 +02:00
Timothy Flynn
187349e4db LibLocale: Inline a couple of ICU string conversion methods
This just allows using the ICU header within LibUnicode, without having
to link against LibLocale.

Eventually, I think it will make sense to combine LibUnicode & LibLocale
back into a single library. They were separated to remove the large CLDR
data library from LibUnicode since most users did not need it. But that
is not much of a concern now.
2024-06-18 21:07:56 +02:00
Timothy Flynn
1feef17bf7 LibUnicode: Remove completely unused code point name & block name data
These were used for e.g. the Character Map on Serenity, but are not used
at all for Ladybird.
2024-06-18 21:07:56 +02:00
Timothy Flynn
9c3a775395 LibJS: Update AOs involved in locale resolution to the latest ECMA-402
There have been a number of changes to the locale resolution AOs that
we've fallen behind on. Mostly editorial, but includes one normative
change to canonicalize Unicode extension keywords in the Intl.Locale
constructor.
2024-06-18 21:06:50 +02:00
Timothy Flynn
2c311448c7 LibLocale+LibJS: Make a locale canonicalization API a bit more ergonomic
Instead of taking an out-parameter, return the canonicalization result.
This allows the API to be used where specs want to store the result and
the original values in separate variables.
2024-06-18 21:06:50 +02:00
Aliaksandr Kalenik
d292152e2e LibWeb: Add Skia painting command executor
This change introduces Skia painter available under a flag. It's not
yet match capabilities of Gfx::Painter and is not ready to replace it.

Motivation:
- The current CPU painter is a performance bottleneck on most websites.
  Our own GPU painter implementation is very immature and has received
  relatively little attention.
- There is ongoing effort on building painter that supports affine
  transforms (AffineCommandExecutorCPU) but it is far from being on par
  with the default CPU painter. Skia will allow us to immediately get
  full transformation support for all painting commands.

GPU painting:
I experimented with Ganesh GPU-backend, however profiling revealed that
without sharing viewport texture between WebContent and Browser
processes, it won't bring much performance improvement compared to
CPU-backend. Therefore, I decided to keep this PR focused on
implementing most of painting commands and switch to GPU-backend in
future changes.

Text rendring:
Skia painter uses glyph bitmaps produced by LibGfx. Using Skia for text
rendering will require large refactoring of the font rendering
subsystem. Currently, it's impossible to construct SkFont right before
rendering because Gfx::VectorFont can't be serialized back into sequence
of bytes.

There is a problem with ugly include paths like:
`#include <core/SkBitmap.h>`.
I would prefer to have skia prefix in the path. There was an attempt to
fix that but PR was rejected https://github.com/microsoft/vcpkg/pull/32660

Regressions compared to Gfx::Painter:
- DrawText is not implemented
- PaintTextShadow is not implemented
- PaintRadialGradient and PaintLinearGradient do not support "transition
  hints" and repeat length
- PaintConicGradient is not implemented
- DrawTriangleWave is not implemented
- DrawLine does not account for line style property
- DrawScaledBitmap and DrawScaledImmutableBitmap do not account for
  scaling mode property
2024-06-18 21:05:50 +02:00
Aliaksandr Kalenik
25c4355406 Ladybird+LibWeb+WebContent: Add an option to enable Skia painter 2024-06-18 21:05:50 +02:00
Aliaksandr Kalenik
8a7cd8055f LibWeb: Add save and restore commands in recording painter
This change is a preparation before introducing Skia painter in an
upcoming change. It's needed because Skia does not have an API to
implement ClearClipRect command. It only allows to return previous
clip rect by popping from its internal state stack.

A bit more context: initially we had save and restore commands, but
their frequent use led to many reallocations of vector during painting
commands recording. To resolve this, we switched to SegmentedVector to
store commands list, which allows fast appends. Now, having many save
and restore commands no longer causes noticeable performance issue.
2024-06-18 21:05:50 +02:00
Diego
0e705f431e LibWasm: Check exports for valid ref.func targets 2024-06-18 16:58:33 +02:00
Diego
bd97091cbb LibWasm: Ensure that global.get only accesses imports in const exprs 2024-06-18 16:58:33 +02:00
Diego
20d8ea4db1 LibWasm: Read indices as LEB128 u32s
Every type of index was previously being read as a size_t.
2024-06-18 16:58:33 +02:00
Diego
78c56d80f9 LibWasm: Check data segment offset at correct time during instantiation
The data segment offset should be checked _before_ checking if the
contents of the segment are non-existent.
2024-06-18 16:58:33 +02:00
Diego
c2a0c4f581 LibWasm: Report start function traps during instantiation 2024-06-18 16:58:33 +02:00
Luke Warlow
099b77d60f LibWeb: Add motion preference
This adds a motion preference to the browser UI similar to the existing
ones for color scheme and contrast.
Both AppKit UI and Qt UI has this new preference.
The auto value is currently the same as NoPreference, follow-ups can
address wiring that up to the actual preference for the OS.
2024-06-18 10:31:54 -04:00
Luke Warlow
564e546ff0 LibWeb: Prevent select.click() opening the dropdown
No other browser allows opening the select element dropdown with the
select.click() function.
This change stops this happening in Ladybird.
2024-06-18 09:37:07 +02:00
Tim Ledbetter
5ca2f4dfd7 Everywhere: Remove all KERNEL #defines 2024-06-18 09:36:25 +02:00
Timothy Flynn
de99dd2c89 LibJS+LibLocale: Change ListFormat to be created once per Intl object
ListFormat was the first formatter I ported to ICU. This patch makes it
match the style of subsequently ported formatters, where we create the
formatter once per Intl object, rather than once per prototype
invocation.
2024-06-17 18:46:22 -04:00
Timothy Flynn
1c51ac4763 LibJS: Remove unused PartitionPattern AO and related types
And move some headers around that are no longer needed in the AO header.
2024-06-17 18:46:22 -04:00
Timothy Flynn
638a6c8c00 LibJS: Support non-Gregorian calendars for Intl.DateTimeFormat
This almost worked out of the box, but we need to be sure we pass the
full locale (e.g. en-u-ca-hebrew) and not just the data locale (en) to
ICU.
2024-06-17 21:59:59 +02:00
Timothy Flynn
4598a505b1 LibJS: Differentiate between undefined and null locale keys
We were previously treating undefined and null as the same (an empty
Optional). However, there are edge cases in ECMA-402 where we must treat
them differently. Namely, the hour cycle (hc) keyword. An undefined hc
value has no effect on the resolved locale, whereas a null hc value can
actively override any hc specified in the locale string. For example:

    new Intl.DateTimeFormat("en-u-hc-h11", { hour12: false });

In that object, the hour12 option does not match the u-hc-h11 value. So
the spec dictates we remove the hc value by setting it to null.
2024-06-17 21:59:59 +02:00
Andreas Kling
1039acca8c LibGfx: Remove JPEG2000 image format support
This format is not supported by other browsers.
2024-06-17 21:57:35 +02:00
Andreas Kling
a34a5af939 LibGfx: Remove ILBM image format support
This format is not supported by other browsers.
2024-06-17 21:57:35 +02:00
Andreas Kling
b6daddb088 LibGfx: Remove JBIG2 image format support
This format is not supported by other browsers.
2024-06-17 21:57:35 +02:00
Andreas Kling
b7f8d7aec5 LibGfx: Remove TGA image format support
This format is not supported by other browsers.
2024-06-17 21:57:35 +02:00
Andreas Kling
681a2ac14e LibGfx: Remove support for the various "portable" image formats
These formats are not supported by other browsers.
2024-06-17 21:57:35 +02:00
Andreas Kling
7141319a7c LibGfx: Remove DDS image format support
This format is not supported by other browsers.
2024-06-17 21:57:35 +02:00
Andreas Kling
4b4254c3d0 LibGfx: Remove QOI image format support
This format is not supported by other browsers.
2024-06-17 21:57:35 +02:00
Andreas Kling
2a888ca626 LibGfx: Remove home-grown JPEG codec in favor of libjpeg-turbo 2024-06-17 17:59:54 +02:00
Luke Warlow
5098ed6b1f LibWeb: Add HTMLSelectElement showPicker()
Adds the showPicker() function for select elements.
This doesn't do the check for "being rendered" which is in the spec.
2024-06-17 07:01:26 -06:00
Diego
3225e6fad2 LibWasm: Improve element validation and instantiation 2024-06-17 01:55:42 +02:00
Diego
4c3071c7c2 LibWasm: Implement rest of table instructions 2024-06-17 00:58:31 +02:00
Timothy Flynn
06ed0dfcc1 LibWeb: Run clang-format
We mistakenly did not add the clang-format linter to the new repo's CI,
and some unformatted code made its way into the repo.
2024-06-16 15:30:28 -04:00
Andreas Kling
fbc42e7d42 LibGfx: Don't try to paint glyphs that aren't in a font
Fixes https://github.com/LadybirdBrowser/ladybird/issues/88
2024-06-16 13:24:36 +02:00
Andreas Kling
1bde774918 LibGfx: Remove unused cruft 2024-06-16 13:24:36 +02:00
Daniel Bertalan
bf1f631f25 Everywhere: Write dtors for types with incomplete members out-of-line
These are rejected by Clang (19) trunk as a result of
https://github.com/llvm/llvm-project/pull/77753.
2024-06-16 07:19:56 -04:00
Daniel Bertalan
397774d422 Everywhere: Remove usages of template keyword with no parameter list
These were made invalid with P1787, and Clang (19) trunk started warning
on them with https://github.com/llvm/llvm-project/pull/80801.
2024-06-16 07:19:56 -04:00
Tim Ledbetter
9b5d1382bf LibWeb: Rerun find in page query when navigating between URLs
Previously, the "Find Next Match" and "Find Previous Match" actions
simply updated the match index of the last query to be performed. This
led to incorrect results if the page had been modified after the last
query had been run.

`Page::find_in_page_next_match()` and
`Page::find_in_page_previous_match()` both now rerun the last query to
ensure the results are up to date before updating the match index.

The match index is also reset if the URL of the active document has
changed since the last query. The current match index is maintained if
only the URL fragment changes.
2024-06-16 09:46:43 +02:00
Tim Ledbetter
077cb7687d LibWeb: Limit find in page query to documents in the active window
Previously, refreshing the current page and doing a new find in page
query would result in duplicate matches being returned.
2024-06-16 09:46:43 +02:00
koenditor
33f66dcb8f WebContent: Add missing ifdef 2024-06-16 09:46:06 +02:00
Matthew Olsson
7950992fc2 LibWeb: Remove TimingFunction in favor of EasingStyleValue::Function
Now that EasingStyleValue is a lot nicer to use, there isn't much reason
to keep TimingFunction around.
2024-06-16 07:12:46 +02:00
Matthew Olsson
ac35f76e67 Meta: Remove GenerateCSSEasingFunctions 2024-06-16 07:12:46 +02:00
Matthew Olsson
667e313731 LibWeb: Parse easing values manually
The values aren't that complex, so it doesn't make much sense to have a
dedicated generator for them. Parsing them manually also allows us to
have much more control over the produced values, so as a result of this
change, EasingStyleValue becomes much more ergonomic.
2024-06-16 07:12:46 +02:00
Timothy Flynn
b2f7073539 LibLocale: Remove (now) needless explicit enum class underlying types
This was useful for code generation as reducing the size of the enums
had a notable impact on the size of the generated code. This is not the
case any longer.
2024-06-16 06:57:08 +02:00
Timothy Flynn
4de8adabac LibLocale: Replace available locale lookups with ICU 2024-06-16 06:57:08 +02:00
Timothy Flynn
1bcc29d0d1 LibJS+LibLocale: Replace Unicode keyword lookups with ICU
Note: All of the changes to the test files in this patch are now aligned
with both Chrome and Firefox.
2024-06-16 06:57:08 +02:00
Timothy Flynn
a1464342e1 LibJS+LibLocale: Remove unused parameter from keyword canonicalization 2024-06-16 06:57:08 +02:00
Timothy Flynn
5e2ee4447e LibJS+LibLocale: Replace plural rules selection with ICU
This uses ICU for all of the Intl.PluralRules prototypes, which lets us
remove all data from our plural rules generator.

Plural rules depend directly on internal data from the number formatter,
so rather than creating a separate Locale::PluralRules class (which will
make accessing that data awkward), this adds plural rules APIs to the
existing Locale::NumberFormat.
2024-06-15 06:57:16 +02:00
Timothy Flynn
7f9ccd39f5 LibJS+LibLocale: Replace relative time formatting with ICU
This uses ICU for all of the Intl.RelativeTimeFormat prototypes, which
lets us remove all data from our relative-time format generator.
2024-06-15 06:57:16 +02:00
Andreas Kling
f7a83e5755 LibWeb: Improve FIXME message about getComputedStyle() properties
Let's log which property we're trying to look up, since that's the most
interesting part!
2024-06-14 20:45:37 +02:00
Andreas Kling
4c94202e97 LibWeb: Remove unnecessary FIXME marker for CSSStyleDeclaration.cssFloat 2024-06-14 20:45:37 +02:00
Andreas Kling
19fa630fa7 LibWeb: Make CSSKeyframeRule.parentRule actually point to parent rule 2024-06-14 20:45:37 +02:00
Andreas Kling
7f2c833a39 LibWeb: Implement CSSKeyframesRule.cssRuleList
To make this straightforward, CSSKeyframesRule now uses a CSSRuleList
for internal storage.
2024-06-14 20:45:37 +02:00
Andreas Kling
a12d28fd30 LibWeb: Implement CSSStyleDeclaration.parentRule
This readonly attribute returns the containing CSS rule, or null (in the
case of element inline style).
2024-06-14 20:45:37 +02:00
Tim Ledbetter
ec4d29849d LibWeb: Support finding text split across multiple text nodes
Previously, the find in page function would fail to find text which was
split across multiple text nodes. For example, given the following
markup: `WH<span>F` the query `WHF` would previously fail to be
matched.

This is done by traversing all of the document's text nodes -
constructing a complete string to query against and keeping track of
the locations where that string is split across multiple nodes.
2024-06-14 16:55:39 +02:00
circl
d2f9ba7db1 Revert "LibWeb: Use memcpy() in CanvasRenderingContext2D.getImageData()"
This reverts commit 59cb7994c6.

This change caused a bug where getImageData returned the image in
BGRA8888 format instead of RGBA8888.
2024-06-14 16:54:32 +02:00
Andreas Kling
60a05ef414 LibJS/Bytecode: Give TypeofBinding instructions a lookup cache
These can use an EnvironmentCoordinate for caching, just like normal
binding lookups. Saves a bunch of time for repeated typeof checks.
2024-06-14 16:08:02 +02:00
Andreas Kling
4302e07346 LibJS/Bytecode: Rename TypeofVariable => TypeofBinding 2024-06-14 16:08:02 +02:00
Andreas Kling
9d21d88374 LibJS: Allow let and const to create locals in global code
This is actually safe everywhere but in the topmost program scope.
For web compatibility reasons, we have to flush all top-level bindings
to the environment, in case a subsequent separate <script> program
comes looking for them.
2024-06-14 16:08:02 +02:00
Andreas Kling
0aa8cb7dac LibJS/Bytecode: Display local variable names in bytecode dumps
Instead of displaying locals as "locN", we now show them as "name~N".
This makes it a lot easier to follow bytecode dumps, especially in
longer functions.

Note that we keep displaying the local index, to avoid confusion in case
there are multiple separate locals with the same name in one executable.
2024-06-14 16:08:02 +02:00
Timothy Flynn
fdacf8ebeb LibJS: Link LibLocale publicly to ensure ICU data is available
Linking LibLocale publicly ensures that libicudata.a is also available
in all embedders of LibJS. Otherwise, ICU crashes in hard-to-track-down
ways at runtime when the data is not available.
2024-06-14 14:05:45 +02:00
Aliaksandr Kalenik
57c735dec4 LibGfx: Remove draw_signed_distance_field() in Gfx::Painter
No longer used since we switched to vector paths for checkbox rendering.
2024-06-14 08:00:17 +02:00
Aliaksandr Kalenik
9502926b76 LibWeb: Remove painting command for drawing signed distance field
No longer used since we switched to vector paths for checkbox rendering.
2024-06-14 08:00:17 +02:00
Aliaksandr Kalenik
20c506f597 LibWeb: Replace SDFs with vector paths in CheckBoxPaintable
Initially, SDF rendering was adopted for checkbox rendering because our
vector path renderer had not yet matured. This is no longer the case.
2024-06-14 08:00:17 +02:00
Timothy Flynn
f9a7fc6263 LibLocale: Remove the number formatting data generator
The last user of the remaining data (Intl.DurationFormat) no longer
consumes these APIs.
2024-06-14 07:59:42 +02:00
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
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
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
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
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
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
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
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
Kenneth Myhra
afb74eca52 LibWeb: Implement AO transform_stream_unblock_write 2024-06-09 21:27:26 -04:00
Kenneth Myhra
c51d01bea7 Fetch: Make sure we iterate over HeaderMap's headers()
This fixes a build failure when built with CMake option
'-DENABLE_ALL_THE_DEBUG_MACROS=ON'.
2024-06-09 21:13:25 -04:00
Tim Ledbetter
d33c4c751f LibWeb+WebContent: Provide feedback on find in page requests
This change allows the results of a find in page query to be reported
back to the user interface. Currently, the number of results found and
the current match index are reported.
2024-06-09 21:12:33 -04:00
Andreas Kling
260c5c50ad LibHTTP+RequestServer: Use HTTP::HeaderMap for request headers
No longer just for response headers! The same type is obviously useful
and ergonomic when making requests as well.
2024-06-09 15:34:02 +02:00
Andreas Kling
5ac0938859 LibHTTP+LibWeb: Stop bundling "Set-Cookie" headers as JSON
Before we had HTTP::HeaderMap (which preserves multiple headers with the
same name), we collected multiple "Set-Cookie" headers and bundled them
together as a JSON array.

This was a huge hack, and now we can stop doing that, since LibWeb gets
access to the full set of headers now.
2024-06-09 15:34:02 +02:00
Andreas Kling
e636851481 LibHTTP+RequestServer: Add HTTP::HeaderMap and use for response headers
Instead of using a HashMap<ByteString, ByteString, CaseInsensitive...>
everywhere, we now encapsulate this in a class.

Even better, the new class also allows keeping track of multiple headers
with the same name! This will make it possible for HTTP responses to
actually retain all their headers on the perilous journey from
RequestServer to LibWeb.
2024-06-09 15:34:02 +02:00
Diego
c86e89665b LibWasm: Validate that names are UTF-8 2024-06-09 12:16:32 +02:00
Enver Balalic
5e66512cbd LibWasm: Implement f32x4 and f64x2 arithmetic SIMD ops
Adds all the arithmetic ops for f32x4 and f64x2 SIMD instructions.

With this, we pass 8375 additional tests :)

Quite a few of the spec tests for this are still failing.
I confirmed with the wasmer runtime manually for a number of them,
and we seem to match their and results. I'm not really sure
what's happening here, a spec bug or wasmer is broken in
the same way.

18476 failed before.
10101 failed after.
2024-06-09 12:14:59 +02:00
Timothy Flynn
5f7251fd91 LibJS+LibLocale: Replace list formatting with ICU
This also largely eliminates the need for some ECMA-402 AOs, as is it
all handled internally by ICU (which the spec is basically based on).
2024-06-09 10:47:28 +02:00
Timothy Flynn
d17d131224 LibJS+LibLocale: Replace locale character ordering with ICU 2024-06-09 10:47:28 +02:00
Timothy Flynn
e487f91388 LibJS+LibLocale: Replace locale maximization and minimization with ICU 2024-06-09 10:47:28 +02:00
Timothy Flynn
9724a25daf LibJS+LibLocale: Replace canonical locales and display names with ICU
Note: We keep locale parsing and syntactic validation as-is. ECMA-402
places additional restrictions on locales above what is required by the
Unicode spec. ICU doesn't provide methods that let us easily check those
restrictions, whereas LibLocale does. Other browsers also implement
their own validators here.

This introduces a locale cache to re-use parsed locale data and various
related structures (not doing so has a non-negligible performance impact
on Intl tests).

The existing APIs for canonicalization and display names are pretty
intertwined, so they must both be adapted at once here. The results of
canonicalization are slightly different on some edge cases. But the
changed results are actually now aligned with Chrome and Safari.
2024-06-09 10:47:28 +02:00
Timothy Flynn
221507c567 LibLocale: Install ICU package and link into LibLocale
Rather than removing LibLocale entirely, we will use it as a wrapper
around ICU (which has some C-like interfaces, and uses UTF-16 for its
string types). Using ICU will provide better web compatibility overall,
and will let us implement features we were previously unable to (e.g.
Intl.Collator requires data that is not in the JSON export of the CLDR).
2024-06-09 10:47:28 +02:00
Shannon Booth
e0bbbc729b LibWeb: Add stub for ValidityState
This fixes https://html5test.com/ as previously an exception was being
thrown after trying to access this attribute which would then result in
a popup about the test failing (and none of the test results being
shown).
2024-06-09 10:13:32 +02:00
Kenneth Myhra
0ec0e92b10 LibWeb: Implement static method ReadableStream.from(asyncIterable) 2024-06-09 10:12:46 +02:00
Kenneth Myhra
01a8b5ee54 LibWeb: Implement AO readable_stream_from_iterable 2024-06-09 10:12:46 +02:00
Kenneth Myhra
ce521a196d LibWeb: Add non-standard AO set_up_readable_stream
This AO can be used instead of CreateReadableStream in cases where we
need to set up a newly allocated ReadableStream before initialization of
said ReadableStream, i.e. ReadableStream is captured by lambdas in an
uninitialized state.
2024-06-09 10:12:46 +02:00
Shannon Booth
7a77130923 LibWeb: Do not release_value twice parsing a referrer policy
This fixes a bug introduced in ab6b687d4c which was causing many live
sites (such as chat.openai.com and github.com/serenityos/serenity) to
crash.
2024-06-09 07:02:59 +01:00
Matthew Olsson
7925efda5f LibWeb: Do not clamp the output of the cubic bezier timing function
It is fine for timing function to be outside of the range [0, 1]
2024-06-08 07:58:58 +02:00
Matthew Olsson
7f902fa2dc LibWeb: Prevent overrunning loop bounds in cubic bezier calculation 2024-06-08 07:58:58 +02:00
Matthew Olsson
31618abf15 LibWeb: Correct observable property access order in KeyframeEffect
Apparently these are supposed to be accessed in alphabetical order
2024-06-08 07:58:58 +02:00
Matthew Olsson
c85f00e373 LibWeb: Only read enumerable keyframe properties 2024-06-08 07:58:58 +02:00
Andreas Kling
b118c99c27 LibWeb: Add null check in Document::ancestor_navigables()
The spec doesn't explicitly forbid calling this when the document
doesn't have a node navigable, so let's handle that situation gracefully
by just returning an empty list of ancestors.

I hit this VERIFY somewhere on the web, but I don't know how to
reproduce it.
2024-06-07 19:39:45 +02:00
Jamie Mansfield
bbd82265e1 LibWeb/CSS: Implement FontFaceSet.onloadingerror 2024-06-07 19:30:35 +02:00
Jamie Mansfield
e56e09b820 LibWeb/CSS: Implement FontFaceSet.onloadingdone 2024-06-07 19:30:35 +02:00
Jamie Mansfield
4210586730 LibWeb/CSS: Implement FontFaceSet.onloading 2024-06-07 19:30:35 +02:00
Jamie Mansfield
c6a6a7c4f0 LibWeb/CSS: FontFaceSet extends EventTarget 2024-06-07 19:30:35 +02:00
Jamie Mansfield
839dc01280 LibWeb/CSS: Stub FontFaceSet.check 2024-06-07 19:30:35 +02:00
Diego
bd6ee060d2 LibWasm: Check data section offset for overflow during instantiation 2024-06-07 18:45:56 +02:00
Andreas Kling
28d4e326f8 LibGfx: Use the woff2 library to decode WOFF2 font files
This saves us the trouble of maintaining our own implementation,
and instantly brings us to full WOFF2 feature parity with others.

Co-Authored-By: Andrew Kaster <akaster@serenityos.org>
2024-06-07 18:42:12 +02:00
Aliaksandr Kalenik
9be5867eb2 LibWeb: Implement rejection by bounding box for PaintInnerBoxShadow
Before this change we were painting inner shadows lying outside of
viewport.

Improves painting performance on Github and Twitter where this command
is used a lot.
2024-06-07 18:41:57 +02:00
Aliaksandr Kalenik
1c8d37d528 LibWeb: Rename PaintOuterBoxShadowParams to PaintBoxShadowParams
Drop "outer" from the name because this struct is used for both inner
and outer shadows.
2024-06-07 18:41:57 +02:00
Aliaksandr Kalenik
22bb476b6f LibWeb: Use ints instead of DevicePixels in PaintOuterBoxShadowParams
DevicePixels concept should not leak from painting recording phase.
2024-06-07 15:42:38 +02:00
Aliaksandr Kalenik
2dd3b6fcff LibWeb: Remove unused members in PaintOuterBoxShadowParams
This struct had all members in CSSPixels and DevicePixels, but only the
latter are needed for painting.

Shrinks PaintOuterBoxShadowParams from 144 bytes to 72 bytes.
2024-06-07 15:42:38 +02:00
Jamie Mansfield
ab6b687d4c LibWeb: Implement "Set request’s referrer policy on redirect" AO 2024-06-07 09:54:19 +02:00
Jamie Mansfield
5a40a00d9e LibWeb/ReferrerPolicy: Add spec link for strip URL AO 2024-06-07 09:54:19 +02:00
Jamie Mansfield
8542a8b458 LibWeb/Fetch: Update "HTTP-redirect fetch" algorithm to latest spec
The spec and implementation's comments had diverged a little, this
brings them in line :)
2024-06-07 09:54:19 +02:00
Jamie Mansfield
8f2cb6755b LibWeb: Implement HTMLAreaElement.referrerPolicy 2024-06-07 09:54:19 +02:00
Jamie Mansfield
64eadab181 LibWeb: Implement HTMLIFrameElement.referrerPolicy 2024-06-07 09:54:19 +02:00
Jamie Mansfield
1aa58b6d8c LibWeb: Implement HTMLImageElement.referrerPolicy 2024-06-07 09:54:19 +02:00
Jamie Mansfield
f82c727071 LibWeb: Implement HTMLLinkElement.referrerPolicy 2024-06-07 09:54:19 +02:00
Jamie Mansfield
469cbe78de LibWeb: Use Reflect for HTMLAnchorElement.referrerPolicy 2024-06-07 09:54:19 +02:00
Jamie Mansfield
53d7aa53a2 LibWeb: Use Enumerated for HTMLScriptElement.referrerPolicy 2024-06-07 09:54:19 +02:00
Jamie Mansfield
7ce35b75aa LibWeb: Implement should block mixed content response to request 2024-06-07 09:50:30 +02:00
Jamie Mansfield
2159377296 LibWeb: Upgrade mixed requests to potentially trustworthy URLs
(if appropriate)
2024-06-07 09:50:30 +02:00
Jamie Mansfield
8f0d035145 LibWeb: Implement should block mixed content request 2024-06-07 09:50:30 +02:00
Andrew Kaster
d90a9ab70c LibWeb: Add Web::UIEvents::KeyCode and KeyModifier enums, drop Kernel
This was the last Kernel header we had. Move the definitions we need
into a UIEvents header similar to MouseButton.
2024-06-07 09:44:41 +02:00
Andrew Kaster
f98e28912a LibCore: Only include BeepInstruction in System.cpp on Serenity
It remains to be seen whether we actually need this on serenity either..
2024-06-06 12:51:14 -06:00
Andrew Kaster
2770b7eecd LibCore: Null-check struct addrinfo to avoid freeaddrinfo(NULL)
On some C libraries, like NetBSD and musl-libc, this under-specified
edge case results in a crash rather than silently ignoring the null
pointer.
2024-06-06 12:48:58 -06:00
Andrew Kaster
405ce6e5f5 LibCore: Be more BSD-friendly in Core::Environment
FreeBSD and NetBSD don't have secure_getenv(3), same as macOS.
FreeBSD 13 and lower also don't allow setting environ pointers to null.

Co-Authored-By: Robert Clausecker <fuz@FreeBSD.org>
2024-06-06 12:48:58 -06:00
Andrew Kaster
89092e98a4 LibJS: Pass -1 as fd when using MAP_ANONYMOUS with mmap
NetBSD and FreeBSD get upset when we don't set the fd to an invalid
value when using a non-shared mapping.

Reported-By: Thomas Klausner <wiz@gatalith.at>
2024-06-06 12:48:58 -06:00
easrng
43b8f82e94 LibGfx: Ignore nonexistent font directories 2024-06-06 10:42:55 -06:00
easrng
f058939f1b LibCore: Get font directories from XDG_DATA_DIRS 2024-06-06 10:42:55 -06:00
Andrew Kaster
aef6ece9e6 Meta: Remove shred utility 2024-06-06 09:43:51 -06:00
Timothy Flynn
d61770c457 LibCore: Remove now-unused singleton process utilities 2024-06-06 11:27:03 -04:00
Timothy Flynn
8362c073f3 Everywhere: Remove LibSQL, SQLServer, and the sql REPL :^)
It is now entirely unused and replaced by sqlite3.
2024-06-06 11:27:03 -04:00
Timothy Flynn
30e745ffa7 LibWebView: Replace usage of LibSQL with sqlite3
This makes WebView::Database wrap around sqlite3 instead of LibSQL. The
effect on outside callers is pretty minimal. The main consequences are:

1. We must ensure the Cookie table exists before preparing any SQL
   statements involving that table.
2. We can use an INSERT OR REPLACE statement instead of separate INSERT
   and UPDATE statements.
2024-06-06 11:27:03 -04:00
Timothy Flynn
65ddd0553b Meta+LibWebView: Install and link sqlite3 with vcpkg
We will use sqlite3 as a replacement for LibSQL. Using a tried-and-true
database will allow us to avoid maintaining our an incomplete, non-ACID,
and less performant implementation. It also means we do not have to
launch and manage the singleton SQLServer process.
2024-06-06 11:27:03 -04:00
Timothy Flynn
d1ec32e28f LibProtocol: Exit fatally if the connection to RequestServer disappears
The default implementation of die() causes the client process to simply
exit cleanly. This prevents any tests from recognizing that something
went wrong, as the process exits with a code of 0. With this patch, we
still just exit when the connection dies, but with a fatal signal. In
the future, we will want to launch a new RequestServer process and
re-establish client connections.
2024-06-06 13:55:10 +02:00
Enver Balalic
862fc91b2c LibWeb: Implement HTMLImageElement::decode with a few FIXMEs
Implements enough of HTMLImageElement::decode for it to not break
websites and actually load an image :)
2024-06-06 08:20:02 +02:00
Andrew Kaster
7b67fa706f DOM: Check for navigable destruction in declarative refresh timer
If the Document's navigable has been destroyed since we started this
timer, or it's no longer the active document of its navigable, we
shouldn't navigate to it.
2024-06-06 08:13:34 +02:00
Nathan E. Egge
b040e5c12b LibTimeZone: Remove AK_OS_SERENITY ifdef
Remove special case for SerenityOS as fallback will still work.
2024-06-05 22:23:15 -04:00
Nathan E. Egge
d83ab035ee LibTimeZone: Read /etc/timezone for current TZ
Fallback to reading /etc/timezone by calling system_time_zone() when
unable determine time zone from /etc/localtime.
This works on systems where /etc/localtime is a file and not a symlink.

Fixes #65
2024-06-05 22:23:15 -04:00
Tim Ledbetter
c79041344d LibWeb: Ensure anchor node is not null when extending selection
Previously, clicking while holding shift without having previously made
any text selection would cause a crash.
2024-06-05 13:57:01 -04:00
Andrew Kaster
90af26e309 Meta+CMake: Remove unused CMake functions and features
Goodbye, serenity_components and Jakt.
2024-06-05 12:23:54 -04:00
Tim Ledbetter
f721230456 LibWeb: Extend text selection when left clicking and holding shift 2024-06-05 11:51:41 -04:00
Andreas Kling
f42c18bc4c LibGfx: Make Painter::target() return a Bitmap&
Painter always has a target bitmap, so let's return a reference.
2024-06-05 15:37:05 +02:00
Andreas Kling
a1a59ec3ab LibGfx: Remove unused Painter::draw_text() overloads 2024-06-05 15:37:05 +02:00
Andreas Kling
2f23912a55 LibGfx: Remove unused cruft from Painter.h 2024-06-05 15:37:05 +02:00
Andreas Kling
fe4cc32380 Everywhere: Include <LibGfx/Painter.h> in fewer places
Touching Painter.h now rebuilds ~40 files instead of ~300.
2024-06-05 15:37:05 +02:00
Andreas Kling
0e47e5e265 LibGfx: Move Gfx::Painter::LineStyle => Gfx::LineStyle 2024-06-05 15:37:05 +02:00
Andreas Kling
57906a4e1b LibGfx: Move Gfx::Painter::WindingRule => Gfx::WindingRule 2024-06-05 15:37:05 +02:00
Andreas Kling
254d040ff4 LibGfx: Move Gfx::Painter::ScalingMode => Gfx::ScalingMode
This will allow users to avoid including Painter.h
2024-06-05 15:37:05 +02:00
Andreas Kling
5e059c80cd LibGfx: Remove unused TabPosition.h 2024-06-05 15:37:05 +02:00
Andreas Kling
6a96920dbc LibGfx: Remove Bitmap and Painter "scale" concept
We don't need intrinsic scale factors for Gfx::Bitmap in Ladybird,
as everything flows through the CSS / device pixel ratio mechanism.

This patch also removes various unused functions instead of adapting
them to the change.
2024-06-05 15:37:05 +02:00
Andreas Kling
fce4739d3e LibTLS: Put debug spam about loaded certificates behind TLS_DEBUG 2024-06-05 07:11:34 +02:00
Andreas Kling
a0874dc870 LibWebView: Remove ProcessManager debug spam 2024-06-05 07:10:42 +02:00
Aliaksandr Kalenik
881e970846 LibWeb: Implement scrollbars dragging 2024-06-05 07:03:42 +02:00
Aliaksandr Kalenik
94eacf6da7 LibWeb: Remove did_request_scroll_to IPC call
No longer used after moving scrollbar painting into WebContent.
2024-06-05 07:03:42 +02:00
Aliaksandr Kalenik
cc3d95a356 LibWeb: Remove did_request_scroll IPC call
No longer used after moving scrollbar painting into WebContent.
2024-06-05 07:03:42 +02:00
Aliaksandr Kalenik
5285e22f2a LibWeb+WebContent: Move scrollbar painting into WebContent
The main intention of this change is to have a consistent look and
behavior across all scrollbars, including elements with
`overflow: scroll` and `overflow: auto`, iframes, and a page.

Before:
- Page's scrollbar is painted by Browser (Qt/AppKit) using the
  corresponding UI framework style,
- Both WebContent and Browser know the scroll position offset.
- WebContent uses did_request_scroll_to() IPC call to send updates.
- Browser uses set_viewport_rect() to send updates.

After:
- Page's scrollbar is painted on WebContent side using the same style as
  currently used for elements with `overflow: scroll` and
  `overflow: auto`. A nice side effects: scrollbars are now painted for
  iframes, and page's scrollbar respects scrollbar-width CSS property.
- Only WebContent knows scroll position offset.
- did_request_scroll_to() is no longer used.
- set_viewport_rect() is changed to set_viewport_size().
2024-06-05 07:03:42 +02:00
Aliaksandr Kalenik
eb909118bf LibWeb: Propagate scrollbar-width property from root element to viewport 2024-06-05 07:03:42 +02:00
Aliaksandr Kalenik
50920b0595 LibWeb: Scroll into viewport from a task in set_focused_element()
This is a hack needed to preserve current behaviour after making set
viewport_rect() being not async in upcoming changes.

For example both handle_mousedown and handle_mouseup should use the same
viewport scroll offset even though handle_mousedown runs focusing steps
that might cause scrolling to focused element:
- handle_mousedown({ 0, 0 })
  - run_focusing_steps()
  - set_focused_element()
  - scroll_into_viewport() changes viewport scroll offset
- handle_mouseup({ 0, 0 })
2024-06-05 07:03:42 +02:00
Jamie Mansfield
8e062a52a3 LibWeb: Move NetworkPartitionKey into a header
This is used elsewhere, such as the HTMLLinkElement.
2024-06-05 05:42:47 +01:00
Jamie Mansfield
2ffda00347 LibWeb: Implement HTMLImageElement.crossOrigin 2024-06-05 05:42:47 +01:00
Jamie Mansfield
d7d60268ec LibWeb: Implement HTMLLinkElement.crossOrigin 2024-06-05 05:42:47 +01:00
Jamie Mansfield
735859bc10 LibWeb: Implement HTMLLinkElement.fetchPriority 2024-06-05 05:42:47 +01:00
Jamie Mansfield
d1f884533e LibWeb: Update "create a link request" for spec changes
Fetch priority is added, and one line is split into two :)
2024-06-05 05:42:47 +01:00
Jamie Mansfield
21cf2c2981 LibWeb: Implement HTMLScriptElement.fetchPriority 2024-06-05 05:42:47 +01:00
Jamie Mansfield
8315ad6759 LibWeb: Implement HTMLImageElement.fetchPriority 2024-06-05 05:42:47 +01:00
Jamie Mansfield
956106c6d8 LibWeb: Add from_string function for request priority 2024-06-05 05:42:47 +01:00
Jamie Mansfield
2fde20adf9 LibWeb: Add IDL enum for fetch priority attribute 2024-06-05 05:42:47 +01:00
Andreas Kling
4822d1da4e LibWeb: Remove unused CRC2D::bitmap_font_fill_text() 2024-06-04 18:45:30 +02:00
Andreas Kling
e81bd34561 LibGfx: Remove more unused Font APIs 2024-06-04 18:45:30 +02:00
Andreas Kling
a4a3703fb4 LibGfx: Remove unused GlyphBitmap class 2024-06-04 18:45:30 +02:00
Andreas Kling
d86f54da30 LibGfx: Remove Font::presentation_size()
This was a legacy version of point_size() that returned a u8.
2024-06-04 18:45:30 +02:00
Andreas Kling
d95f5692a3 LibGfx: Remove Font::qualified_name() and some FontDatabase APIs
...because the FontDatabase APIs were not used, and they were the only
users of qualified_name().
2024-06-04 18:45:30 +02:00
Andreas Kling
eccfdede10 LibGfx: Remove various unused Font APIs 2024-06-04 18:45:30 +02:00
Andreas Kling
23bb449026 LibGfx: Remove Utf32View APIs from Painter 2024-06-04 18:45:30 +02:00
Andreas Kling
1a2a34fa43 LibGfx: Remove Bitmap::glyph_spacing()
This was only ever non-zero for SerenityOS bitmap fonts.
2024-06-04 18:45:30 +02:00
Andreas Kling
04a6e2f83d LibWeb: Remove Gfx::BitmapFont
This class supported the binary bitmap font file format in SerenityOS,
and isn't something we need in Ladybird.
2024-06-04 18:45:30 +02:00
Andreas Kling
30a92911fa WebContent: Remove update_system_fonts() IPC message
This was no longer doing anything. We'll eventually want a way to pass
system default fonts to each WebContent process, but we don't need to
squeeze everything through this API that was really meant for Serenity's
very idiosyncratic font system.
2024-06-04 18:45:30 +02:00
Andreas Kling
f78ed0600a LibGfx: Remove FontDatabase "default queries"
At last, nothing depends on these anymore.
2024-06-04 18:45:30 +02:00
Andreas Kling
966d442152 LibWeb+Ladybird: Remove FontPluginSerenity (+ use Ladybird::FontPlugin) 2024-06-04 18:45:30 +02:00
Andreas Kling
fac126bce9 Ladybird+LibWeb: Stop using Gfx::FontDatabase default fonts
This closes the window at WebContent process startup where we were
relying on Gfx::FontDatabase having some resolvable value in its default
font query.
2024-06-04 18:45:30 +02:00
Andreas Kling
49d546fe8b LibGfx: Remove Painter "draw op" mechanism
We were not making use of this in Ladybird, so let's simplify.
2024-06-04 18:45:30 +02:00
Andreas Kling
d3e802cbef LibGfx: Remove a whole bunch of unused Painter APIs 2024-06-04 18:45:30 +02:00
Andreas Kling
10335a07ee LibGfx: Remove Painter's "implicit font" concept
Nothing actually needs this, so let's remove it and no longer have to
deal with figuring out its fallback value.
2024-06-04 18:45:30 +02:00
Andreas Kling
ba8945f6f3 LibWeb: Make DrawText paint command always have a font
Nobody ever tries to create one without a font anyway.
2024-06-04 18:45:30 +02:00
Andreas Kling
1b2d08ee7e LibGfx: Remove a bunch of unused classes 2024-06-04 18:45:30 +02:00
Simon Wanner
0ab4722cee LibTextCodec: Use generated lookup tables for all single byte decoders 2024-06-04 10:21:07 +02:00
Simon Wanner
6b2c459901 LibTextCodec: Fix ISO-8859-1 vs. windows-1252 handling in web contexts
The Encoding specification maps ISO-8859-1 to windows-1252 and expects
the windows-1252 translation table to be used, which differs from
ISO-8859-1 for 0x80-0x9F.

Other contexts expect to get the actual ISO-8859-1 encoding, with 1-to-1
mapping to U+0000-U+00FF, when requesting it.

`decoder_for_exact_name` is introduced, which skips the mapping from
aliases to the encoding name done by `get_standardized_encoding`.
2024-06-04 10:21:07 +02:00
Simon Wanner
46d5cf0443 LibTextCodec: Fix some incorrect encoding aliases 2024-06-04 10:21:07 +02:00
Simon Wanner
09f2d79cb1 LibTextCodec: Bring TextCodec::get_standardized_encoding closer to spec 2024-06-04 10:21:07 +02:00
Simon Wanner
987910ad0f LibWeb: Bring TextDecoder constructor closer to spec 2024-06-04 10:21:07 +02:00
Andreas Kling
6321e97b09 AK: Remove various unused things 2024-06-04 09:19:39 +02:00
Andreas Kling
5b4d071daa Everywhere: Remove LibCrypt
This was totally unused.
2024-06-04 09:19:39 +02:00
Andreas Kling
f2fd8fc928 Everywhere: Remove LibGemini
This hasn't been maintained (or worked at all) for a long time,
and it's not a widely supported protocol, so let's drop it.
2024-06-04 09:19:39 +02:00
Andreas Kling
e4cd91761d Everywhere: Remove LibMarkdown
This was used to convert markdown into HTML for display in the browser,
but no other browser behaves this way, so let's simplify things by
removing it.

(Yes, we could implement all kinds of "convert to HTML and display" for
every file format out there, but that's far outside the scope of a
browser engine.)
2024-06-04 09:19:39 +02:00
Timothy Flynn
edb527e04d Libraries: Remove some Serenity-only interface implementations 2024-06-04 07:45:42 +02:00
Timothy Flynn
126cbce632 Meta: Remove empty LibSystem library and references 2024-06-04 07:45:42 +02:00
Jamie Mansfield
a419dcbe8b LibWeb/Fetch: Update "HTTP fetch" algorithm to latest spec comments
The spec and implementation's comments had diverged a little, this
brings them in line :)
2024-06-04 07:27:52 +02:00
Diego
50dc1c3c19 LibWasm: Fix memarg multi-memory reading
The extension bit for the memory index present in memargs is at
position 6, but we previously checked position 5, which caused a few
spec issues.
2024-06-03 16:20:19 +02:00
Tim Ledbetter
c76140f6ed LibDSP: Remove LibDSP 2024-06-03 15:58:55 +02:00
Tim Ledbetter
d7768cdd0f LibAudio: Move MDCT.h from LibDSP to LibAudio 2024-06-03 15:58:55 +02:00
Timothy Flynn
bdbe2fdcc5 Everywhere: Replace SERENITY_SOURCE_DIR with LADYBIRD_SOURCE_DIR
In order to have checkouts of both SerenityOS and Ladybird, we need to
use a different environment variable for Ladybird.
2024-06-03 15:57:59 +02:00
Andreas Kling
e70d96e4e7 Everywhere: Remove a lot more things we don't need 2024-06-03 10:53:53 +02:00
Andreas Kling
421aa7c475 Everywhere: Remove more unused components 2024-06-03 10:53:53 +02:00
Tim Ledbetter
5863ef852d Meta: Remove references to unused utilities 2024-06-03 10:53:53 +02:00
Tim Ledbetter
b82eaad274 Ladybird: Move BrowserSettings/Defaults.h to Ladybird/DefaultSettings.h 2024-06-03 10:53:53 +02:00
Andrew Kaster
dd1fbd3513 Meta: Remove SerenityOS components not needed for Ladybird 2024-06-03 10:53:53 +02:00