Commit graph

2894 commits

Author SHA1 Message Date
Timothy Flynn ec492a1a08 Everywhere: Run clang-format
The following command was used to clang-format these files:

    clang-format-18 -i $(find . \
        -not \( -path "./\.*" -prune \) \
        -not \( -path "./Base/*" -prune \) \
        -not \( -path "./Build/*" -prune \) \
        -not \( -path "./Toolchain/*" -prune \) \
        -not \( -path "./Ports/*" -prune \) \
        -type f -name "*.cpp" -o -name "*.mm" -o -name "*.h")

There are a couple of weird cases where clang-format now thinks that a
pointer access in an initializer list, e.g. `m_member(ptr->foo)`, is a
lambda return statement, and it puts spaces around the `->`.
2024-04-24 16:50:01 -04:00
Cnidarias 1a1e5aaf54 LibWeb: Add null check for get_client_rects() on non paintable elements 2024-04-24 18:04:28 +02:00
Bastiaan van der Plaat 7fa45c5fdf LibWeb: Add map element areas property 2024-04-24 15:23:45 +02:00
Bastiaan van der Plaat 3e507102ea LibWeb: Add datalist element options property 2024-04-24 15:23:45 +02:00
kleines Filmröllchen 0c1ad05f50 LibC: Add rounding specializations for RISC-V
Whenever the floating-point values are in integer range, we can use the
various FCVT functions with static rounding mode to perform fast
rounding. I took this opportunity to clean up the architecture
differentiation for these functions, which allows us to use the software
rounding implementation for all extreme and unimplemented cases,
including AArch64.

Also adds more round & trunc tests.
2024-04-23 19:18:09 -06:00
kleines Filmröllchen 997828c31a LibC: Add some fenv tests
Co-Authored-By: Dan Klishch <danilklishch@gmail.com>
2024-04-23 19:18:09 -06:00
Andrew Kaster 651e78fedb LibWeb: Convert callers of ImageCodecPlugin to the async API
The HTMLLinkElement caller is a bit hairy, so we shove an await() in
there temporarily. This is sure to cause fun times for anyone debugging
task/microtask execution order.
2024-04-23 12:32:04 -06:00
Aliaksandr Kalenik d4f08fb0a1 LibWeb: Fix division by zero in solve_replaced_size_constraint()
Happened when input_width > 0 but input_height == 0.

Fixes crashing on Discord that happens after clicking on direct
messages conversation.
2024-04-23 16:21:48 +02:00
Aliaksandr Kalenik a044e9cf4f LibWeb: Add background-clip: text support for InlinePaintable
Moves background mask calculation into `paint_background()` that is
shared between PaintableBox and InlinePaintable.
2024-04-23 12:50:07 +02:00
Tim Ledbetter 3aea14093f LibWeb: Don't crash if the document element is not visible
Previously, setting the `hidden` property on the `<html>` element would
cause a crash.
2024-04-23 11:17:54 +02:00
Aliaksandr Kalenik dd73cccf8f LibWeb: Fire "scroll" events on DOM elements
Before this change "scroll" events were only fired on document but now
it happens for all elements with scrollable overflow.
2024-04-23 11:00:35 +02:00
Shannon Booth 1ec6399c00 Everywhere: Remove uneeded short option argument where possible 2024-04-22 08:10:08 +02:00
Andreas Kling 8e56367092 LibWeb: Allow moving StyleSheets between documents without falling apart
We have to unregister link element stylesheets from the old document's
StyleSheetList when moving them into a new document.

This makes it possible to load GitHub contributor graphs. :^)
2024-04-22 06:43:05 +02:00
Dan Klishch bdfc77b725 LibELF: Treat STB_WEAK like STB_GLOBAL during global symbol lookup
This is what POSIX mandates and this also matches the behavior of modern
Linux.
2024-04-21 13:34:04 -06:00
Dan Klishch d8119c4b4a LibLocale: Statically link LibLocaleData into LibLocale 2024-04-21 13:34:04 -06:00
Andreas Kling 193fc7ef98 LibWeb: Allow cloneNode() to clone elements with weird attributes
We can't rely on Element.setAttribute() in cloneNode() since that will
throw on weird attribute names. Instead, just follow the spec and copy
attributes into cloned elements verbatim.

