Commit graph

44070 commits

Author SHA1 Message Date
Luke Wilde
34c130b336 LibWeb: Stub Range.getBoundingClientRect
This seems to be used by Discord around the chat message box, but
didn't explore very far.
2022-12-10 00:21:10 +00:00
Luke Wilde
1e9cc2e211 LibWeb: Stub HTMLMediaElement.pause
Required for rendering GIFs on Discord.
2022-12-10 00:21:10 +00:00
Luke Wilde
2c77364716 LibWeb: Add spec link to HTMLMediaElement::load 2022-12-10 00:21:10 +00:00
Luke Wilde
4db2efaecb LibJS/Bytecode: Implement yield* 2022-12-10 00:21:10 +00:00
Luke Wilde
758a4cb1a6 LibJS/Bytecode: Implement var/lexical binding destructuring in for/of 2022-12-10 00:21:10 +00:00
Sam Atkins
64cfe2b163 SpaceAnalyzer: Display the current location in the window title :^) 2022-12-09 23:23:00 +00:00
Sam Atkins
d8ceaf7870 SpaceAnalyzer: Add a tooltip for the hovered tree node
Many of the nodes are visually too small to show their full name and
file size, so this makes that information visible.
2022-12-09 23:23:00 +00:00
Sam Atkins
6d64e650f1 SpaceAnalyzer: Remove declaration for unimplemented method 2022-12-09 23:23:00 +00:00
Timothy Flynn
5ece0a13c4 SQLServer: Add a hook to inform owners of disconnected SQL clients 2022-12-09 20:33:19 +00:00
Andreas Kling
fbf9cb3387 WebContent+LibWeb+LibJS: Simplify injection of JS console globals
Instead of creating a new global object and proxying everything through
it, we now evaluate console inputs inside a `with` environment.

This seems to match the behavior of WebKit and Gecko in my basic
testing, and removes the ConsoleGlobalObject which has been a source of
confusion and invalid downcasts.

