Commit graph

53232 commits

Author SHA1 Message Date
Liav A 0d30f558f4 AK+Kernel: Add the FixedStringBuffer class and StdLib functions for it
This class encapsulates a fixed Array with compile-time size definition
for storing ASCII characters.

There are also new Kernel StdLib functions to copy user data into such
objects so this class will be useful later on.
2023-08-09 21:06:54 -06:00
Liav A 3b09560251 Kernel/Memory: Split the MemoryManager.h file from user address checks 2023-08-09 21:06:54 -06:00
Luke Wilde 7550b4175e LibWeb: Unregister IntersectionObserver in finalize, not the destructor
Otherwise it UAFs the intersection root. Not sure how this didn't cause
a lot of crashes!
2023-08-09 22:12:54 -04:00
Luke Wilde 5694981352 LibWeb: Implement Element.hasAttributeNS
Particularly needed by xkcd's Right Click comic. https://xkcd.com/1975/
2023-08-09 22:10:58 -04:00
Tim Ledbetter 3a98c48f20 Ports/SDL2: Avoid accumulation errors in resampler
This adds a patch to the SDL2 port to fix a segfault which occurs in
the resampler.

Taken from this upstream commit:
https://github.com/libsdl-org/SDL/commit/78f9710

This fixes a crash we were seeing in the julius port.
2023-08-10 02:45:01 +02:00
Timothy Flynn 7003c6ffdb LibJS: Remove the isBytecodeInterpreterEnabled built-in 2023-08-09 20:47:44 +01:00
Timothy Flynn 375a6f5dd9 LibJS: Remove bytecode condition from tests expected to fail 2023-08-09 20:47:44 +01:00
Timothy Flynn 854330ec73 LibJS: Mark a test-js test as always passing
This passes in bytecode mode, which is now the only mode.
2023-08-09 20:47:44 +01:00
Andreas Kling 9c3e9e8981 LibWeb/Streams: Make ReadRequest GC-allocated
This allows it to keep its edges alive. Fixes an intermittent crash seen
by UBSAN on CI. :^)
2023-08-09 19:16:07 +02:00
Andreas Kling 40bdcdf966 LibWeb/Streams: Add WritableStreamDefaultController::visit_edges() 2023-08-09 19:16:07 +02:00
Andreas Kling 26d5d86682 LibWeb/Streams: Mark ReadableStreamGenericReaderMixin::m_realm 2023-08-09 19:16:07 +02:00
Tom d7a3b65a44 LibWeb: Vertically align HTML Button content 2023-08-09 18:34:17 +02:00
flofriday a2abc5b824 LibJS: Improve garbage collection trigger condition
This patch triggers the collector when allocated memory doubles instead
of every 100k allocations. Which can almost half (reduce by ~48%) the
time spent on collection when loading google-maps.

This dynamic approach is inspired by some other GCs like Golang's and
Lua's and improves performance in memory heavy applications because
marking must visit old objects which will dominate the marking phase if
the GC is invoked too often.

This commit also improves the Octane Splay benchmark and almost
doubles it :^)
2023-08-09 18:32:19 +02:00
Karol Kosek 7fa5dd7a92 LibWeb: Implement more steps in 'fetching a single module script'
By using fetch, the request now also follows redirects, which in the end
makes the 'Polyfilled Features' section on
https://github.github.com/browser-support/ load :^)
2023-08-09 12:08:06 -04:00
Aliaksandr Kalenik 6354f950fd LibWeb: Support "order" property for items in GridFormattingContext
Closes https://github.com/SerenityOS/serenity/issues/20434
2023-08-09 18:01:36 +02:00
Aliaksandr Kalenik 0a4b869233 LibWeb: Remove boxes_to_place from GridFormattingContext class members
Make it local variable in place_grid_items() instead.
2023-08-09 18:01:36 +02:00
Aliaksandr Kalenik bf4e2f3e9c LibWeb: Add hit testing API in internals object
Introduces `internals.hitTest(x, y)` that is going to allow us write
tests for hit testing :)
2023-08-09 17:26:44 +02:00
Andreas Kling 22a858a0cb LibWeb: Don't parse inline style sheets during HTML fragment parsing
Some websites (like Reddit) like to instantiate "components" by setting
innerHTML to a huge chunk of stuff. Sometimes those huge chunks of stuff
contain inline style sheets (i.e `<style>` elements).

