Commit graph

54086 commits

Author SHA1 Message Date
Timothy Flynn
5c5a00dd3a Ladybird+LibWebView: Move CookieJar, Database, and History to LibWebView
These classes are used as-is in all chromes. Move them to LibWebView so
that non-Serenity chromes don't have to awkwardly reach into its headers
and sources.
2023-08-31 19:19:45 +02:00
Xexxa
7d313ff83d Base: Add more emoji
🙈 - U+1F648 SEE-NO-EVIL MONKEY
🙉 - U+1F649 HEAR-NO-EVIL MONKEY
🙊 - U+1F64A SPEAK-NO-EVIL MONKEY
🚉 - U+1F689 STATION
🛩️ - U+1F6E9 SMALL AIRPLANE
🛫 - U+1F6EB AIRPLANE DEPARTURE
🛬 - U+1F6EC AIRPLANE ARRIVAL
2023-08-31 11:16:44 -04:00
Bastiaan van der Plaat
43f81f1d0c Ladybird: Remove save button from settings dialog
Save new tab page value on change when valid and
show red error border when URL is not valid
2023-08-31 15:46:21 +02:00
Bastiaan van der Plaat
9510df6eab Ladybird: Move new_tab_page along to set_new_tab_page 2023-08-31 15:46:21 +02:00
Timothy Flynn
f7adc3320d Meta: Replace Lagom's LibWebView setup with LibWebView's CMakeLists.txt
This lets us add new sources to LibWebView in a single location.
2023-08-31 06:33:04 -04:00
Timothy Flynn
8d66b9ea3f Ladybird: Hook up console history into the AppKit console 2023-08-31 12:20:10 +02:00
Timothy Flynn
204a6f9241 Ladybird+LibWebView: Move console history tracking to ConsoleClient
This will allow other chromes to make use of history in their console
implementations.
2023-08-31 12:20:10 +02:00
Liav A
ed315dd950 Kernel: Move m_uid and m_gid from the Device class to SlavePTY
No other device needs to store the UID/GID of the process that created
them, so only store these values within the SlavePTY class.
2023-08-31 11:59:18 +02:00
Karol Kosek
8d81b08f6d Mail: Simplify reading message headers by issuing ENVELOPE items
`BODY[HEADER.FIELDS (...)]` gives us a part of a message that we have to
parse ourselves. Looking at the FIXME, we didn't do much good job doing
it, so let's better replace it with much simpler and probably preferred
way (FETCH command has ALL and FULL macro types that also include it.)

The tradeoff is that we get more data than we use currently (CC, BCC,
unparsed date format, message id, etc.).

Additionally this commit will try to decode 'encoded-words' in sender
names, because they are here more common.
2023-08-31 11:53:34 +02:00
Karol Kosek
1e282762a7 Mail: Allow sorting columns 2023-08-31 11:53:34 +02:00
Karol Kosek
ea70b96cf8 Mail: Use set_activates_on_selection and on_activation callback
Preparation for a sortable mailbox. Otherwise the model would resort
itself and select mail again forever.

Arrow keys will no longer load mail automatically, now you also need to
hit Enter.
2023-08-31 11:53:34 +02:00
Karol Kosek
59968c97f0 Mail: Make Date the first column 2023-08-31 11:53:34 +02:00
Karol Kosek
392fcc0ce6 Mail: Get message date using INTERNALDATE
Parsing mail headers and its date format is a rather tedious task,
especially if you want to support the obsolete syntax, so let's ask the
server to do it for us!

This will convert the date to our local time and display it in a
sortable and fixed-width format "%Y-%m-%d %H:%M:%S".
2023-08-31 11:53:34 +02:00
Karol Kosek
0132c30eda Mail: Fetch mails with their sequence number
The FETCH response doesn't have return the sequence in order, or at very
least one of my mail providers doesn't do it.
2023-08-31 11:53:34 +02:00
MacDue
720c27efbd LibWeb: Ensure transform of SVG <use> updates with x and y attributes
Rather than modify the transform of the parent (which could change
independently), this adds a new override element_transform() where
element specific tranfroms can be applied. This will always stay in
sync with the attributes.

A ref test comparing a .svg and .html version of the same file is
added as due to differences in attribute parsing order, the .svg version
was previously drawn incorrectly.

