Commit graph

51475 commits

Author SHA1 Message Date
Luke Wilde f04d1d493d LibWeb: Bring form submission more up to spec
The main missing things are:
- Dialog submission
- Form validation
- Encoding URLs in the form element's encoding
- Navigables
2023-06-19 06:12:26 +02:00
Luke Wilde bd62fe9c33 LibWeb: Set method, headers and Content-Length in BC navigation
This is all ad-hoc, but will disappear when we switch to navigables.
2023-06-19 06:12:26 +02:00
Luke Wilde eaa4048870 LibTextCodec: Add "get output encoding" from the Encoding specification 2023-06-19 06:12:26 +02:00
Luke Wilde a53486a073 LibWeb: Add method to get last added task to an EventLoop 2023-06-19 06:12:26 +02:00
Luke Wilde 995df8f565 LibWeb: Move get_an_elements_{target,noopener} to HTMLElement
This will be used by form submission on `<form>` elements.
2023-06-19 06:12:26 +02:00
Luke Wilde c9c1ddd0bb LibWeb: Fix up constructing the form entry list
In particular:
- Don't include none submitter buttons.
- Use type_state() instead type() to avoid direct string comparisons
- Support the hidden _charset_ input
- Get form associated element's value directly instead of via the value
  attribute
- Split line break normalization into a separate function so that it
  can also be used by form submission.
2023-06-19 06:12:26 +02:00
Andi Gallo f154446a9f LibWeb: Skip separate height computation for tables
With multi-line text cells, we don't reliably know the height would stay
the same as the one set by the independent format context run. In such
situations, we can end up with a table box which is sized inconsistently
with the grid boxes of the table due to differences in line breaks.
2023-06-18 20:55:06 +02:00
Tim Ledbetter 0cea1a3baf chmod: Don't bail immediately on error
Previously, chmod would exit immediately if there was an error
changing file permissions. We now print an error to stderr and
continue when an error occurs.
2023-06-18 20:34:04 +02:00
Tim Schumacher ead756ca32 Ports: Point to the correct subdirectory for gettext
`ftpmirror.gnu.org` does not seem to have the `/pub/gnu` folder
structure, all files are in `/gnu` instead.

This regressed in 41f7f821f6.
2023-06-18 20:33:38 +02:00
Simon Danner 45f86466bb LibWeb: Add initial implementation of CRC2D.globalAlpha
Works for fills and strokes (using colors, gradients, or patterns),
along with images.

fill_rect() has been updated to use fill_path(), which allows it to
easily transform the rect, and already supports opacity.

Co-authored-by: MacDue <macdue@dueutil.tech>
2023-06-18 20:31:11 +02:00
MacDue ff5d530aa3 LibWeb: Pass CRC2D fill_rule as enum rather than StringView 2023-06-18 20:31:11 +02:00
MacDue 0bb0f2e4fb LibGfx: Apply opacity in Painter::draw_scaled_bitmap_with_transform() 2023-06-18 20:31:11 +02:00
Ali Mohammad Pur 12a900b97c LibCpp: Ignore the #error preprocessor directive 2023-06-18 20:30:21 +02:00
Ali Mohammad Pur 543ccecc0b LibCpp: Add support for type aliases with typedef/using 2023-06-18 20:30:21 +02:00
Ali Mohammad Pur 2e2e535abb Meta: Build LibCpp for Lagom 2023-06-18 20:30:21 +02:00
Aliaksandr Kalenik ca0c2339f4 LibWeb: Use padding box of containing block to resolve % height size
From CSS-POSITION-3 <https://www.w3.org/TR/css-position-3/#def-cb>

"..the containing block is formed by the padding edge of the ancestor.."