This fixes a crash when loading the "issues" tab on GitHub repos.
They are actually sending us unintentionally broken markup, but we
should still support cloning it. :^)
2024-04-21 19:51:24 +02:00
Aliaksandr Kalenik 23d683cf6b LibWeb: Update document url after same-document back/forward navigation
Seems like a specification bug, but other browsers update url before
popstate event is fired and so should we.

Fixes back/forward navigation on GitHub.
2024-04-21 12:41:36 +02:00
dgaston 08aaf4fb07 AK: Add methods to BufferedStream to resize the user supplied buffer
These changes allow lines of arbitrary length to be read with
BufferedStream. When the user supplied buffer is smaller than
the line, it will be resized to fit the line. When the internal
buffer in BufferedStream is smaller than the line, it will be
read into the user supplied buffer chunk by chunk with the
buffer growing accordingly.

Other behaviors match the behavior of the existing read_line method.
2024-04-21 11:46:55 +02:00
Aliaksandr Kalenik 9540af6489 LibWeb: Fix nodesToRemove collecting traversal in Range::delete_contents
With this change children are no longer skipped in tree traversal when
start node of range equals to end node of range.

Fixes https://github.com/SerenityOS/serenity/issues/24036
2024-04-20 13:32:24 +02:00
Aliaksandr Kalenik d3cfe35fbd LibWeb: Do not destroy document until whole subtree completed unloading
Fixes crashing when "unload" event handler tries to access active
document that has already been destroyed.
2024-04-20 10:22:14 +02:00
Sönke Holz 9881d10e38 LibELF: Add a small local-exec TLS test
Part 1 of this test uses a large array so we are more likely getting
segfaults when using an incorrect TLS layout.

The `volatile`s and `taint_for_optimiter`s should hopefully prevent the
compiler from optimizing the tests out.
2024-04-19 16:46:47 -06:00
Nico Weber 3568215790 Tests/JPEG2000: Add spec example as test case
This tests reading JPEG2000 codestreams that aren't embedded in
the ISOBMFF wrapper. It's also useful for debugging bitstream
internals, since the spec lists expected output for many internal
intermediate results.
2024-04-19 12:42:34 -04:00
Alex 13abb1b2c7 LibWeb: Add name validation and document check to setAttribute
Co-authored-by: Rayyan Hamid <rayyanbwp@gmail.com>
Co-authored-by: Christian Ewing <u1273549@utah.edu>
Co-authored-by: Austin Fashimpaur <austin.fashimpaur@gmail.com>
2024-04-19 06:32:41 -04:00
Andreas Kling 5ef6df79ed LibWeb: Generate a simple error page when XML decode/parse fails
This fixes a regression on Acid3, since we are not expected to "best
effort" parse XML. The test specifically checks that you don't create an
incomplete, incorrect DOM.
2024-04-19 11:44:32 +02:00
Nico Weber ea441fea95 LibGfx: Move QMArithmeticDecoder to its own file
It will be used by the JPEG2000 decoder as well.

Pure code move, no behavior change.
2024-04-19 10:59:11 +02:00
Nico Weber 5ff75ce5fb LibGfx/JBIG2: Rename JBIG2::ArithmeticDecoder to QMArithmeticDecoder
In preparation of moving it to its own file.

No behavior change.
2024-04-19 10:59:11 +02:00
PGHales 75626c6cd2 LibWeb/DOM: Implement the Document object's partial attributes 2024-04-19 10:58:45 +02:00
Aliaksandr Kalenik 7b75d0c1f0 LibWeb: Fix height distribution in "vertical-align: baseline" in TFC
This line changes padding top to align cell content to baseline:
`cell.padding_top += m_rows[cell.row_index].baseline - cell.baseline`

Which means available for distribution height `height_diff` could have
changed so it needs to be refreshed before assigning the rest of it to
padding bottom:
`cell_state.padding_bottom += height_diff;`

Fixes https://github.com/SerenityOS/serenity/issues/22032
2024-04-19 10:55:28 +02:00
Andreas Kling eb2c05e906 Tests/LibWeb: Fix rebaseline-libweb-test after RequestServer changes 2024-04-19 10:53:20 +02:00
Andreas Kling 4a795bef48 Tests/LibWeb: Fix iframe-load-event-for-bad-xml.html test
This was supposed to be an async test (and work correctly, too!)

