Commit graph

54106 commits

Author SHA1 Message Date
Andrew Kaster 4641af7873 AK: Always use our assertion failure method, and add backtrace to it
On platforms that support it, enable using ``<execinfo.h>`` to get
backtrace(3) to dump a backtrace on assertion failure. This should make
debugging things like WebContent crashes in Lagom much easier.
2023-09-01 11:50:47 +02:00
circl 3056ff6b11 LibWeb: Add presentational hints to the canvas element
There is only one, width/height -> aspect-ratio. This brings us
very slightly closer to spec and triggers a re-layout after
updating these values from JavaScript, which wasn't the case
before.
2023-09-01 10:43:37 +01:00
circl 22220cf116 LibWeb: Bring parsing of width/height attributes in canvas up to spec 2023-09-01 10:43:37 +01:00
Andrew Kaster e6b8c2bd59 LibCore: Don't print class_name() from EventReceiver::stop_timer()
If stop_timer() is called from ~EventReceiver(), then the virtual
functions will end up calling the overload from the base class. As
EventReceiver::class_name() is pure virtual, this calls
__cxa_pure_virtual and crashes. We should not be calling virtual
functions from the destructor, and especially not pure virtual ones.

This "fixes" a crash in Piano, but the root cause of the problem is
still unfixed.
2023-09-01 11:19:18 +02:00
Zaggy1024 50bb785306 Tests/LibWeb: Add a test for clipping text with CSS clip 2023-09-01 09:40:14 +02:00
Zaggy1024 709767cc4b LibWeb: Don't convert to floating point in CSS::EdgeRect 2023-09-01 09:40:14 +02:00
Zaggy1024 9d4a1ac2b3 LibWeb: Apply CSS clip property to an element as well as its children
d06d4eb made the `clip` property apply to children of an absolute-
positioned element, but caused it not to be applied to the element the
property was applied to directly.

To fix this, apply the clip in new `before_paint()` and `after_paint()`
functions. Doing so keeps painter state from leaking from `paint()`,
but still allows subclasses of `PaintableBox` clip their contents
correctly without repeating the application of the clip rectangle.
2023-09-01 09:40:14 +02:00
Andreas Kling 2e45306d42 Ladybird: Update set of User-Agent spoofs to current versions 2023-09-01 09:16:55 +02:00
Sebastian Zaha 8dcb7c29ad Meta: Port recent build changes to gn build
This ports the following commits:

e26ead0995
5c5a00dd3a
2023-09-01 09:00:03 +02:00
Jonatan Klemets 0adda642a6 LibWeb: Fix int parsing in Element::tab_index
We now have functions for parsing integers in a spec-compliant way. This
patch replaces the `to_int` call with a call to the spec-compliant
`Web::HTML::parse_integer` function.
2023-08-31 22:27:48 +01:00
Jonatan Klemets acd46b5974 LibWeb: Fix int parsing in Document::shared_declarative_refresh_steps
We now have functions for parsing integers in a spec-compliant way. This
patch replaces the `to_uint` call with a call to the spec-compliant
`Web::HTML::parse_non_negative_integer` function.
2023-08-31 22:27:48 +01:00
Andrew Kaster 088af86c90 LibWeb: Implement Navigable::target_name() 2023-08-31 22:23:39 +01:00
Aliaksandr Kalenik a482166087 LibWeb: Bring html element height calculation closer to the spec
Previously we always set the height of the HTML element equal to the
viewport height but now this will only happen in quirks mode as it is
intended. Otherwise the html element height will be computed as auto.
2023-08-31 21:43:58 +02:00
Shannon Booth 6e9aeccf90 LibWeb: Implement releaseLock interface for ReadableStreamBYOBReader 2023-08-31 19:28:56 +02:00
Shannon Booth b06d80e6fd LibWeb: Implement ReadableStreamBYOBReaderRelease Streams AO 2023-08-31 19:28:56 +02:00
Shannon Booth 8ce4f5597c LibWeb: Implement ReadableStreamBYOBReaderErrorReadIntoRequests AO 2023-08-31 19:28:56 +02:00
Shannon Booth e08072ac2b LibWeb: Explicitly clear read requests for default stream reader
Expecting the list to be cleared from the move() is quite strange and
not particularly clear. Explicitly clear the requests instead.
2023-08-31 19:28:56 +02:00
Shannon Booth c279d514e9 LibWeb: Implement ReadableStreamBYOBReader constructor 2023-08-31 19:28:56 +02:00
Timothy Flynn 2418a033d4 Ladbird: Remove LibSQL dependency from Ladybird's WebContent
It is not used in WebContent or any of its dependencies.
2023-08-31 19:19:45 +02:00
Timothy Flynn e26ead0995 Ladybird+LibWebView: Move creation of the SQL client to LibWebView
This lets us remove the direct dependency from Ladybird to LibSQL.
2023-08-31 19:19:45 +02:00
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