Commit Graph

56443 Commits

Author SHA1 Message Date
Andrew Kaster
3dbbb5b263 LibWeb: Implement fetch a classic worker script 2023-11-15 12:56:33 +01:00
Andrew Kaster
d7d84ee931 LibWeb: Ensure a Web::Page is associated with local Worker LoadRequests
This is a hack on top of a hack because Workers don't *really* need to
have a Web::Page at all, but the ResourceLoader infra that should be
going away soon ™️ is not quite ready to axe that requirement for
cookies.
2023-11-15 12:56:33 +01:00
Andrew Kaster
5586340cf3 LibWeb: Don't set EventTarget prototype on any WindowOrWorkerGlobalScope
The same limitations regarding construction of Window apply to all
WorkerGlobalScope classes as well.
2023-11-15 12:56:33 +01:00
Andrew Kaster
4fcff01ef3 LibWeb: Clean up assumptions in Bindings::HostDefined
We don't have a 'root execution environment' anymore (thankfully), so
we can make sure that the ESO the HostDefined object holds onto is a
NonnullGCPtr.
2023-11-15 12:56:33 +01:00
Valtteri Koskivuori
427ca284f1 Documentation: Update Helix editor documentation
Helix 23.10 made breaking changes to the way lsp configuration works, so
update documentation to reflect the new structure.
2023-11-15 06:49:48 -05:00
Aliaksandr Kalenik
eac7916d2c LibWeb: Use inner available space to calculate auto height of abspos
By using available_inner_space_or_constraints_from(available_space), we
ensure that the available space used to calculate the min/max content
height is constrained by the width specified for the box itself
(I know that at least GFC always expects available width to be
constrained by specified width if there is any).

This change improves layout in "Recent news" block on
https://telegram.org/
2023-11-15 11:26:14 +01:00
Kemal Zebari
6b5a0100d9 Browser: Move BookmarksBarWidget::PerformEditOn to anon namespace
Since none of `BookmarksBarWidget`'s methods use this enum class any
longer, let's just move it to the anonymous namespace so that
`BookmarkEditor` can still make use of it.
2023-11-14 15:38:09 -07:00
Timothy Flynn
bd1e76a98a Meta: Move .DS_Store rule to the bottom of the .gitignore file
Otherwise, opening any folder under Base in Finder on macOS may create
a tracked .DS_Store file, which we don't want committed to the repo.
2023-11-14 14:53:37 -05:00
Timothy Flynn
411f5af0b8 Meta: Automatically generate a compilation database for clangd
This is similar to how we set CMAKE_EXPORT_COMPILE_COMMANDS in the CMake
build. This adds about 5-10ms to a clean `gn gen` on my machine.
2023-11-14 14:29:35 -05:00
Timothy Flynn
665a95e39e Meta: Support (and default to) Ladybird's AppKit chrome in the GN build
The Qt chrome may be used by setting `enable_qt = true` in args.gn.
2023-11-14 14:29:35 -05:00
Adam Harald Jørgensen
e2f9011a8d Shell: Improve error propagation
This commit replaces 31 release_value_but_fixme_should_propagate_errors
calls with TRYs. :^)
2023-11-14 20:08:27 +03:30
Adam Harald Jørgensen
e89ba794d0 Shell: Include parent and base directories in expanded globs 2023-11-14 20:08:27 +03:30
Adam Harald Jørgensen
cc157629b4 Shell: Expand glob to only directories if it ends with a slash
The glob "*/" should only expand to directories, and the directories
should also have a trailing slash. This commit also replaces
Shell::split_path with StringView::split_view since it accomplishes the
same task.
2023-11-14 20:08:27 +03:30
Timothy Flynn
0415d03b4f Ladybird: Register Ladybird as a browser-type application on macOS
This allows Ladybird to be the default browser on macOS, and allows for
opening some file types (.html, .svg, .md, etc.) with Ladybird.

Note this currently only works in the GN build (and thus the Qt chrome).
The CMake build does not set up the Resources directory properly for
macOS to run the Ladybird app without $SERENITY_SOURCE_DIR set.
2023-11-14 09:36:36 -05:00
Timothy Flynn
652bbe172b Meta: Port recent changes to GN build
86ee7d219e
75caccafa4
1b30b510b9
bb43bd2dee
6322d68b1b
73ef102b01
923027b1df
dfa79ba6d8
66c9696687
521f8bd5f2
734076946b
0df06ce273
1ca46afa2f
66bd75f2b9
43dc9dfb69
4b94b0b561
4c5d48f861
c4efc0a5aa
3999c74237
4d356cfca5
2023-11-14 09:36:36 -05:00
Timothy Flynn
6ac57448af Meta: Explicitly set the sysroot path during Lagom builds
Otherwise, we don't set the -isysroot flag, and my mac is unable to
build with GN.
2023-11-14 09:36:36 -05:00
Timothy Flynn
2cb977e368 Toolchain: Actually compile the GN binary in BuildGN.sh
The gen.py script only generates the build.ninja file for GN. We have to
explicitly build it afterwards.

