Commit Graph

49530 Commits

Author SHA1 Message Date
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
1b6492d0fb LibWeb: Return typed array and ArrayBuffer for BufferSource in IDL union
Previous this ignored typed arrays and ArrayBuffer, hitting the
fallback JS -> C++ conversion case, typically stringifying them.
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
3d0ac399c4 Ladybird: Add a command line flag to disable launching SQLServer 2023-04-21 07:56:14 +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
59a1a3f463 Base: Add options to the video test page to change its attributes
This is to allow testing autoplay, poster images, etc. without having to
stash local changes to the page. This also changes the URLs used on the
page to be relative to the page itself, to allow the page to load both
on Serenity and Lagom.
2023-04-21 07:54:36 +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
Fabian Dellwing
af20b74a83 Ports: Add more supported functions to README 2023-04-20 11:50:27 +02:00
Fabian Dellwing
47c5b77116 Ports: Update zsh 2023-04-20 11:50:27 +02: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
Tim Ledbetter
bf320e4826 Chess: Send a quit command to ChessEngine when it is no longer in use
The chess GUI now instructs the ChessEngine to gracefully exit by
sending a UCI quit command.
2023-04-20 09:59:18 +01:00
Tim Ledbetter
c2b9376409 ChessEngine: Handle the UCI quit command 2023-04-20 09:59:18 +01:00
Tim Ledbetter
13dbc69c23 LibChess: Add the UCI quit command 2023-04-20 09:59:18 +01:00
Timothy Flynn
d2f9645cc0 LibWeb: Properly stop, rather than terminate, ongoing media fetches
We are currently using the fetch controller's terminate() method to stop
ongoing fetches when the HTMLMediaElement load algorithm is invoked.
This method ultimately causes the fetch response to be a network error,
which we propagate through the HTMLMediaElement's error event. This can
cause websites, such as Steam, to avoid attempting to play any video.

The spec does not actually specify what it means to "stop" or "cancel" a
fetching process. But we should not use terminate() as that is a defined
spec method, and the spec does tend to indicate when that method should
be used (e.g. as it does in XMLHttpRequest).
2023-04-20 06:19:41 +02:00
Timothy Flynn
8d4d01d99a LibWeb: Invent a method to stop an in-progress fetch without errors
The HTMLMediaElement will need to stop fetching processes when its load
algorithm is invoked while a fetch is ongoing. We don't have a way to
really stop the process, due to the way it runs on nested deferred task
invocations. So for now, this swaps the fetch callbacks (e.g. to process
a fetch response) with empty callbacks.
2023-04-20 06:19:41 +02:00
Timothy Flynn
1fb0c7826b LibWeb: Do not handle media ready state changes for empty network states
This was missed in the header text of the ready state transition spec.
2023-04-20 06:19:41 +02:00
Timothy Flynn
27fd31b2ad LibWeb: Implement the HTMLMediaElement delaying-the-load-event flag 2023-04-20 06:19:41 +02:00
Timothy Flynn
1a67b86b76 LibWeb: Implement the HTMLMediaElement currentSrc attribute 2023-04-20 06:19:41 +02:00
Andreas Kling
74a6f50c91 LibWeb: Add HTML::TraversableNavigable
This is the "traversable navigable" concept from the HTML spec.

Co-authored-by: Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
2023-04-19 18:26:45 +02:00
Andreas Kling
2d602dcb34 LibWeb: Add HTML::Navigable
This is the first step towards implementing the new "navigable" concept
from the HTML spec.

Co-authored-by: Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
2023-04-19 18:26:45 +02:00
Andreas Kling
d8ccc2d54e LibWeb: Rename BrowsingContextContainer => NavigableContainer
The "browsing context container" concept in the HTML spec has been
replaced with "navigable container". Renaming this is the first step of
many towards implementing the new world.

Co-authored-by: Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
2023-04-19 18:26:45 +02:00
Sam Atkins
0f9f6aef81 LibWeb: Simplify StyleValue API now that auto isn't a length
Now that LengthStyleValue never contains `auto`, IdentifierStyleValue is
the only type that can hold an identifier. This lets us remove a couple
of virtual methods from StyleValue.

I've kept `has_auto()` and `to_identifier()` for convenience, but they
are now simple non-virtual methods.
2023-04-19 18:25:18 +02:00
Sam Atkins
4ddacf4740 LibWeb: Verify we don't accidentally create an auto LengthStyleValue 2023-04-19 18:25:18 +02:00
Sam Atkins
e3b557fa64 LibWeb: Stop creating auto LengthStyleValue for resolved style 2023-04-19 18:25:18 +02:00
Sam Atkins
5647d37d42 LibWeb: Stop parsing auto as a Length
Previously, whether trying to parse a `<length>` or `<dimension>`, we
would accept `auto` and produce a `LengthStyleValue` from it. This
would fool the `property_accepts_value()` into allowing `auto` where it
does not belong, if the property did accept lengths.

Of the few places in the parser that called `parse_dimension_value()` or
`parse_length()`, none of them were expecting it to accept `auto`, so
this fixes those too. :^)
2023-04-19 18:25:18 +02:00