The globals now live in a class called ConsoleGlobalObjectExtensions
(renamed from ConsoleGlobalObject since it's no longer a global object).

To make this possible, I had to add a way to override the initial
lexical environment when calling JS::Interpreter::run(). This is plumbed
via Web::HTML::ClassicScript::run().
2022-12-09 18:51:03 +00:00
Xexxa
23b07b3408 Base: Add emoji flags for French subdivisions
🏴󠁦󠁲󠁢󠁲󠁥󠁿 -
U+1F3F4 U+E0066 U+E0072 U+E0062 U+E0072 U+E0065 U+E007F FR-BRE
Bretagne
🏴󠁦󠁲󠁯󠁣󠁣󠁿 -
U+1F3F4 U+E0066 U+E0072 U+E006F U+E0063 U+E0063 U+E007F FR-OCC
Occitanie
🏴󠁦󠁲󠁮󠁡󠁱󠁿 -
U+1F3F4 U+E0066 U+E0072 U+E006E U+E0061 U+E0071 U+E007F FR-NAQ
Nouvelle-Aquitaine
🏴󠁦󠁲󠁰󠁡󠁣󠁿 -
U+1F3F4 U+E0066 U+E0072 U+E0070 U+E0061 U+E0063 U+E007F FR-PAC
Provence-Alpes-Côte-d’Azur
🏴󠁦󠁲󠁮󠁯󠁲󠁿 -
U+1F3F4 U+E0066 U+E0072 U+E006E U+E006F U+E0072 U+E007F FR-NOR
Normandie
🏴󠁦󠁲󠁰󠁤󠁬󠁿 -
U+1F3F4 U+E0066 U+E0072 U+E0070 U+E0064 U+E006C U+E007F FR-PDL
Pays-de-la-Loire
🏴󠁦󠁲󠁣󠁯󠁲󠁿 -
U+1F3F4 U+E0066 U+E0072 U+E0063 U+E006F U+E0072 U+E007F FR-COR
Corse
🏴󠁦󠁲󠁡󠁲󠁡󠁿 -
U+1F3F4 U+E0066 U+E0072 U+E0061 U+E0072 U+E0061 U+E007F FR-ARA
Auvergne-Rhône-Alpes
🏴󠁦󠁲󠁣󠁶󠁬󠁿 -
U+1F3F4 U+E0066 U+E0072 U+E0063 U+E0076 U+E006C U+E007F FR-CVL
Centre-Val de Loire
🏴󠁦󠁲󠁢󠁦󠁣󠁿 -
U+1F3F4 U+E0066 U+E0072 U+E0062 U+E0066 U+E0063 U+E007F FR-BFC
Bourgogne-Franche-Comté
2022-12-09 18:50:52 +00:00
Arda Cinar
d46315bcc0 SpaceAnalyzer: Propagate possible errors up
These include a JSON parse error, file open errors, and vector appends.
These fix a bunch of calls to functions with `fixme` in them.
2022-12-09 16:14:32 +00:00
Arda Cinar
f0b61e1443 SpaceAnalyzer: Use raw_delta_y in TreeMapWidget::mousewheel_event
There was a FIXME about using raw delta y value of the mousewheel event
in TreeMapWidget::mousewheel_event. Some time after that code was
written, a raw delta x/y API was added to GUI::MouseEvent. This patch
simply uses that API and removes the FIXME message there.
2022-12-09 16:14:32 +00:00
Undefine
e0a904c852 LibWeb: Display DragonFly in the user agent string
Previously when build for DragonFly BSD we would error out with
unknown os error. Now we just define OS_STRING as DragonFly.
2022-12-09 12:08:05 +00:00
Aliaksandr Kalenik
2e1113cb88 LibWeb: Fix child wrapping in table fix up
- Wrapped sequence should be inserted before first non-match
node instead of next sibling of first non-match node
- If sequence is not empty after sibling traversal it should be
wrapped
2022-12-09 12:53:05 +01:00
Aliaksandr Kalenik
1a81521dd9 LibWeb: Consider specified cell widths in a table
This change makes outer min-content width and outer max-content
width for cells to be calculated in the way specifed in the spec:
- The outer min-content width of a table-cell is max(min-width,
min-content width) adjusted by the cell intrinsic offsets.
- The outer max-content width of a table-cell in a non-constrained
column is max(min-width, width, min-content width, min(max-width,
max-content width)) adjusted by the cell intrinsic offsets.
- The outer max-content width of a table-cell in a constrained
column is max(min-width, width, min-content width, min(max-width,
width)) adjusted by the cell intrinsic offsets.
2022-12-09 12:53:05 +01:00
Aliaksandr Kalenik
1da26f7395 LibWeb: Fix typo in TableFormattingContext.h 2022-12-09 12:53:05 +01:00
Aliaksandr Kalenik
c302c4081b LibWeb: Layout table rows that do not belong to table row group 2022-12-09 12:53:05 +01:00
Moustafa Raafat
b8f1e1bed2 Everywhere: Remove unnecessary AK and Detail namespace scoping 2022-12-09 11:25:30 +00:00
Moustafa Raafat
ae2abcebbb Everywhere: Use C++ concepts instead of requires clauses 2022-12-09 11:25:30 +00:00
Andreas Kling
9721da2e6a LibJS: Call shrink_to_fit() on various Vectors created during parse
Vectors that stick around in the AST were wasting a fair bit of memory
due to the growth padding we keep by default. This patch goes after some
of these vectors with the shrink_to_fit() stick to reduce waste.

Since the AST can stay around for a long time, it is worth making an
effort to shrink it down when we have a chance.
2022-12-08 23:36:17 +00:00
Andreas Kling
2e98c17347 LibJS: Shrink DeclarativeEnvironment bindings vector to fit
After setting up all the bindings in function_declaration_instantiation,
we now ask DeclarativeEnvironment to do a shrink_to_fit() on its vector
of bindings.

This ends up saving 5.6 MiB on twitter.com/awesomekling :^)
2022-12-08 23:36:17 +00:00
Andreas Kling
d77ce7bae9 AK: Add Vector::shrink_to_fit()
If there's more capacity than size, the vector is reallocated to have
capacity == size.
2022-12-08 23:36:17 +00:00
Andreas Kling
35ed82d5e6 LibJS: Shrink FunctionNode by using bitfields
By making the boolean members be bitfields, we shrink FunctionNode by a
total of 8 bytes.
2022-12-08 23:36:17 +00:00
Andreas Kling
0b2f86de71 LibJS: Make FunctionKind enum class a u8 2022-12-08 23:36:17 +00:00
Andreas Kling
dd1720f2cb LibJS: Shrink ObjectProperty AST nodes by rearranging members
By putting smaller members in the padding hole after the ASTNode base
class, we shrink ObjectProperty by 8 bytes.
2022-12-08 23:36:17 +00:00
Andreas Kling
b894acd6b2 LibJS: Make one compact allocation for CallExpression and its Arguments
Instead of CallExpression storing its arguments in a Vector<Argument>,
we now custom-allocate the memory slot for CallExpression (and its
subclass NewExpression) so that it fits both CallExpression and its list
of Arguments in one allocation.

This reduces memory usage on twitter.com/awesomekling by 8.8 MiB :^)
2022-12-08 23:36:17 +00:00
Andreas Kling
8a8d8ecb35 LibJS: Add ASTNodeWithTailArray template to pack AST node + array
This template allows us to allocate an AST node and an array of some
arbitrary type T with one allocation instead of two. This can save
a lot of memory in some cases.

Thanks to Jonathan Müller for suggesting this technique! :^)
2022-12-08 23:36:17 +00:00
Andreas Kling
c767535ca2 LibJS: Use move() on the SourceRange in create_ast_node() 2022-12-08 23:36:17 +00:00
Andreas Kling
1f909d24b6 LibJS: Shrink MemberExpression by rearranging members slightly
By putting m_computed in the padding hole after our base class,
we shrink MemberExpression by 8 bytes. :^)
2022-12-08 23:36:17 +00:00
Andreas Kling
e70f944e11 LibJS: Rearrange ASTNode members so there's a padding hole at the end
ASTNode inherits from RefCounted, which has a single 32-bit member.
This means that there's a 32-bit padding hole after RefCounted,
where we are free to put something (or it will go to waste!)