Fixes #20859
2023-08-31 11:10:30 +02:00
Karol Kosek
90af21aef4 LibIMAP+Mail+test-imap: Let a Promise result type be non-optional
The Empty type was used only when parsing a response failed. The
failures will now go to Promise's error type.
2023-08-31 11:10:09 +02:00
Karol Kosek
1f605407bd LibIMAP: Reject a promise if a response couldn't be parsed
Promises can take an Error type now for quite some time, so let's use it
instead of returning an empty Optional type in the result field. :^)

Ideally we should give a more detailed info of what failed to parse, but
this will do for now.
2023-08-31 11:10:09 +02:00
Karol Kosek
55d730bd5c LibIMAP+Mail+test-imap: Make Client requests infailable 2023-08-31 11:10:09 +02:00
Karol Kosek
44ea5092e8 LibIMAP: Reject a promise when a command couldn't be sent
I feel like ErrorOr<RefPtr<Promise<>>> was an overkill. Promises already
hold an optional error type we can use instead.
2023-08-31 11:10:09 +02:00
Karol Kosek
51fefb57fc LibCore: Check if a promise is already resolved in Promise::map() 2023-08-31 11:10:09 +02:00
Shannon Booth
50d8ef94ba AK: Port percent_encode_after_encoding to String 2023-08-31 11:02:18 +02:00
Shannon Booth
cb4c279e90 AK: Percent encode URL fragments when parsed
This fixes URL fragments containing characters in the fragment encoding
set that were not being correctly percent encoded.
2023-08-31 11:02:18 +02:00
Shannon Booth
4eab37f391 LibWeb/Tests: Also include URL hash in test results
None of the existing tests contain a URL which has a fragment in them,
but this does verify that the URL parser does not actually find any!
Also, this should let us verify the correctness of URLs which actually
do contain fragments.
2023-08-31 11:02:18 +02:00
Shannon Booth
e233de1e48 AK: Report validation error for URLs with invalid percent encodings
This part of the spec is mostly useful for our debugging for now, but
could eventually be hooked up so that the user can see any reported
validation errors.
2023-08-31 11:02:18 +02:00
Shannon Booth
f53dfdd6ac AK: Write scheme state of URL parsing closer to spec steps
The main change here is that we now follow the spec by asserting the URL
is not special. Previously I could not find a way to enable this without
getting assertions when browsing the web - but that seems to no longer
be the case (probably from some other fixes which have since been made).
2023-08-31 11:02:18 +02:00
Shannon Booth
23e82114b4 AK: Do not consider port of 0 as a null port
This fixes an issue where if a port number of 0 was given for a non
special scheme the port number was being dropped.
2023-08-31 11:02:18 +02:00
Dan Klishch
66f4cdba85 JSSpecCompiler: Make it compile and dump AST created from stdin input 2023-08-31 11:00:31 +02:00
Dan Klishch
db0a03d1fb JSSpecCompiler: Add infrastructure to parse <emu-clause> into AST 2023-08-31 11:00:31 +02:00
Dan Klishch
f70e39d501 JSSpecCompiler: Add TextParser for converting algorithm steps into AST 2023-08-31 11:00:31 +02:00
Dan Klishch
9f29e04897 JSSpecCompiler: Add functions for splitting node contents into tokens 2023-08-31 11:00:31 +02:00
Dan Klishch
8342361481 JSSpecCompiler: Add Token type 2023-08-31 11:00:31 +02:00
Dan Klishch
5846470a5f JSSpecCompiler: Add stubs for AST types 2023-08-31 11:00:31 +02:00
Dan Klishch
da30afa0c3 Meta: Allow overriding root for local includes
Previously, we always assumed that local includes are relative to the
parent directory of a file. This effectively banned style-wise
multi-directory subprojects which are not libraries, since there was no
way to cleanly reference local file from a different directory.