This fixes up fa43321938
2024-04-18 21:17:01 +02:00
implicitfield 7a74805067 Tests: Avoid casting function types in LibC/TestSearch.cpp
Doing so causes a function type mismatch, which makes the test crash
when built with a new enough version of UBSan.
2024-04-18 13:14:33 -06:00
Andreas Kling fa43321938 LibWeb: Fire iframe load event for frames with badly encoded XML
When loading an XML resource into an iframe and the resource fails to
decode (e.g due to invalid UTF-8), we must still fire a load event.

This fixes the regression in subtest 69 of Acid3.
2024-04-18 15:40:16 +00:00
Aliaksandr Kalenik bad86ca6b4 LibWeb: Ignore mousewheel events in ViewportPaintable
That allow EventHandler process wheel event on corresponding navigable.
For top-level navigable that means IPC call to let chrome know about
scrollbar position update.

Fixes https://github.com/SerenityOS/serenity/issues/23599
Fixes https://github.com/SerenityOS/serenity/issues/23493
Fixes https://github.com/SerenityOS/serenity/issues/23966
2024-04-18 12:27:24 +02:00
Aliaksandr Kalenik eb4f36e5a1 Tests/LibWeb: Add a test for iframe load event when src has xml type
Reduction from Acid3 that was fixed by changing
guess_mime_type_based_on_filename() to support xml extension.
2024-04-18 08:10:05 +00:00
Aliaksandr Kalenik d876f32e5d LibWeb: Skip creating a navigable for <object> not connected to document
Navigation should not run for <object> element until it is inserted into
a document. Spec deoes not seem to explicitely say that, but that
matches other browsers behavior.

Fixes hanging after reloading in Acid3 test.
2024-04-18 08:09:51 +00:00
Andreas Kling 41667f969d LibWeb: Fix two problems where media queries didn't invalidate properly
There were two things going wrong here:

- Transformed text (via CSS text-transform) was not invalidated after a
  `@media` rule changed state.

- Removing the `style` attribute from an element didn't trigger a style
  update.

This fixes the regression in subtest 46 of Acid3.

Fixes #21777
2024-04-17 14:18:31 +02:00
Ali Mohammad Pur 06386ab2b5 LibTLS+LibHTTP: Tolerate improperly closed TLS sockets
Some really cursed servers simply drop the TCP socket on the floor when
they're trying to close an HTTP connection going through a TLS socket.
This commit makes LibTLS tolerate these silly servers, and LibHTTP
accept their idea of "EOF == connection closed".

Fixes loading wpt.live/acid/acid3/test.html.

Note that this means TLSv12::on_ready_to_read can fire with an empty
buffer signifying EOF; one test refused this behaviour, and has been
changed in this commit.
2024-04-17 07:19:03 +02:00
Andreas Kling 1cb5385a29 LibCore: Stop obsessing about tiny OOMs in Core::Timer
Work towards #20405
2024-04-17 07:16:52 +02:00
Timothy Flynn bf1c82724f LibWeb: Default to an empty string when a string attr substitution fails
When a string-type attr() substitution produces no value and no fallback
had been specified, the spec mandates we default to the empty string.
2024-04-17 07:13:26 +02:00
Timothy Flynn 4ced84a548 LibWeb: Copy the css-attr-typed-fallback ref test as a layout test
As a layout test, this verifies that the fallback attr() substitution
results in the expected layout node. For example, the fallback content
for a `string` attribute type should create a text node.
2024-04-17 07:13:26 +02:00
Tim Ledbetter 4a3497e9cd LibWeb: Support loading alternative style sheets
Alternative style sheets are now fetched and are applied to the
document if they are explicitly enabled by removing the disabled
attribute.
2024-04-17 07:12:44 +02:00
Aliaksandr Kalenik 890da021c4 LibWeb: Abort ongoing navigation before firing next navigation event
I haven't found this being mentioned in the current spec, but that is
what chromium (atm the only other Navigation API implementer) does.