This also sets the executable bit on BuildGN.sh.
2023-11-14 09:36:36 -05:00
Lucas CHOLLET
1e8004734f LibPDF: Don't consider the End of Data code as normal ASCII85 input
Data encoded with ASCII85 is terminated with the EOD code 0x7E3E. This
should not be considered as normal input but rather discarded.
2023-11-14 10:15:15 +01:00
Lucas CHOLLET
59a6d4b7bc LibPDF: Factorize duplicated code in Filter::decode_ascii85() 2023-11-14 10:15:15 +01:00
Lucas CHOLLET
2fe0647c68 LibPDF: Handle pdf-specific white spaces correctly in ASCII85
We were previously only looking the space character but PDF white
spaces is a superset of ascii spaces.
2023-11-14 10:15:15 +01:00
Lucas CHOLLET
db08fe12ec LibPDF: Implement Reader::is_[eol, whitespace](char)
These two static members are now used to implement respective `matches_`
methods but will also be useful to provide a global implementation of
the specified concept of whitespace.
2023-11-14 10:15:15 +01:00
Lucas CHOLLET
dac703a0b8 LibPDF: Avoid an unnecessary copy in Filter::decode_ascii85() 2023-11-14 10:15:15 +01:00
Kemal Zebari
e80d3ff518 LibWeb: Have MimeType::create() match its foward declaration 2023-11-14 10:14:09 +01:00
Kemal Zebari
6b37095ffd LibWeb: Validate MimeType(String, String) arguments correctly
This commit correctly validates the `type` and `subtype` arguments,
instead of checking for http quoted code points, by following how
the spec's MIME type parsing algorithm would validate a MIME type's
type and subtype.

It also uses the move-assigned member variables instead of the
arguments within the constructor body (as using the arguments at
this point will lead to undesired behavior).
2023-11-14 10:14:09 +01:00
MacDue
2248d85894 LibWeb: Remove should_ensure_creation_of_paintable() SVG hack
The elements this hack was being used for were grouping elements, and
can be properly sized: https://svgwg.org/svg2-draft/struct.html#Groups.

Note: Other than one test change the elements here are already covered
by layout tests.
2023-11-14 10:13:10 +01:00
MacDue
9b2b28b612 LibWeb: Use BoundingBox helper in SVGFormattingContext 2023-11-14 10:13:10 +01:00
MacDue
f3c8e88e5e LibGfx: Use BoundingBox helper in Gfx::Path 2023-11-14 10:13:10 +01:00
MacDue
93243283f0 LibGfx: Add BoundingBox helper class
This is a small helper class to compute the bounding box of a set of
points.
2023-11-14 10:13:10 +01:00
Tim Ledbetter
9a8cc5a98d LibDNS: Ensure DNS name and label sizes are within expected limits
Previously, the DNS packet parser would happily parse a DNS packet
containing an arbitrarily large domain name. We now limit each segment
of a domain name to 63 characters and the total domain name length to
253 characters. This is consistent with RFC1035, which specifies that
the maximum name length is 255 octets. This includes the initial length
byte and final null byte, which accounts for the 2 byte difference.
2023-11-14 10:12:44 +01:00
Tim Ledbetter
1793f51bc6 LibDNS: Make DNS packet parsing fallible
Previously, a DNS packet containing an invalid name would be returned
with an empty name. With this change, an error is returned if any error
is encountered during parsing.
2023-11-14 10:12:44 +01:00
Matthew Olsson
95d62822bf LibWeb: Implement KeyframeEffect::set_pseudo_element 2023-11-14 10:12:02 +01:00
Matthew Olsson
5824916f8c LibWeb: Add KeyframeEffect IDL objects 2023-11-14 10:12:02 +01:00
Matthew Olsson
99bb5a1d08 IDLGenerators: Allow specifying multiple constructors 2023-11-14 10:12:02 +01:00
Nico Weber
9b022239c3 LibPDF: Apply all offsets of TJ operator
TJ acts on a list of either strings or numbers.
The strings are drawn, and the numbers are treated as offsets.

Previously, we'd only apply the last-seen number as offset when
we saw a string. That had the effect of us ignoring all but the
last number in front of a string, and ignoring numbers at the
end of the list.

Now, we apply all numbers as offsets.
Our rendering of Tests/LibPDF/text.pdf now matches other PDF viewers.
2023-11-14 10:11:09 +01:00
Nico Weber
4f51ff456e LibPDF: Add a test for inter-word spacing with TJ
Hand-written, based on the text example in Appendix G.2 in
the PDF 1.7 spec, with the xref table fixed up by `mutool clean`:

    mutool clean -dggg Tests/LibPDF/text.pdf Tests/LibPDF/text.pdf