This commit relaxes the restrictions by introducing
LOCAL_INCLUDE_ROOT_OVERRIDES. Entry in the set changes root of the
local includes to itself for all files in its subtree.
2023-08-31 11:00:31 +02:00
Andrew Kaster
da060eedb1 LibWeb: Create IdentifierStyleValue for fit-content size declarations
This doesn't quite resolve the FIXME, because we still don't support the
fit-content(percentage) syntax.
2023-08-31 10:57:44 +02:00
Ali Mohammad Pur
33a3f0e134 Shell: Implement close redirections in POSIX mode
Fixes #20631.
2023-08-31 11:02:57 +03:30
Andi Gallo
23fc1f988f LibWeb: Use reference instead of pointer for table cell paintable boxes 2023-08-31 07:21:20 +01:00
Zaggy1024
8852561967 LibWeb: Make use of fractions in solve_replaced_size_constraint() 2023-08-30 20:36:27 +02:00
MacDue
e8342a5b79 Tests/LibWeb: Add ref test for border-radius shrink of zero sized box 2023-08-30 20:36:27 +02:00
MacDue
2876e2f58e LibWeb: Fix border-radius corner overlap algorithm for zero-width boxes
Previously, the corner overlap algorithm implementation did not shrink
the border radii for zero width/height boxes, which resulted in
incorrect painting.

With this the implementation is updated to more closely follow the spec
steps, which naturally handles the zero width/height case. This makes
use of the `CSSPixelFraction` class for lossless comparison and
multiplication of the scaling factor for the radii.

Co-authored-by: Zaggy1024 <Zaggy1024@gmail.com>
2023-08-30 20:36:27 +02:00
Zaggy1024
8cd1f65507 LibWeb: Add a CSSPixelFraction class to allow comparison of fractions
This class will allow us to compare the ratio of two `CSSPixels` values
losslessly.

Not only that, but an operation like `a * (b / c)` should no longer
be lossy, since the operation can be carried out as `(a * b) / c`
implicitly instead.
2023-08-30 20:36:27 +02:00
Aliaksandr Kalenik
0fb571c1c2 LibWeb: Add Length::resolved() overload for CSSPixels
Since we always pass the px value as an argument to resolved(), we can
pass it directly as CSSPixels instead of wrapping it in Length. This
approach allows us to avoid converting to a double, resulting in fewer
precision issues.
2023-08-30 20:09:15 +02:00
Timothy Flynn
5eb0f65cc0 LibWebView: Do not block the console for the initial message request
If we set m_waiting_for_messages to true for the intial message request,
we might never receive a response, and block the console from requesting
any more messages indefinitely. Instead, issue a non-blocking initial
request, which is how the Qt and Serenity chromes behaved before the
ConsoleClient abstraction.

This also changes ConsoleClient::clear() to use run_javascript() rather
than js_console_input(), as that is also how the chromes used to behave.
2023-08-30 07:29:48 -04:00
Beckett Normington
f56b772b29 Ports/dosbox-staging: Update to version 0.80.1
This commit updates `dosbox-staging` to the latest stable version and
removes patches that are no longer needed for successful
compilation/usage.
2023-08-30 13:19:20 +02:00
Andi Gallo
ece122353b LibWeb: Simplify table_containing_cell signature and implementation
Reflect expectations of its only call site.
2023-08-30 13:05:47 +02:00
Bastiaan van der Plaat
258a6cb126 FileManager: Use new window remember state 2023-08-30 06:49:51 -04:00
Bastiaan van der Plaat
613557a535 LibGUI: Add window remember state that loads and saves from config 2023-08-30 06:49:51 -04:00
circl
e0e67a2b27 LibWeb: Partially implement MouseEvent.movementX/movementY
Currently doesn't handle the mouse leaving and entering the window per
the spec, and uses clientX/Y instead of screenX/Y. See FIXMEs.
2023-08-30 10:21:30 +02:00
Linus Groh
ebb7079795 Ports: Update Python to 3.11.5
Released on 2023-08-24.
https://www.python.org/downloads/release/python-3115/
2023-08-30 09:34:43 +02:00
Timothy Flynn
4d26e4650f Ladybird: Implement a JavaScript console for the AppKit chrome
This adds menu items to open an interactive JavaScript console for a web
page. This more or less mimics the Qt implementation of the console.
Hooks are included to tie the lifetime of the console window with the
tab it belongs to; if the tab is closed, the console window is closed.
2023-08-30 09:24:59 +02:00
Timothy Flynn
bf59e06d2a Ladybird+LibWebView: Extract common JS console functionality to a helper
This creates WebView::ConsoleClient to handle functionality that will be
common to the JS consoles of all Ladybird chromes. This will let each
chrome focus on just the UI.

Note that this includes the `console.group` functionality that only the
Serenity chrome previously had. This was a FIXME in the Qt chrome, and
it is implemented such that all chromes will receive this functionality
for free.
2023-08-30 09:24:59 +02:00