Fixes crashing when location.hash is changed subsequently more than once
using JS.
2024-04-16 19:51:56 +02:00
Andreas Kling 0389f01cc8 LibWeb: Make document.createEvent("hashchangeevent") produce right type
This is supposed to return a HashChangeEvent, and now it does.
2024-04-16 19:50:45 +02:00
Aliaksandr Kalenik 768b1455d6 LibWeb: Run <object> fallback steps if data type is not supported
Progress on fixing regressed Acid2.
2024-04-16 13:47:38 +02:00
Tim Ledbetter d5cddd4696 LibWeb: Unset stylesheet properties when removing from a StyleSheetList
Previously, the parent CSS stylesheet, owner node and owner CSS rule
properties were not unset when removing a sheet from a StyleSheetList.

This change moves the methods for adding and removing sheets to and
from a StyleSheetList, directly into the StyleSheetList class and
ensures they are called as required by the CSSOM specification.
2024-04-16 07:41:33 +02:00
Tim Ledbetter beaf97bf96 Tests/LibWeb: Add a test for disabled link elements 2024-04-16 07:41:33 +02:00
Space Meyer 83020a48a8 Kernel: Add basic KCOV test and benchmark 2024-04-15 21:16:22 -06:00
Nico Weber 7296b0fa43 LibGfx/JPEG2000: Implement tag trees
A tag tree is a data structure used for deserializing JPEG2000
packet headers.

We don't use them for anything yet, except from tests.

The implementation feels a bit awkward to me, but we can always polish
it later.

The spec thankfully includes two concrete examples. The code is
correct enough to pass those -- I added them as test.
2024-04-16 00:40:16 +02:00
Tim Ledbetter 99b2eff988 LibWeb: Invalidate style when CSSStyleRule selectorText changes
Previously, any change to the selectorText of a CSSStyleRule was not
reflected in the document style.
2024-04-15 22:12:49 +02:00
Andreas Kling c08ba8ac4c LibWeb: Fix new ImageData(width, height) when width != height 2024-04-15 11:27:34 +02:00
Andreas Kling 134c4b6335 LibWeb: Fix CRC2D.getImageData() when width != height
We were mistakenly using the width as both width and height when getting
ImageData from a 2D canvas.
2024-04-15 11:27:34 +02:00
Jamie Mansfield e487f70bbf LibWeb: Support "importmap" scripts 2024-04-15 10:11:54 +02:00
Aliaksandr Kalenik ccb363c443 LibWeb: Add hashchange event support 2024-04-15 01:02:51 -07:00
Andreas Kling 20bdda7f02 LibWeb: Implement Element.removeAttributeNode() 2024-04-14 22:08:22 +02:00
Andreas Kling cf315338ec LibWeb: Don't draw image alt text frames with "rough" rect
This was an accident in 3645b676fb
2024-04-14 18:05:48 +02:00
Andreas Kling 217cb01708 LibGfx: Clip out-of-bounds pixel accesses in Painter::draw_rect() 2024-04-14 18:05:48 +02:00
Tim Ledbetter c6f070d29e LibWeb/Fetch: Don't crash when a fetch request times out
Previously, calling fetch with a signal object provided by
`AbortSignal.timeout()` would cause a crash when the signal timed out.

We now push a `TemporaryExecutionContext` to the stack when we invoke
the signal's abort steps, as an execution context is required when
calling native functions.
2024-04-14 13:36:25 +02:00
Tim Ledbetter 88f3145f8a LibWeb: Add methods to Window that must do nothing
This change adds the `captureEvents()` and `releaseEvents()` methods to
the window object. These methods are obsolete, but are still included
in the HTML specification, which says they must do nothing.
2024-04-14 10:45:43 +02:00
Tim Ledbetter 0564e06f10 LibWeb: Add methods to Document that must do nothing
This change adds the `clear()`, `captureEvents()` and `releaseEvents()`
methods to the document object. These methods are obsolete, but are
still included in the HTML specification, which says they must do
nothing.
2024-04-14 10:45:43 +02:00
Arthur Grillo 3645b676fb LibWeb: Remove RecordingPainter::paint_frame()
PaintFrame is not primitive painting command, we inherited from OS, that
is hard to replicate in GPU-painter or alternative CPU-painter API. We
should remove it as a part of refactoring towards simplifying recording
painter commands set.

Fixes: #23796
2024-04-13 20:25:48 -07:00
Aliaksandr Kalenik 91377f3ab9 LibWeb: Fix always hanging Navigable::reload()
See spec issue https://github.com/whatwg/html/issues/9869