Before this change, we would end up parsing the CSS in those elements
multiple times, because we had no way of knowing that we were within
a fragment parser's temporary document.

This patch avoids the extra CSS parsing work by adding adding a flag to
Document that tells us it's being used by the fragment parser. Then, we
simply avoid parsing CSS for style elements in such documents. The CSS
then gets parsed immediately upon insertion into the proper DOM.
2023-08-09 17:09:28 +02:00
Andreas Kling 97ebfd9f0f LibJS: Make Value::to_string_without_side_effects() infallible
Work towards #20449.
2023-08-09 17:09:16 +02:00
Andreas Kling b8f78c0adc LibJS: Make JS::number_to_string() infallible
Work towards #20449.
2023-08-09 17:09:16 +02:00
Andreas Kling 09547ec975 LibJS: Make PrimitiveString::deprecated_string() infallible
Work towards #20449.
2023-08-09 17:09:16 +02:00
Andreas Kling c084269e5f LibJS: Make PrimitiveString::utf8_string() infallible
Work towards #20449.
2023-08-09 17:09:16 +02:00
Andreas Kling 7849950383 LibJS: Make Utf16String & related APIs infallible
Work towards #20449.
2023-08-09 17:09:16 +02:00
Andreas Kling 9708b86d65 LibJS: Make PrimitiveString::resolve_rope_if_needed() infallible
Work towards #20449.
2023-08-09 17:09:16 +02:00
Andreas Kling 1a27c525d5 LibJS: Make PrimitiveString::create() infallible
Work towards #20449.
2023-08-09 17:09:16 +02:00
Bastiaan van der Plaat b7b02693b9 Ladybird: Remember window position and size on close 2023-08-09 13:47:44 +01:00
Jelle Raaijmakers bf927344fb Base: Teach ImageViewer and PixelPaint to open JXL, TGA images 2023-08-09 14:40:26 +02:00
Jelle Raaijmakers 1c19c2bc92 PixelPaint: Guess image type based on its filename
We do this in ImageViewer so it understands TGA images; let's do it in
PixelPaint as well :^)
2023-08-09 14:40:26 +02:00
Jelle Raaijmakers e272f796ad PixelPaint: Remove unused includes and method 2023-08-09 14:40:26 +02:00
Lucas CHOLLET a35f4bf14e LibGfx/JPEGXL: Honor the orientation parameter
Since the introduction of the JPEG XL decoder, we always read the
`orientation` field in the `ImageMetadata` bundle. This patch allows us
to render the bitmap accordingly to this transformation.
2023-08-09 13:18:40 +01:00
Lucas CHOLLET 3c1be9879f LibGfx: Add ExifOrientedBitmap
The idea behind this class is to provide an abstraction for decoders.
It allows them to use the class as if it was a normal `Bitmap`, however,
under the hood, this class will honor a given orientation, as specified
by the Exif standard. This class is introduced to be used within the
JPEG XL decoder, but it should be possible to use it for every
Exif-compatible format.
2023-08-09 13:18:40 +01:00
Jelle Raaijmakers d78590fe0d Docs: Use the term 'amend' instead of 'squash' in CONTRIBUTING.md
Hopefully this makes it more clear what the intended action is. For a
lot of people "squashing" means combining multiple commits into one,
which is a common practice when merging to a branch.
2023-08-09 07:28:06 -04:00
Andi Gallo ada05ab4e4 LibWeb: Implement fixed table layout 2023-08-09 08:33:02 +01:00
Andi Gallo 97512d0c76 LibWeb: Add table-layout CSS property 2023-08-09 08:33:02 +01:00
Lucas CHOLLET a0ea87ffc6 LibGfx/JPEGXL: Compute the position inside the channel correctly
Turns out I only decoded square images until now, which make this code
work. A bit ashamed to have written that bug.
2023-08-09 08:28:05 +01:00
Bastiaan van der Plaat bba14f6014 LibWeb: Add Canvas Context2D basic font property support 2023-08-09 05:48:32 +02:00
Bastiaan van der Plaat b05fe22d39 LibWeb: Split of compute font logic in StyleComputer 2023-08-09 05:48:32 +02:00
Bastiaan van der Plaat cc1f7d385c LibWeb: Move font stretch width calc from StyleComputer to StyleValue 2023-08-09 05:48:32 +02:00
Lucas CHOLLET eb6d41d99e LibGfx/JPEGXL: Allow ColourEncoding bundles with custom values
We don't do anything particular with images that contain a custom
ColourEncoding yet, but at least it allows us to know how to decode the
metadata of such images.
2023-08-09 05:43:19 +02:00
Lucas CHOLLET a8f041ae11 LibGfx/JPEGXL: Add support for complex distribution clustering
Complex distribution - distributions that are encoded using an internal
symbol decoder with a single distribution, are very often used for lz77
compressed images. This is a requirement for the lz77_flower test case.
2023-08-09 05:42:17 +02:00
Lucas CHOLLET 18c511f54c LibGfx/JPEGXL: Support clusters with a single distribution
This type of cluster is an exception and has specific rules (but
simpler) to be read. This is a requirement to support complex
distributions as they use a symbol decoder initialized with a single
distribution.
2023-08-09 05:42:17 +02:00
Jelle Raaijmakers a8857c06b3 Ports: Update PHP to 8.2.8 2023-08-09 05:40:39 +02:00
Jelle Raaijmakers ba776390b5 LibC: Define time* macros before definitions
Otherwise, if an application defines its own macros, the implementations
get messed up. This way we redefine those macros if they're set.

