Commit graph

24495 commits

Author SHA1 Message Date
Timothy Flynn
8352417278 BrowserSettings: Slightly change text for adding a new content filter
Add an ellipsis to the button to add a new domain to indicate an action
must be taken after pressing the button. Shorten the label next to the
domain text box to be less overly verbose.
2023-04-22 12:32:40 +02:00
Timothy Flynn
d1ad513cb1 BrowserSettings: Port content filters to String 2023-04-22 12:32:40 +02:00
Timothy Flynn
5089766af6 Browser+Ladybird+LibWeb: Port content filters to String 2023-04-22 12:32:40 +02:00
Timothy Flynn
76ae60da15 Browser+Ladybird+LibWeb: Prevent infinite growth of content filters
We never clear content filters on either end of the Browser-WebContent
IPC connection. So when the filters change, we re-append all filters to
the Vector holding them. This incidentally makes it impossible to remove
a filter.

Change both sides to clear their filter lists when receiving a new set
of filters.
2023-04-22 12:32:40 +02:00
Sam Atkins
b0ffb15e13 copy: Stop using DeprecatedString 2023-04-22 07:17:08 +02:00
Sam Atkins
f7375d664c config: Stop using DeprecatedString 2023-04-22 07:17:08 +02:00
Sam Atkins
739e657ad0 cksum: Stop using DeprecatedString
This has the side-effect of making the algorithm name case-sensitive,
but there doesn't seem to be an especially good reason to support that.
On the other hand, converting an AK::String to lowercase would require
linking LibUnicode.
2023-04-22 07:17:08 +02:00
Sam Atkins
2db4a2450b chown: Stop using DeprecatedString 2023-04-22 07:17:08 +02:00
Sam Atkins
916e7a5a3f asctl: Stop using DeprecatedString 2023-04-22 07:17:08 +02:00
Sam Atkins
8377db260f arp: Stop using DeprecatedString 2023-04-22 07:17:08 +02:00
Sam Atkins
b3cd91d26d Utilities: Use lround() instead of casting round() to long
And one case where we previously cast to int, since the extra precision
does not matter.
2023-04-22 07:17:08 +02:00
Sam Atkins
f2ae25deee cmp: Replace uses of DeprecatedString 2023-04-22 07:17:08 +02:00
Sam Atkins
684af3d4d0 cmp: Use Core::File::open_file_or_standard_stream() 2023-04-22 07:17:08 +02:00
Sam Atkins
0f95ff64ed Utilities: Replace ctype.h usage with AK/CharacterTypes.h 2023-04-22 07:17:08 +02:00
Nico Weber
cf3835b29b LibGfx/JPEG: Make non-zero-terminated APPn starts non-fatal
Necessary but not sufficient for #18456.
2023-04-21 22:09:31 -04:00
Sam Atkins
22e0603bf7 LibWeb: Implement integrity-metadata part of fetch algorithm
Specifically, this makes `<link>` elements with an `integrity` attribute
actually work. Previously, we would load their resource, and then drop
it on the floor without actually using it.

The Subresource Integrity code is in `LibWeb/SRI`, since SRI is the name
of the recommendation spec: https://www.w3.org/TR/SRI/

However, the Fetch spec links to the editor's draft, which varies
significantly from the recommendation, and so that is what the code is
based on and what the spec comments link to:
https://w3c.github.io/webappsec-subresource-integrity/