Previous attempt on fixing reload had to be reverted because it broke
Soundcloud and GitHub, but this change does not seem to introduce new
crashes.
2024-04-13 09:19:00 -07:00
Andreas Kling f7e57881ad LibWeb: Don't limit available space during early height for inline-flex
There was no need to set an available height constraint when doing early
height calculation for inline-flex boxes. It created a situation where
the flex containers could wrongly get zero height early, and then
resolve percentages against zero instead of the real intrinsic size.

Fixes #23942
2024-04-13 14:10:10 +02:00
Aliaksandr Kalenik 69d6abc60f LibWeb: Add test when networking task is interrupted by networking task
It does fetching and uses parseFromString() DOMParser API in the fetch
callback. Following steps end up hanging before reverting
664611bae4:
1. Do fetching initiated by fetch() js call.
2. Invoke fetch callback on networking task source
3. Fetch callback does parseFromString()
4. parseFromString() invokes HTMLParser
5. HTMLLinkElement inserted into new document initiates fetching
6. Fetching callback cannot run because networking source was blocked on
   step 2.
7. HTMLParser::the_end() spins waiting for HTMLLinkElement to unblock
   load event, which will never happen because fetching callback cannot
   proceed.
2024-04-13 12:07:33 +02:00
Andreas Kling 40a914ce1a LibWeb: Use static position for abspos box axes with auto insets
When both insets in a given axis are auto, we should use the static
position for absolutely positioned elements.

By doing this correctly, we exposed a bunch of other small bugs which
had to be fixed to compensate for new test failures. Those fixes are
included here as well:
- Don't apply margins twice.
- Compute the static position containing block chain correctly.

This makes https://brave.com/ look much better. :^)
2024-04-12 09:08:07 +02:00
Aliaksandr Kalenik ee3dd7977d LibWeb: Add popstate event support
It is going to be useful in writing tests for History API.
2024-04-11 21:25:06 +02:00
Timothy Flynn 0ffc338406 LibWeb: Support dimension attributes on HTMLVideoElement 2024-04-11 18:41:57 +02:00
Aliaksandr Kalenik a73bf1607f LibWeb: Mark initial about:blank as ready to run scripts after creation
This matches how other browsers behave.

Fixes https://github.com/SerenityOS/serenity/issues/23892
2024-04-11 18:41:20 +02:00
Aliaksandr Kalenik d86ad2fcfa LibWeb: Process all task source while waiting for document population
"apply the history step" initiated by reloading or back/forward
navigation might require doing fetching while populating a document,
so it is not possible to restrict spin_until() to process only
NavigationAndTraversal task source.

"apply the history step" initiated by synchronous navigation keeps
processing only NavigationAndTraversal task source because it will
never have to populate a document. Another reason to keep synchronous
navigation blocking other task sources is that we crash if active SHE
changes in the middle of "apply the history step" initiated by sync
navigation. The new test is added to makes sure we don't regress that.
2024-04-11 09:40:45 +02:00
Andrew Kaster 4bdd4beb93 Tests/LibWeb: Add a script to create a new test, starting with Text 2024-04-10 17:17:40 -06:00
Andreas Kling 870a954e11 LibWeb: Implement Element.outerHTML
This piggybacks on the same fragment serialization code that innerHTML
uses, but instead of constructing an imaginary parent element like the
spec asks us to, we just add a separate serialization mode that includes
the context element in the serialized markup.