This fixes the PHP port build.
2023-08-09 05:40:39 +02:00
Sam Atkins 8356ff283b LibWeb: Implement background-attachment: local
This causes the background to scroll along with the element's contents.
2023-08-09 05:37:43 +02:00
Jelle Raaijmakers ad859a8d0d Ports: Update ScummVM to 2.7.1
The `glGetIntegerv` patch is now removed since a fix was upstreamed.
2023-08-09 05:37:05 +02:00
Timothy Flynn 3e2449d1fe Browser+WebDriver: Set the initial URL to about:blank from WebDriver
We already do this for headless-browser. There's no need to open any URL
other than about:blank when starting a WebDriver session. We should also
do this from WebDriver code, rather than in special logic in Browser's
main.cpp.
2023-08-09 05:33:24 +02:00
Timothy Flynn 93ffa77370 Ladybird: Remove workaround for initial page load for WebDriver
The issue noted in the removed comment no longer seems to apply. The URL
loaded here is triggered before WebDriver even issues the POST /session
command.
2023-08-09 05:33:24 +02:00
Timothy Flynn 6c7422e8b7 Ladybird: Only load a single URL at launch
When we launch Ladybird, we currently:

1. Create a BrowserWindow, whose constructor navigates to the configured
   new tab page URL.
2. Then navigate to either "about:blank" or whatever URL is provided via
   the command line.

This patch removes step 2 and forwards the URL from the command line (if
any) to BrowserWindow. BrowserWindow's constructor then either navigates
to that URL or the new tab page URL.
2023-08-09 05:33:24 +02:00
Timothy Flynn 27fa029537 Base: Remove FrogFind from the new tab page
Search queries no longer work for this engine, and FireFox even issues a
security warning on their home page.
2023-08-09 05:33:24 +02:00
Timothy Flynn 66e1f8cdab AK: Support serializing opaque hosts
The spec indicates we should support serializing opaque hosts, but we
were assuming the host contained a String. Opaque hosts are represented
with Empty. Return an empty string here instead to prevent crashing on
an invalid variant access.
2023-08-09 05:33:24 +02:00