2023-11-14 10:11:09 +01:00
Nico Weber
1c2b0feb7b LibPDF: Change how CFF optional width prefix is stored
Per 5177.Type2.pdf 3.1 "Type 2 Charstring Organization",
a glyph's charstring looks like:

    w? {hs* vs* cm* hm* mt subpath}? {mt subpath}* endchar

The `w?` is the width of the glyph, but it's optional. So all
possible commands after it (hstem* vstem* cntrmask hintmask
moveto endchar) check if there's an extra number at the start
and interpret it as a width, for the very first command we read.

This was done by having an `is_first_command` local bool that
got set to false after the first command. That didn't work with
subrs: If the first command was a call to a subr that just pushed
a bunch of numbers, then the second command after it is the actual
first command.

Instead, move that bool into the state. Set it to false the
first time we try to read a width, since that means we just read
a command that could've been prefixed by a width.
2023-11-14 10:10:34 +01:00
Dan Klishch
c0ffff7e88 AK: Ban JsonValue from the kernel and remove ifdef guards
JsonValue can store JsonObject which uses DS for keys, so it is not safe
to use it in the kernel even with the double/String guards.
2023-11-14 10:06:54 +01:00
Bastiaan van der Plaat
d3b3e49e19 LibJS/JIT: Use the x86_64 setcc instruction to remove a branch 2023-11-14 09:54:48 +01:00
Timothy Flynn
1d76738dde LibJS: Change Intl.Locale info APIs from property getters to methods
This is a normative change in the Intl Locale Info spec. See:
https://github.com/tc39/proposal-intl-locale-info/commit/e550152
2023-11-13 20:10:58 +01:00
Timothy Flynn
a357874c77 LibJS: Implement Intl.Locale.prototype.firstDayOfWeek
This is a normative change in the Intl Locale Info spec. See:
https://github.com/tc39/proposal-intl-locale-info/commit/f03a814
2023-11-13 20:10:58 +01:00
Tim Ledbetter
b5875700e2 LibJS: Don't hang when parsing invalid destructuring assignment target
Previously, certain crafted input could cause the JS parser to hang, as
it repeatedly tried to parse an EOF token after hitting an "invalid
destructuring assignment target" error. This change ensures that we
stop parsing after hitting this error condition.
2023-11-13 20:10:36 +01:00
Aliaksandr Kalenik
01d938c77b LibAccelGfx+LibWeb: Implement SetClipRect and ClearClipRect commands 2023-11-13 19:22:27 +01:00
Lucas CHOLLET
9e4d697d23 LibPDF: Detect DCT images correctly
Images can have multiple filters, each one of them is processed
sequentially. Only the last one will be relevant for the image format
(DCT or JPXDecode), so use the last filter instead of the first one to
detect that property.
2023-11-13 10:30:34 -05:00
Nico Weber
f882a3ae37 LibPDF: In ColorSpace creation code, use resolve_to() more
For valid PDFs, this makes no difference.

For invalid PDFs, we now assert during the cast in resolve_to() instead
of returning a PDFError. However, most PDFs are valid, and even for
invalid PDFs, we'd previously keep the old color space around when
getting the PDF error and then usually assert later when the old
color space got passed a color with an unexpected number of components
(since the components were for the new color space).

Doesn't affect any of the > 2000 PDFs I use for testing locally,
is less code, and should make for less surprising asserts when it
does happen.
2023-11-13 10:29:26 -05:00
Stephan Vedder
9c63f9854b LibJS/JIT: Remove incorrect check for empty tag
This check is not required and prevented put_by_value
to take the actual fastpath.
2023-11-13 14:28:27 +01:00
Lucas CHOLLET
9bc25db9a3 LibPDF: Add support for the LZW filter
This allows us to decode the first page of ThinkingInPostScript.pdf :^)
2023-11-13 14:23:23 +01:00
Lucas CHOLLET
048ef11136 LibPDF: Factorize flate parameters handling to its own function
This part will be shared with the LZW filter, so let's factorize it.
2023-11-13 14:23:23 +01:00
Andreas Kling
e8c0cea5f9 LibJS/JIT: Use right shift to extract type tags in equality codegen
7% speed-up on Kraken/ai-astar.js, covers up most of the regression
from adding more fast paths. :^)
2023-11-13 13:49:21 +01:00
iliadsh
ad98834b50 LibJS/JIT: Add more equality fast paths 2023-11-13 13:33:43 +01:00
iliadsh
671cbf6a5b LibJS/JIT: Add GetGlobal fast path 2023-11-13 13:33:43 +01:00