Fixes crash on Acid2 test.
2023-06-18 20:29:40 +02:00
Luke Wilde 14ae0524e9 LibWeb: Add HTMLButtonElement#disabled 2023-06-18 19:07:06 +02:00
Nico Weber e19892a099 WebP/Lossless: Set alpha to 0xff if is_alpha_used is false in header
simple-vp8l-alpha-used-false.webp is a copy of simple-vp8l.webp,
with the byte at offset 0x18 changed from 0x10 to 0x00 -- that
is, the bit in the VP8L header that stores `is_alpha_used` is cleared.

We would already allocated a BGRx8888 instead of a BGRA8888 bitmap,
but keep actual alpha data in the `x` channel.

That lead to at least `image` still writing a PNG with an alpha channel.
So explicitly set the alpha channel to 0xff when is_alpha_used is false,
to make sure all consumers of decoded lossless webp data have behavior
consistent with other webp readers.

In practice, webp encoders usually don't write files that have
`is_alpha_used` set to false and then write actual alpha data to their
output. So this is rarely observable. However, for example for
lossy+ALPH webp files, the lossless webp used to store the ALPH channel
has `is_alpha_used` set to false and all channels but green are 0
(since the lossless green channel stores the alpha channel of a
lossy+ALPH webp). So if we dump such a bitmap to a standalone webp
file (e.g. with the temporary debugging code in fc3249a1ca),
then without this commit here, `image` would convert that webp to
a fully transparent webp, while other webp software would correctly
display the green image with opaque alpha.
2023-06-18 18:47:47 +02:00
Valtteri Koskivuori 5e5493e334 AK: Add URLParser relative file URL test
I was debugging a different issue in Ladybird, and noticed that
completing relative file URLs with URL::complete_url didn't seem to work
right. This test case covers both the working https case, as well as the
file URL case fixed by the previous commit.
2023-06-18 15:16:08 +02:00
Valtteri Koskivuori 838d586b25 AK: Fix relative file URL parsing in URLParser
The FileSlash state was erroneously copying the base URL host, instead
of the base URL path excluding the last path component. This resulted in
invalid file URLs.
2023-06-18 15:16:08 +02:00
Andi Gallo db121c7af1 LibWeb: Handle leading whitespace in grid-template-* block components
We're already handling whitespace between components, do the same for
leading whitespace. Fixes crash on https://distill.pub/2021/gnn-intro.
2023-06-18 13:41:15 +02:00
Tim Ledbetter 586b47cede Kernel: Put loopback adapter debug spam behind a flag
This significantly increases loopback adapter speed in normal use.
2023-06-18 08:50:33 +01:00
Ben Wiederhake 0184fc5e43 Everywhere: Use AK_MAKE_DEFAULT_MOVABLE to avoid mistakes 2023-06-18 08:47:51 +01:00
Ben Wiederhake 2ebd79bc76 LibCore: Use AK_MAKE_DEFAULT_MOVABLE to avoid mistakes in default impls 2023-06-18 08:47:51 +01:00
Ben Wiederhake 2b2e0a4c5a Tests: Use AK_MAKE_DEFAULT_MOVABLE to avoid mistakes in default impls 2023-06-18 08:47:51 +01:00
Ben Wiederhake 8ae60dd234 Kernel: Use AK_MAKE_DEFAULT_MOVABLE to avoid mistakes in default impls 2023-06-18 08:47:51 +01:00
Ben Wiederhake 041f5e931d AK: Use AK_MAKE_DEFAULT_MOVABLE to avoid mistakes in default impls 2023-06-18 08:47:51 +01:00
Ben Wiederhake 3d3dfc8da8 AK: Introduce AK_MAKE_DEFAULT_MOVABLE macro for easier default impls 2023-06-18 08:47:51 +01:00
Shannon Booth ef391de635 LibWeb: Implement Web::FileAPI::Blob::text to spec 2023-06-18 08:34:02 +02:00
Shannon Booth 501b698385 LibWeb: Implement Web::FileAPI::Blob::array_buffer to spec 2023-06-18 08:34:02 +02:00
Shannon Booth b0bc8f2282 LibWeb: Add ReadableStreamDefaultReader::read_all_bytes_deprecated
This is not to the specification, but as the FIXME comment for the
function states, we need it to be able to properly interface with the
FileAPI spcification, which seems to have not been updated to the non
promise based API.
2023-06-18 08:34:02 +02:00
Shannon Booth 3df10d7fb6 LibWeb: Add Streams::ReadableStreamDefaultReader::read_all_bytes 2023-06-18 08:34:02 +02:00
Shannon Booth 46f9a49bd8 LibWeb: Add Streams::ReadableStreamDefaultReader read-loop reader
This algorithm is used by ReadableStreamDefaultReader to read all bytes
from a given stream. Currently the algorithm used is somewhat naive as
it is recursive, but given the initial use of this reader, it should not
be a problem.
2023-06-18 08:34:02 +02:00
Shannon Booth f320406a4c LibWeb: Make Bindings::dom_exception_to_throw_completion public API
I found myself needing to call this method when attempting to implement
Blob::text and Blob::array_buffer. Turns out that the only caller
outside of the Detail namespace  already had a FIXME to make this a
public API - so let's do that.
2023-06-18 08:34:02 +02:00
Andi Gallo c5eeb303d8 LibWeb: Don't cap used width by available width from a constraint
In compute_table_box_width_inside_table_wrapper, we should only consider
available_width when it's valid. Values which come from {min,
max}-content constraints aren't meaningful and shouldn't be considered
for the cap.
2023-06-18 08:27:24 +02:00
MacDue a910c4d984 LibWeb: Fix end position for objectBoundingBox SVG <radialGradient>s
The translation to the bounding box location is handled by the gradient
transform, also doing it here breaks things.