This makes the image carousel on https://utah.edu/ show up :^)
2024-04-09 18:17:14 -04:00
Bastiaan van der Plaat 6f84f69677 LibWeb: Add select selected options collection getter 2024-04-09 09:23:57 +02:00
Bastiaan van der Plaat 7372c01786 LibWeb: Add select and options collection remove method 2024-04-09 09:23:57 +02:00
Bastiaan van der Plaat 5decf4b33c LibWeb: Add HTMLOptionsCollection selected index property 2024-04-09 09:23:57 +02:00
Bastiaan van der Plaat 5c277144d8 LibWeb: Add select and option collection set length 2024-04-09 09:23:57 +02:00
Bastiaan van der Plaat 4e5ce7b63e LibWeb: Add select element size property 2024-04-09 09:23:57 +02:00
Bastiaan van der Plaat 4408581ee0 LibWeb: Refactor SelectItem to allow selecting options without value
Currently the `<select>` dropdown IPC uses the option value attr to
find which option is selected. This won't work when options don't
have values or when multiple options have the same value. Also the
`SelectItem` contained so weird recursive structures that are
impossible to create with HTML. So I refactored `SelectItem` as a
variant, and gave the options a unique id. The id is send back to
`HTMLSelectElement` so it can find out exactly which option element
is selected.
2024-04-08 17:24:48 -04:00
Aliaksandr Kalenik 94d72c174a LibWeb: Allow executing scripts for iframes with src=about:blank
Fixes https://github.com/SerenityOS/serenity/issues/23836
2024-04-08 21:27:34 +02:00
stelar7 0e53b87261 LibCrypto: Add OAEP 2024-04-08 09:34:49 -06:00
stelar7 73a534494c LibCrypto: Add MGF1 2024-04-08 09:34:49 -06:00
Lucas CHOLLET 7f7119c78d LibWeb: Add a test for WindowOrWorkerGlobalScope.createImageBitmap 2024-04-08 14:25:36 +02:00
Shannon Booth db0519ddc1 LibWeb: Fire a pointer event on synthetic clicks 2024-04-08 14:25:08 +02:00
Shannon Booth 1e2ddf9848 LibWeb: Add a test for construction of a PointerEvent 2024-04-08 14:25:08 +02:00
MacDue d7b77d7695 LibWeb: Split SVGFormattingContext up into functions
Doing multiple `for_each_in_subtree()` passes was kind of a hack. We
can resolve everything in a single pass with a little more control over
the layout process. This also fixes a few minor issues like the sizing
of nested `<g>` elements.

More work is needed here though as this is still fairly ad-hoc.

Note: This does regress `css-namespace-tag-name-selector.html`,
previously SVG text within `<a>` elements would appear. However, this
was only because `for_each_in_subtree()` would blindly look through the
InlineNodes from the unimplemented `SVGAElement`s.
2024-04-08 14:24:35 +02:00
Aliaksandr Kalenik a3149c1ce9 LibWeb: Wait for initial navigation to complete before modifying iframe
If initial src of an iframe is "about:blank", it does synchronous
navigation that is not supposed to be interleaved by other navigation
or usage of Document.open().

Fixes crashing in navigation on https://twinings.co.uk/
2024-04-08 09:07:18 +02:00
Kenneth Myhra 29521b50e6 Tests/LibWeb: Verify we throw when trying to pipe through locked streams 2024-04-07 14:26:34 +01:00
Kenneth Myhra 9802cf07bd Tests/LibWeb: Add test to prove we can pipe through a transform stream 2024-04-07 14:26:34 +01:00
Kenneth Myhra a0802b6e29 Tests/LibWeb: Verify we throw when trying to pipe from/to locked streams 2024-04-07 07:01:52 +02:00
Kenneth Myhra 8ff52582ce Tests/LibWeb: Add test to prove we can pipe to a WriteableStream
This proves our ability to pipe the current ReadableStream to a given
WriteableStream.
2024-04-07 07:01:52 +02:00
Shannon Booth 18520561e7 LibWeb: Fix crash for calculated transition duration/delays
As the parser was trying to directly unwrap an unresolved duration.
Currently we are outputting the wrong results for the serialized
duration, but this is still a step forwards.

Fixes a crash seen on: https://evaparish.com/blog/how-i-edit
2024-04-06 19:35:27 +01:00
Nico Weber 2d4964b945 LibGfx/JBIG2: Support custom adaptive template pixels in refinement
The implementation is very similar to #23831.

I created the test exactly like in #23713, except that I replaced the
last four lines in the ini file with:

```
-txt -Param -rATX1 10
-txt -Param -rATY1 -1
-txt -Param -rATX2 4
-txt -Param -rATY2 15
```
2024-04-05 21:32:18 +02:00
Nico Weber 200e36aad3 Tests/JBIG2: Remove test_jbig2_size
It's redundant with test_jbig2_decode nowadays.
2024-04-05 21:32:18 +02:00
Aliaksandr Kalenik 188775c4e3 LibWeb: Add a test for history.pushState() that uses setTimeout() 2024-04-05 21:28:41 +02:00
Timothy Flynn 5d5b69578f LibWeb: Handle <input> element type changing to the image button state
The spec has special steps specific to the image button state to load
the element's image URL.
2024-04-04 21:06:45 +02:00
Timothy Flynn 0e774fe780 LibWeb: Recreate the <input> shadow tree when the type attribute changes
This is often used on login forms, for example, to toggle the visibility
of a password. The site will change the <input> element's type to "text"
to allow the password to show.
2024-04-04 21:06:45 +02:00
Timothy Flynn 06a3ca734e LibWeb: Handle changes to an input element's "multiple" attribute
Update the shadow tree so that the attribute is reflected on the page.
2024-04-04 21:06:45 +02:00
Timothy Flynn 6af7f7e0f5 LibWeb: Update placeholder visibility when the placeholder value changes
Otherwise, setting a placeholder on an element that previously did not
have a placeholder would have no visible effect.
2024-04-04 21:06:45 +02:00
stelar7 19bb62d60e LibWeb: Implement PBKDF2 deriveBits for SubtleCrypto 2024-04-04 21:00:40 +02:00
Nico Weber b17a9ad82a Tests/JBIG2: Add test cases for custom adaptive template pixels
I manually wrote a bunch of .ini files and ran this script to
produce the files:

    #!/bin/bash
    set -eu

    J=$HOME/Downloads/T-REC-T.88-201808-I\!\!SOFT-ZST-E/Software
    J=$J/JBIG2_SampleSoftware-A20180829/source/jbig2

    for t in '' template1- template2- template3-; do
      for p in '' '-tpgdon'; do
        i=${t}customat$p
        echo $i.ini
        cat $i.ini
        $J -i Tests/LibGfx/test-inputs/bmp/bitmap -f bmp -o bitmap-$i \
            -F jb2 -ini $i.ini
        cp bitmap-$i.jb2 Tests/LibGfx/test-inputs/jbig2/bitmap-$i.jbig2
      done
    done

The script's output (which shows the .ini file contents) was:

```
% ./make-custom-at.sh
customat.ini
-Gen -Seg 1
-Gen -Param -ATX1 -4
-Gen -Param -ATY1 -5
-Gen -Param -ATX2 6
-Gen -Param -ATY2 -7
-Gen -Param -ATX3 -8
-Gen -Param -ATY3 -9
-Gen -Param -ATX4 10
-Gen -Param -ATY4 -11
ENC Start ===>complete
customat-tpgdon.ini
-Gen -Seg 1
-Gen -Param -ATX1 -4
-Gen -Param -ATY1 -5
-Gen -Param -ATX2 6
-Gen -Param -ATY2 -7
-Gen -Param -ATX3 -8
-Gen -Param -ATY3 -9
-Gen -Param -ATX4 10
-Gen -Param -ATY4 -11
-Gen -Param -TpGDon 1
ENC Start ===>complete
template1-customat.ini
-Gen -Seg 1
-Gen -Param -Template 1
-Gen -Param -ATX1 17
-Gen -Param -ATY1 -2
ENC Start ===>complete
template1-customat-tpgdon.ini
-Gen -Seg 1
-Gen -Param -Template 1
-Gen -Param -ATX1 17
-Gen -Param -ATY1 -2
-Gen -Param -TpGDon 1
ENC Start ===>complete
template2-customat.ini
-Gen -Seg 1
-Gen -Param -Template 2
-Gen -Param -ATX1 17
-Gen -Param -ATY1 -2
ENC Start ===>complete
template2-customat-tpgdon.ini
-Gen -Seg 1
-Gen -Param -Template 2
-Gen -Param -ATX1 17
-Gen -Param -ATY1 -2
-Gen -Param -TpGDon 1
ENC Start ===>complete
template3-customat.ini
-Gen -Seg 1
-Gen -Param -Template 3
-Gen -Param -ATX1 17
-Gen -Param -ATY1 -2
ENC Start ===>complete
template3-customat-tpgdon.ini
-Gen -Seg 1
-Gen -Param -Template 3
-Gen -Param -ATX1 17
-Gen -Param -ATY1 -2
-Gen -Param -TpGDon 1
ENC Start ===>complete
```
2024-04-04 11:44:50 -04:00
Timothy Flynn 23b25333a5 LibCrypto: Avoid needless ByteString usage in unit tests 2024-04-04 11:23:21 +02:00
Timothy Flynn c23060e21b Userland: Avoid some now-unneeded explicit conversions to Bytes 2024-04-04 11:23:21 +02:00