Commit graph

3390 commits

Author SHA1 Message Date
Tim Ledbetter
8ef2496882 LibWeb: Stub the ServiceWorkerContainer interface
(cherry picked from commit 53ab6fa403ac774d6edb76c33a9b0f460eea9640)
2024-11-04 13:16:23 -05:00
Tim Ledbetter
c455a7492d LibWeb: Stub the ServiceWorkerRegistration interface
(cherry picked from commit 0c0a4a6042f7d25186c65ca60aa04d066dc51e97)
2024-11-04 13:16:23 -05:00
Tim Ledbetter
210d2c0193 IDLGenerators: Add register to the list of C++ keywords
This ensures that a generated C++ method called `register` will have an
underscore appended to it, avoiding a compile error.

(cherry picked from commit 70fdf7affb95679382a1d46cdcea81bd847c8768)
2024-11-04 13:16:23 -05:00
Nico Weber
f2d448a2ff Meta: Add CSS_TRANSITIONS_DEBUG to GN build 2024-11-04 13:15:58 -05:00
Andreas Kling
1030034130 LibWeb: Put CSS transitions debug spam behind CSS_TRANSITIONS_DEBUG
(cherry picked from commit 42a1a0bd73fecd22452e224859d27221588c3f5f;
amended to fix conflicts in Debug.h.in and all_the_debug_macros.cmake)
2024-11-04 13:15:58 -05:00
Nico Weber
691cb9de0f Meta: Add CSS/Interpolation.cpp to GN build 2024-11-04 13:15:58 -05:00
MacDue
36a2826cd2 Meta: Enable qemu-vdagent (for copy/paste support) by default on Linux
This updates `run.py` so that it will configure the `qemu-vdagent`
(QEMU's built-in spice agent for clipboard support) when it's available.

Setting `SERENITY_SPICE=1` is only needed to use `spicevmc`, which
implements more features (such as file transfers), but requires more
setup to get working (see Documentation/SpiceIntegration.md).

This matches the behaviour of the old `run.sh` script, the logic was
changed (perhaps unintentionally) in the `run.py` rewrite.

Note: For copy/paste to work you may need to rebuild QEMU with
`--enable-gtk-clipboard` (which is added to `Toolchain/BuildQemu.sh`
for Linux as part of this patch).
2024-11-04 08:56:57 -05:00
Nico Weber
2177b63355 Meta: Add ClipboardEvent to GN build 2024-11-01 22:04:14 -04:00
Timothy Flynn
cf1bdd72ac LibWeb: Implement DataTransferItemList.prototype.add()
(cherry picked from commit 74d9cfbf2a2ef84e8634dafc78fc56e6cb153b6b)
2024-11-01 22:04:14 -04:00
Timothy Flynn
7e3ead83b0 LibWeb: Implement the ClipboardEvent IDL interface
We don't actually generate any such events ourselves. But Google Lens
will create one with the DataTransfer attribute set to that of any drop
event we send it.

(cherry picked from commit 0b0d44da275067458e61a5dd80c4563f6aa7fdc6)
2024-11-01 22:04:14 -04:00
Timothy Flynn
c94054ff5c LibWeb: Sort list of imported namespaces
(cherry picked from commit 268d6dda2f060aef2a07dee7f06bcc57dccae136)
2024-11-01 22:04:14 -04:00
Jelle Raaijmakers
1da66b51fc Meta: Move SerenityOS.org website to separate repository
Our website is now hosted on GitHub pages, and published through this
new repository:

  https://github.com/SerenityOS/serenityos.org
2024-11-02 02:02:57 +01:00
Nico Weber
549699ac8b Meta: Make GN build actually refer to StorageAPI
This should have been part of #25241.
2024-11-01 20:24:55 -04:00
Nico Weber
819520ff1c Meta: Add dra-and-drop-related files to GN build 2024-11-01 19:58:08 -04:00
Andrew Kaster
5182adab7e LibJS+ClangPlugins: Add escape hatch for GCPtr checks
(cherry picked from commit f314f58fca04ac8246fcdacd47f4a3829d3c6e01)
2024-11-01 18:41:49 -04:00
Jamie Mansfield
ce7cbe3baa LibWeb: Implement NavigatorStorage mixin interface
Co-authored-by: Tim Flynn <trflynn89@serenityos.org>
(cherry picked from commit e3b3041a0c87f4cfd6d7941963452c3c9428b487)
2024-11-01 18:23:28 -04:00
Jamie Mansfield
e27951fc9d LibWeb: Stub StorageManager idl interface
(cherry picked from commit 1b84062c747e90ee00c5cbc42224f2c22e9e2aba)
2024-11-01 18:23:28 -04:00
Nico Weber
4897c4ee30 Meta: Add DragEvent to GN build
This should've been in #24721.

Makes Text/input/all-window-properties.html pass with the GN build.
2024-11-01 16:16:47 -04:00
Nico Weber
30c9117400 Meta: Add PerformanceNavigation to GN build 2024-11-01 16:16:35 -04:00
Colin Reeder
96d8776eba LibWeb: Add stub implementation of performance.navigation
(cherry picked from commit 14267b5d631d69091c1e9a936e1fa0f9a28752c1)
2024-11-01 16:16:35 -04:00
Davide Cavalca
b91d27061b Meta: ENABLE_NETWORK_DOWNLOADS for ca_certificates and public_suffix
(cherry picked from commit 9af91eb6228831570bef59bfd9bf0ef46d140382)
2024-11-01 09:11:56 -04:00
Annya
265c942698 LibWeb/CSS: Implement revert-layer
With the introduction of the cascade layer, the 5th CSS-wide keyword,
`revert-layer`, has been added.

(cherry picked from commit bea7eec5183a816a100d190e409a622f429d7405)
2024-10-31 21:51:50 -04:00
Hendiadyoin1
66cfe47ed8 Kernel/USBMS: Add a basic UAS driver
For now we only support USB <3.0 devices, as we don't support streams.
We also don't leverage the benefits of UAS, as we pretend to have a
queue depth of 1, ie are single threaded.

To test this driver, you can use the following command:
```
SERENITY_BOOT_DRIVE=usb-uas Meta/serenity.sh run x86_64 Clang
```
2024-10-30 18:47:50 -04:00
Nico Weber
233f87026f Meta: Add OpenTypeTaggedStyleValue to GN build 2024-10-26 09:29:16 -04:00
Sam Atkins
1df9984d5c LibWeb/CSS: Add parsing for <opentype-tag>
This is a special form of `<string>` so doesn't need its own style value
type. It's used in a couple of font-related properties. For completeness
it's included in ValueType.

(cherry picked from commit cd13b30fb871ab521777ce164bff7696aa0fbfca)
2024-10-26 09:29:16 -04:00
Nico Weber
6123113255 Meta: Add SVGImageElement to GN build 2024-10-21 12:01:12 -04:00
Sam Atkins
e47c20c994 LibWeb/CSS: Rename CalculatedStyleValue -> CSSMathValue
This matches the name in the CSS Typed OM spec. There's quite a lot
still to do to make it match the spec behavior, but this is the first
step.

(cherry picked from commit 76daba3069de4c184c6b2317d0c89b50f81a8c00)
2024-10-20 22:24:57 -04:00
Sam Atkins
068d7236cc LibWeb/CSS: Add CSSOM types for @layer rules
Depending on usage, `@layer` has two forms, with two different CSSOM
types. One simply lists layer names and the other defines a layer with
its contained rules.

(cherry picked from commit 1c6133aa523fe29c25b11284d8b3353de0a03c0f)
2024-10-20 21:09:21 -04:00
MacDue
744a9ca3f9 Meta/run.py: Prefer spicevmc over qemu-vdagent
This restores the behaviour to that of the old run.sh and allows the
spice agent to _somewhat_ work again, though file transfers are
currently fairly unreliable.
2024-10-20 19:42:39 -04:00
Sam Atkins
d76b7744fd LibWeb/CSS: Implement legacy name aliases for properties
When a property is a "legacy name alias", any time it is used in CSS or
via the CSSOM its aliased name is used instead.
(See https://drafts.csswg.org/css-cascade-5/#legacy-name-alias)

This means we only care about the alias when parsing a string as a
PropertyID - and we can just return the PropertyID it is an alias for.
No need for a distinct PropertyID for it, and no need for LibWeb to
care about it at all.

Previously, we had a bunch of these properties, which misused our code
for "logical aliases", some of which I've discovered were not even
fully implemented. But with this change, all that code can go away, and
making a legacy alias is just a case of putting it in the JSON. This
also shrinks `StyleProperties` as it doesn't need to contain data for
these aliases, and removes a whole load of `-webkit-*` spam from the
style inspector.

(cherry picked from commit fdcece2e88b91b9ec6cf63c3466525fb77540316;
amended to:
* resolve a conflict on height: in getComputedStyle-print-all.txt
* run prettier on CSSGeneratedFiles.md)
2024-10-20 10:29:44 -04:00
Nico Weber
ed58864ca2 Meta: Add STYLE_INVALIDATION_DEBUG to GN build 2024-10-20 01:32:53 -04:00
Andreas Kling
1b73445f55 LibWeb: Note what's causing a style invalidation to happen
You can now build with STYLE_INVALIDATION_DEBUG and get a debug stream
of reasons why style invalidations are happening and where.

I've rewritten this code many times, so instead of throwing it away once
again, I figured we should at least have it behind a flag.

(cherry picked from commit ddbfac38b0074819470766846fca08fd78630eb0;
minorly amended for conflicts in AK/Debug.h.in and
Meta/CMake/all_the_debug_macros.cmake due to us having more debug
macros. Also, downstream got alphabetical order for
STYLE_INVALIDATION_DEBUG wrong.)
2024-10-20 01:32:53 -04:00
Andreas Kling
49c488c3eb LibWeb: Make CSS::is_inherited_property(PropertyID) go fast
Instead of switching on the PropertyID and doing a boatload of
comparisons, we reorder the PropertyID enum so that all inherited
properties are in two contiguous ranges (one for shorthands,
one for longhands).

This replaces the switch statement with two simple range checks.

Note that the property order change is observable via
window.getComputedStyle(), but the order of those properties is
implementation defined anyway.

Removes a 1.5% item from the profile when loading https://hemnet.se/

(cherry picked from commit 1f5c49f40d0383ef1f91d6e4d838230f04dfb738;
amended for stroke-linecap in getComputedStyle-print-all.txt)
2024-10-20 01:32:53 -04:00
Shannon Booth
f9c502ce6d BindingsGenerator: Support nullable integral attributes
Previously we were assuming that the attribute return value was never
nullable and going to be returned in an Optional<IntegralType>, causing
complile errors for something such as: `attribute unsigned long?`.

(cherry picked from commit ad32227c833e60c55b0f5460a4f9f9c1631ecd57)
2024-10-18 21:58:17 -04:00
Shannon Booth
77f953405f BindingsGenerator: Factor out code to generate JS::Value from an integer
Mirroring the pre-existing `generate_from_integral` function. This will
allow us to fix a bug that all of these if statements have in common -
no handling of nullable types.

This also adjusts the type casted for each integral to fully match that
stated by the spec.

(cherry picked from commit d6243abec3e0f10ddf75a32c8a291f43cbdae169)
2024-10-18 21:58:17 -04:00
Tim Ledbetter
ffa5a7747e IDLGenerators: Make USVString attribute reflection spec compliant
USVString attributes Now replace any surrogates with the replacement
character U+FFFD and resolve any relative URLs to an absolute URL. This
brings our implementation in line with the specification.

(cherry picked from commit 335d51d6782c66e7743d773f6f6b6a32a2cb2067)
2024-10-17 21:31:52 -04:00
Shannon Booth
fe2f85c5a0 LibWeb: Implement USVString scalar value handling
USVString is defined in the IDL spec as:

> The USVString type corresponds to scalar value strings. Depending on
> the context, these can be treated as sequences of either 16-bit
> unsigned integer code units or scalar values.

This means we need to account for surrogate code points by using the
replacement character.

This fixes the last test in https://wpt.live/url/url-constructor.any.html

(cherry picked from commit aa32bfa4481f6298c99846025394b7bc415ca621)
2024-10-17 20:28:06 -04:00
Nico Weber
949c7df56c Utilities: Add a simple iconv utility
It's part of POSIX:

https://pubs.opengroup.org/onlinepubs/009604499/utilities/iconv.html

And it's an easy way to test LibTextCodec from lagom, now that
LibTextCodec also has some encoders.
2024-10-17 07:38:06 +01:00
Nico Weber
74f31d4988 Meta: Port recent changes to the GN build
4167d1214a LibTextCodec+LibURL: Implement `utf-8` and `euc-jp` encoders
2024-10-16 19:33:53 -04:00
Nico Weber
0d7de7681c LibPDF+Clients: Make Document::text_string_to_utf8() return String
It returns UTF-8 text, so make that clear in its return type,
and propagate this to clients.

No behavior change.
2024-10-16 19:31:50 -04:00
BenJilks
ab96bf642b LibTextCodec: Implement iso-2022-jp encoder
Implements the `iso-2022-jp` encoder, as specified by
https://encoding.spec.whatwg.org/#iso-2022-jp-encoder

(cherry picked from commit 0ca5675d59dbcb52cedea56729de26b41074024a)
2024-10-15 22:54:51 -04:00
BenJilks
1739838868 LibTextCodec: Implement gb18030 and gbk encoders
Implements the `gb18030` and `gbk` encoders, as specified by
https://encoding.spec.whatwg.org/#gb18030-encoder
https://encoding.spec.whatwg.org/#gbk-encoder

(cherry picked from commit d80575a4101ab0fbc22ff2b714c74530a965cd5c)
2024-10-15 22:54:51 -04:00
BenJilks
399dc388d6 LibTextCodec: Implement euc-kr encoder
Implements the `euc-kr` encoder, as specified by
https://encoding.spec.whatwg.org/#euc-kr-encoder

(cherry picked from commit 826292536c0e6f82e7173a98f1f3b24216d82fec)
2024-10-15 22:54:51 -04:00
BenJilks
4167d1214a LibTextCodec+LibURL: Implement utf-8 and euc-jp encoders
Implements the corresponding encoders, selects the appropriate one when
encoding URL search params. If an encoder for the given encoding could
not be found, fallback to utf-8.

(cherry picked from commit 72d0e3284b604c4c1373fb019250cdf5bd492300)
2024-10-15 22:54:51 -04:00
Timothy Flynn
312710e3bb Meta: Exclude LibCore, LibUnicode, and LibURL from the lagom-tools build
We only need LibCoreMinimal for the lagom-tools build. In particular, by
removing LibUnicode, we remove the lagom-tools dependence on the system
ICU package, as we do not have vcpkg hooked into this build. (We could
probably add vcpkg here, but since this libraries aren't even needed, we
don't need to bother).

(cherry picked from commit c9d9e1bb1f968165940f60d6b4b6ea0e32d1a027;
amended to fix conflicts due to cmake lists being pretty different,
in part to to us not having LadybirdBrowser/ladybird#105)
2024-10-15 20:45:29 -04:00
Nico Weber
a4e42148aa GMLCompiler: Depend on LibCoreMinimal instead of LibCore 2024-10-15 20:45:29 -04:00
Sam Atkins
b65ccb4dc6 LibWeb: Introduce color-function-specific style values
Instead of CSSColorValue holding a Gfx::Color, make it an abstract class
with subclasses for each different color function, to match the Typed-OM
spec. This means moving the color calculations from the parsing code to
the `to_color()` method on the style value.

This lets us have calc() inside a color function, instead of having to
fully resolve the color at parse time. The canvas fillStyle tests have
been updated to reflect this.

The other test change is Screenshot/css-color-functions.html: previously
we produced slightly different colors for an alpha of 0.5 and one of
50%, and this incorrect behavior was baked into the test. So now it's
more correct. :^)

(cherry picked from commit 3af6a69f1e13803c64466a9b24b7bd7d75d459df;
amended to:
* resolve a minor conflict in Parser.cpp due to upstream not having
  https://github.com/LadybirdBrowser/ladybird/pull/385#issuecomment-2227130015
* rebaseline canvas-fillstyle-rgb.png since the diff didn't apply due to
  us not having https://github.com/LadybirdBrowser/ladybird/pull/999
* remove css-color-functions-ref.png and instead update
  css-color-functions-ref.html since that file is still a reftest due to us
  not having https://github.com/LadybirdBrowser/ladybird/pull/736
  Makes it much easier to see what actually changed.
)
2024-10-11 10:12:33 -04:00
Sam Atkins
250613d494 LibWeb: Rename ColorStyleValue -> CSSColorValue
This matches the name in the CSS Typed OM spec.
https://drafts.css-houdini.org/css-typed-om-1/#csscolorvalue

This is not (yet) the same as the CSSColorValue, but one step at a time.

(cherry picked from commit 581d00293c184e47015a5d7e9c4230410567db45)
2024-10-11 10:12:33 -04:00
Sam Atkins
0a3b33e6f6 LibWeb: Rename "identifier" and "ValueID" to "Keyword" where correct
For a long time, we've used two terms, inconsistently:
- "Identifier" is a spec term, but refers to a sequence of alphanumeric
  characters, which may or may not be a keyword. (Keywords are a
  subset of all identifiers.)
- "ValueID" is entirely non-spec, and is directly called a "keyword" in
  the CSS specs.

So to avoid confusion as much as possible, let's align with the spec
terminology. I've attempted to change variable names as well, but
obviously we use Keywords in a lot of places in LibWeb and so I may
have missed some.

One exception is that I've not renamed "valid-identifiers" in
Properties.json... I'd like to combine that and the "valid-types" array
together eventually, so there's no benefit to doing an extra rename
now.

(cherry picked from commit 6a74b0164423d63904cf5a5b594772b595f57600;
very minorly amended to fix conflict in GenerateCSSKeyword.cpp caused
by #22870, and in libweb_generators.cmake due to us not having
https://github.com/LadybirdBrowser/ladybird/pull/741)
2024-10-10 10:08:59 -04:00
Sam Atkins
63e3442b15 LibWeb: Rename IdentifierStyleValue -> CSSKeywordValue
This matches the name in the CSS Typed OM spec.
https://drafts.css-houdini.org/css-typed-om-1/#csskeywordvalue

(cherry picked from commit 9559f0f123fcd1c2fddba625d4bdc4806bb8bd68)
2024-10-10 10:08:59 -04:00