This fixes the MDN <radialGradient> example.
2023-06-17 22:25:26 +01:00
Kenneth Myhra 57626c4f9a LibWeb: Migrate WebSockets::WebSocket to String 2023-06-17 20:38:20 +02:00
Kenneth Myhra c03c0ec900 AK: Add URL::to_string() returning a String
For convenience wire up a to_string() method which returns a new String.
2023-06-17 20:38:20 +02:00
Sam Atkins b264d29515 Snake: Show status tips in Statusbar 2023-06-17 20:36:03 +02:00
Sam Atkins 46f365df5c MasterWord: Show status tips in Statusbar 2023-06-17 20:36:03 +02:00
Sam Atkins 2dc96155f7 GameOfLife: Show status tips in Statusbar 2023-06-17 20:36:03 +02:00
Sam Atkins f3b08ffc8a SpaceAnalyzer: Show status tips in Statusbar 2023-06-17 20:36:03 +02:00
Sam Atkins aa7346d23e HexEditor: Show status tips in Statusbar 2023-06-17 20:36:03 +02:00
Sam Atkins 200892868a ThemeEditor: Add a recent files list 2023-06-17 20:36:03 +02:00
Sam Atkins 16240942ba ThemeEditor: Add a Statusbar 2023-06-17 20:36:03 +02:00
Sam Atkins ae6bde6847 GMLPlayground: Add a Statusbar 2023-06-17 20:36:03 +02:00
Sam Atkins 506f9484e3 LibGUI: Give recent-file actions a nicer status tip
"Open /path/to/file" instead of just "/path/to/file".
2023-06-17 20:36:03 +02:00
Andreas Kling c374541711 LibWeb: Use correct reference for abspos elements with % height sizes
Absolutely positioned elements should have their percentage sizes
resolved against the padding box of the containing block, not the
content box.

From CSS-POSITION-3 <https://www.w3.org/TR/css-position-3/#def-cb>

"..the containing block is formed by the padding edge of the ancestor.."
2023-06-17 20:35:19 +02:00
Luke Wilde 357174d8fd LibJS/Bytecode: Actually get value from super base for computed property 2023-06-17 20:26:14 +02:00
Luke Wilde 1116ba191a LibJS/Bytecode: Implement optional chaining 2023-06-17 20:26:14 +02:00