This patch moves ASTNode::m_start_offset into that padding hole,
and we now have a 32-bit padding hole at the end of ASTNode instead.

This will allow ASTNode subclasses to put things in the ASTNode hole
by moving them to the head of the member list.
2022-12-08 23:36:17 +00:00
FrHun
e647ad2ce3 LibGUI: Add OpacitySlider to ColorPicker dialog 2022-12-09 00:25:30 +01:00
FrHun
59028515c0 LibGUI: Split OpacitySlider into vertical and horizontal helper classes 2022-12-09 00:25:30 +01:00
FrHun
99624a8df4 LibGUI: Implement vertical orientation for OpacitySlider 2022-12-09 00:25:30 +01:00
FrHun
42feb0233a LibGfx: Make Rect by orientation methods generic 2022-12-09 00:25:30 +01:00
Timothy Flynn
63e2aa962d AK: Disallow implicit pointer-to-boolean conversion in JsonValue
Similar to how LibJS and LibSQL used to behave, the boolean constructor
of JsonValue is currently allowing pointers to be used to construct a
boolean value. Explicitly disallow such construction.
2022-12-09 00:05:30 +01:00
Timothy Flynn
174062e0c5 LibGUI: Register GUI icon path setters as write-only
The getters passed to REGISTER_STRING_PROPERTY are never invoked. But if
they were, they would errantly incur an implicit pointer-to-boolean cast
when their return type (Gfx::Bitmap*) is used to construct a JsonValue.
2022-12-09 00:05:30 +01:00
Timothy Flynn
746364d7c1 LibCore: Support write-only Object properties
Some properties are set and then never retrieved, e.g. GUI icon paths.
Add a helper to create such properties, similar to the read-only helper.
2022-12-09 00:05:30 +01:00
Maciej
58f5deba70 AK: Unref old m_data in String's move assignment
We were overridding the data pointer without unreffing it,
causing a memory leak when assigning a String.
2022-12-09 00:02:53 +01:00
Lucas CHOLLET
741138c585 LibGUI: Add a prefix to IncrementalSearchBanner's widgets name
Widget's name are the current way to retrieve them when using GML.
Presently, there is no way to differentiate two items that share the
same name.

`IncrementalSearchBanner` uses common names as "close_button" or
"next_button", prepend them with `incremental_search_banner_` avoid
collisions.

This fixes a bug where the close button of `CrashReporter` was confused
with the one of the search banner.

However, This solution isn't perfect, down the road, we should probably
find a way to warn about equal names and introduce something like
namespace to avoid huge prefixes.
2022-12-08 17:20:51 +01:00
Lucas CHOLLET
f14006637d CrashReporter: Factorize exiting behavior to window->close() 2022-12-08 17:20:51 +01:00
Timothy Flynn
fef255ee22 Browser: Store cookies in a LibSQL database :^)
Currently, cookies are ephemeral and only survive for the lifetime of
Browser instance. This will make Browser instead store cookies in a SQL
database for persisted access.
2022-12-08 17:14:48 +01:00
Timothy Flynn
bf060adcf9 Browser+LibWebView+WebContent: Do not domain match on cookie updates
Updating cookies through these hooks happens in one of two manners:
1. Through the Browser's storage inspector.
2. Through WebDriver's delete-cookies operation.

In (1), we should not restrict ourselves to being able to delete cookies
for the current page. For example, it's handy to open the inspector from
the welcome page and be able to delete cookies for any domain.

In (2), we already are only interacting with cookies that have been
matched against the document URL.
2022-12-08 17:14:48 +01:00
Timothy Flynn
949f5460fb AK: Add formatters for Span<T> and Span<T const>
This generalizes the formatter currently used for Vector to be usable
for any Span.
2022-12-08 17:14:48 +01:00
Timothy Flynn
c372012842 LibSQL+SQLServer+SQLStudio+sql: Give ID types a distinct name
Makes it clearer what is being stored, especially in future clients that
will store a bunch of statement IDs.
2022-12-08 17:14:48 +01:00
Timothy Flynn
44ff3a374f LibSQL: Mark SQLClient's constructor as public
Similar to WebContent, this is needed to construct the SQLClient
manually in Ladybird.
2022-12-08 17:14:48 +01:00
Timothy Flynn
517742d6f9 LibSQL+SQLServer: Generate SQLServer's IPC sources with LibSQL on Lagom
Exclude SQLServer from Lagom, and instead generate its IPC sources with
LibSQL.
2022-12-08 17:14:48 +01:00
Timothy Flynn
b3e287342f SQLServer: Store LibSQL database files in the standard data directory
This also allows for overriding the path. Ladybird will want to store
the database files in a subdirectory of the standard data directory that
contains the Ladybird application name.

Fixes #16000.
2022-12-08 17:14:48 +01:00
Timothy Flynn
49d74ee288 LibCore: Add a standard path for application data 2022-12-08 17:14:48 +01:00
Timothy Flynn
4609477ac0 LibCore: Support XDG_CONFIG_HOME when determing the user's config path
And default to a path commonly used depending on the operating system.
2022-12-08 17:14:48 +01:00