Fixes #18408
2023-04-21 20:44:47 +01:00
Sam Atkins
6d93e03211 LibWeb+Browser+Ladybird: Use JS::SafeFunction for EventLoop callbacks
This automatically protects captured objects from being GC'd before the
callback runs.
2023-04-21 20:44:47 +01:00
Sam Atkins
955528055c LibWeb: Add FIXME: for new step 6 of Fetch's "main fetch"
This step was added in this commit:
2d78995db8
2023-04-21 20:44:47 +01:00
Nico Weber
66bd7cdb28 LibGfx: Move two globals into the only functions that use them
No real behavior change. (The two globals are now both initialized
at first use instead of before main(), but that should have no
observable effect. The motivation is readability.)
2023-04-21 15:55:03 +02:00
Tim Schumacher
12ce6ef3d7 Kernel+Userland: Remove the nfds entry from /sys/kernel/processes
`process.fds()` is protected by a Mutex, which causes issues when we try
to acquire it while holding a Spinlock. Since nothing seems to use this
value, let's just remove it entirely for now.
2023-04-21 13:55:23 +02:00
Jamie Mansfield
926c16f0ce Spider: Fix crash when completing a deck
This resolves a regression caused by
8a48246ed1.
2023-04-21 10:59:32 +01:00
Luke Wilde
8addcd237c LibWeb: Make WebSocket#send support typed arrays, Blob and DataView
Required by jigsawpuzzles.io, which particularly uses typed arrays.
2023-04-21 07:59:50 +02:00
Luke Wilde
1f863de9aa LibWeb: Add XMLDocument stub
Required by old versions of Pixi.js's XMLFormat bitmap font loader.
db824181dc/packages/text-bitmap/src/formats/XMLFormat.ts (L16)
2023-04-21 07:59:50 +02:00
Timothy Flynn
a01ad58e91 Browser: Add support for CookieJar to run in a transient, in-memory mode
This is to allow running Ladybird without the SQL database for testing.
Primarily, this will let us set 'follow-fork-mode' to 'child' within GDB
to enter the WebContent process, rather than the SQLServer process. But
this is also handy for digging into cookie storage issues.
2023-04-21 07:56:14 +02:00
Timothy Flynn
83bb24991b LibWeb: Implement HTMLVideoElement representation closer to the spec
The representation is used to indicate whether the layout node should
paint a video frame, the video's poster, or a "transparent black" box.
2023-04-21 07:54:36 +02:00
Timothy Flynn
e0ccba9c85 LibWeb: Implement the HTMLVideoElement poster attribute
This will fetch the URL indicated by the poster attribute when it's set,
changed, or removed. The spec doesn't say how to handle animated poster
images, so we just grab the first frame of the image, which seems to
match other implementations.
2023-04-21 07:54:36 +02:00
Timothy Flynn
b384f2009d LibWeb: Implement the HTMLMediaElement show-poster flag
Note that this doesn't do much yet, as the HTMLVideoElement does not
handle its poster attribute as of this commit.
2023-04-21 07:54:36 +02:00
Timothy Flynn
12c15641c1 LibWeb: Implement the HTMLMediaElement "potentially playing" concept 2023-04-21 07:54:36 +02:00
Timothy Flynn
9f71799456 LibWeb: Make HTMLMediaElement's attribute change handlers protected
These will be need to be overridden by HTMLVideoElement. We also need to
be sure to invoke HTMLMediaElement's base class's did_remove_attribute.
2023-04-21 07:54:36 +02:00
Timothy Flynn
42d93005ac LibWeb: Add a getter for HTMLMediaElement's current playback position
This will be needed by the layout node, which may change what is painted
when the position of the frame image is not the same as the element's
current time.
2023-04-21 07:54:36 +02:00
Timothy Flynn
dd188aafb9 LibWeb: Track decoded video frame positions along with the frame image
This will be needed by the layout node, which may change what is painted
when the position of the frame image is not the same as the element's
current time.
2023-04-21 07:54:36 +02:00
Aliaksandr Kalenik
46c98dbf43 LibWeb: Use device pixels to translate NestedBrowsingContextPaintable
Fix translation of iframes when pixel size is not 1.0.
2023-04-20 20:44:02 +02:00
Linus Groh
37c9dbe248 LibWeb/Painting: Move-assign value in set_containing_line_box_fragment
An Optional<Layout::LineBoxFragmentCoordinate> is 24 bytes, which isn't
small enough to pass by value and then copy.
2023-04-20 20:43:30 +02:00
Linus Groh
352da3623b LibWeb/Painting: Remove redundant 'Painting::' namespace prefixes 2023-04-20 20:43:30 +02:00
Linus Groh
36d35c9c82 LibWeb: Rename remaining paint_box variables to paintable_box
These don't match the type name, which is confusing.
2023-04-20 20:43:30 +02:00
Linus Groh
a75915f055 LibWeb/Layout: Rename BlockContainer::paint{_box => able_with_lines}()
It returns a PaintableBox (a PaintableWithLines, to be specific), not a
'PaintBox'. paintable_box() without the cast is already available
through BlockContainer's Box base class, we don't need to shadow it.
2023-04-20 20:43:30 +02:00
Linus Groh
d58b671ff6 LibWeb/DOM: Rename Node::{paint => paintable}_box()
It returns a PaintableBox, not a 'PaintBox'.
2023-04-20 20:43:30 +02:00
Linus Groh
754e458d0a LibWeb/Layout: Rename Box::{paint => paintable}_box()
It returns a PaintableBox, not a 'PaintBox'.
2023-04-20 20:43:30 +02:00
Linus Groh
ec37b55777 LibWeb/Painting: Rename StackingContext::paintable{ => _box}()
It returns a PaintableBox, not any Paintable.
2023-04-20 20:43:30 +02:00
Linus Groh
e6be5c37c0 LibWeb/WebDriver: Handle WindowProxy in internal_json_clone_algorithm()
To test:

```console
curl http://0.0.0.0:8000/session \
  -H 'Content-Type: application/json' \
  -d '{"capabilities": {}}'
curl http://0.0.0.0:8000/session/0/execute/sync \
  -H 'Content-Type: application/json' \
  -d '{"script": "return window;", "args": []}'
```

Which should result in:

```json
{
  "value": {
    "window-fcc6-11e5-b4f8-330a88ab9d7f":
    "86307df6-e2f1-4175-85cb-77295ff90898"
  }
}
```
2023-04-20 14:41:31 -04:00
Karol Kosek
84a231d4e5 TextEditor: Propagate errors from MainWidget::initialize_menubar() 2023-04-20 17:02:23 +01:00
Karol Kosek
83af64f053 SQLStudio: Propagate errors from MainWidget::initialize_menubar() 2023-04-20 17:02:23 +01:00
Karol Kosek
0b110c88ae PDFViewer: Propagate errors from PDFViewerWidget::initialize_menubar() 2023-04-20 17:02:23 +01:00
Karol Kosek
41cf3b741f HexEditor: Propagate errors from HexEditorWidget::initialize_menubar() 2023-04-20 17:02:23 +01:00
Karol Kosek
abe5787126 CharacterMap: Propagate errors from initialize_menubar() 2023-04-20 17:02:23 +01:00
Linus Groh
b4f78760f2 LibWeb/HTML: Store NonnullGCPtr in browsing context group set
These are never supposed to be null.
2023-04-20 16:47:57 +01:00
Linus Groh
4ee72420e8 LibWeb/HTML: Store NonnullGCPtr in browsing context set
These are never supposed to be null.
2023-04-20 16:47:53 +01:00
Tim Ledbetter
8b6c538f2a Chess: Gracefully handle ChessEngine disconnections
The GUI now tracks when it becomes disconnected from ChessEngine.
If not currently waiting for a move from ChessEngine, it will
automatically reconnect on the next engine move. If a disconnection
occurs while waiting for a move, the player is asked whether they
want to try again or not.
2023-04-20 09:59:18 +01:00
Tim Ledbetter
55347ed6a5 ChessEngine: Gracefully handle GUI disconnections 2023-04-20 09:59:18 +01:00
Tim Ledbetter
680d4e34d5 LibChess: Allow UCIEndpoint to handle unexpected disconnections 2023-04-20 09:59:18 +01:00