Commit graph

42041 commits

Author SHA1 Message Date
Al Hoang
d7d50d6d9e AK: Fix FreeBSD compilation for clock
FreeBSD introduced CLOCK_MONOTONIC_COARSE and CLOCK_REALTIME_COARSE.
This update fixes ladybird builds from FreeBSD 13.1

see clock_gettime(2) https://www.freebsd.org/cgi/man.cgi?query=clock_gettime&apropos=0&sektion=0&manpath=FreeBSD+13.1-RELEASE&arch=default&format=ascii
2022-10-12 23:12:13 -06:00
Sam Atkins
096fe865c6 WebDriver: Implement GET /session/{id}/url endpoint 2022-10-12 23:07:42 +02:00
Sam Atkins
a15d32982a WebDriver: Implement GET /status endpoint 2022-10-12 23:07:42 +02:00
Sam Atkins
80603f141a WebDriver: Add new WebDriver service
WebDriver aims to implement the WebDriver specification found at
https://w3c.github.io/webdriver/webdriver-spec.html . It's an HTTP
server that can create Browser sessions and control them.

Co-authored-by: Florent Castelli <florent.castelli@gmail.com>
2022-10-12 23:07:42 +02:00
Sam Atkins
8c0f1da9f7 Browser: Add a basic WebDriver API
This adds a new option "--webdriver" that opens a local unix socket
in /tmp/browser_{pid} which the WebDriver server can use to send
commands to the Browser instance.

Co-authored-by: Florent Castelli <florent.castelli@gmail.com>
2022-10-12 23:07:42 +02:00
Florent Castelli
ec9c11667f LibC+LibCore: Fix file argument name in posix_spawnp
posix_spawnp takes a file, which is subject to PATH search,
while posix_spawn takes a path.
2022-10-12 23:07:42 +02:00
implicitfield
480e517f03 checksum: Support the '--check' option
This commit also updates 'checksum' to use the Core::Stream::File API.
2022-10-12 12:01:40 -06:00
davidot
340a2a96a4 test262-runner: Use names for the different exit codes
These are not used by test-test262 but can be used to quickly
distinguish the type of problem if the runner fails when running
manually.
2022-10-12 12:00:21 -06:00
davidot
1f54259922 test262-runner: Port to Core::Stream 2022-10-12 12:00:21 -06:00
davidot
302593ded5 test-test262: Port to Core::Stream and use TRY more
The only complication here is that Core::Stream::File is not RefCounted
meaning we have to use OwnPtr instead of RefPtr.
Unfortunately we cannot propagate errors as some errors must be caught
and dealt with as the runner can do anything (like stop at any moment
or close pipes).
2022-10-12 12:00:21 -06:00
davidot
49e3b387ac test-test262: Close the output file stream after writing
Without this the runner is waiting for new tests which will never come
and test-test262 is waiting for output which never comes since the
runner is blocked.
Also finish off a comment, and make the variables follow serenity style.
2022-10-12 12:00:21 -06:00
davidot
d9360676cd LibCore: Add standard_{output, input, error} functions to File::Stream 2022-10-12 12:00:21 -06:00
davidot
e0cccaa583 LibCore: Add option to Stream::File to not close the file on destruction 2022-10-12 12:00:21 -06:00
Mart G
279121fa10 HexEditor: Fix two off-by-one errors
The 'select all' feature now also selects the last byte of the document.
The find function now also selects the last byte of a match.
2022-10-12 18:15:44 +02:00
huttongrabiel
6926991a56 LibGUI: Delete from current position to end of line in VimEditingEngine
When in normal mode pressing Shift+D will delete from the current cursor
position to the end of the line. Leaving the cursor on the character
before where the cursor was when the deletion took place.
2022-10-12 09:46:18 -06:00
Ali Mohammad Pur
166a905951 Userland: Properly populate GENERATED_SOURCES
We previously put the generated headers in SOURCES, which did not mark
them as GENERATED (and did not produce a proper dependency).
This commit moves all generated headers into GENERATED_SOURCES, and
removes useless header SOURCES.
2022-10-12 15:55:15 +01:00
Mart G
c88058cea2 PixelPaint: Call update after clearing guides 2022-10-12 15:25:18 +01:00
Liav A
a1d1f7566f Documentation: Add initial document about the Kernel graphics subsystem 2022-10-12 15:00:53 +01:00
Gunnar Beutner
344ca73930 TextEditor: Set window title before showing the main window
Previously TextEditor updated its window title after the window was
already visible. This causes the default title ("GUI::Window") to be
shown for a short period of time which was especially noticeable when
opening files.
2022-10-12 14:47:27 +02:00
Timon Kruiper
8373a14835 LibWeb: Remove code duplication in computing height for abs-pos elements
This refactors the solve_for_{top, bottom, height, etc} lambdas to use a
common solve_for lambda that takes the length to be solved as an
argument. This way some code duplication is removed.
2022-10-12 11:08:29 +02:00
Samuel Bowman
ca0a0b7a93 LibWeb: Add missing else's in absolutely positioned height computation
Rules 1, 2, and 3 use else if, so rules 4, 5, and 6 should too.
2022-10-12 10:32:57 +02:00
Jan200101
743f46030c LibC: Declare _setjmp and _longjmp on non i386 platforms
These aliases were previously only implemented for i386 and are required
for certain Ports e.g. Lua.
2022-10-12 02:07:27 -06:00
Zaggy1024
41cb705b47 LibVideo: Allow the VP9 decoder to decode ultra high resolution video
Previously, some integer overflows and truncations were causing parsing
errors for 4K videos, with those fixed it can fully decode 8K video.

This adds a test to ensure that 4K video will continue to be decoded.

Note: There seems to be unexpectedly high memory usage while decoding
them, causing 8K video to require more than a gigabyte of RAM. (!!!)
2022-10-12 00:54:31 -06:00
Jeremy Borgman
f894e8be62 shot: Add ability to edit in PixelPaint 2022-10-12 00:46:33 -06:00
Markus Pfeifenberger
0cfcac7900 Kernel: Only use the TSC when it is invariant 2022-10-12 00:32:23 -06:00
minus
cf48200e7b Kernel: Make the ACPI DSDT table accessible
Expose the DSDT table in ACPI::Parser and in
/sys/firmware/acpi as a first little step toward
interpreting the AML bytecode from ACPI.
2022-10-12 00:11:36 -06:00
implicitfield
8c5fa95ba3 test: Guard code paths that may lead to a null pointer dereference
test no longer crashes with a segmentation violation if invalid
arguments are passed.
2022-10-11 23:38:13 -06:00
Tommy Murphy
0ee98c69c1 LibCompress: Brotli support metadata of skip_length=0
The relevant RFC section from
https://www.rfc-editor.org/rfc/rfc7932#section-9.2

MSKIPBYTES * 8 bits: MSKIPLEN - 1, where MSKIPLEN is
       the number of metadata bytes; this field is
       only present if MSKIPBYTES is positive;
       otherwise, MSKIPLEN is 0 (if MSKIPBYTES is
       greater than 1, and the last byte is all
       zeros, then the stream should be rejected as
       invalid)

So when skip_bytes is zero we need to break and
re-align bytes.

Added the relevant test case that demonstrates this from:
https://github.com/google/brotli/blob/master/tests/testdata/x.compressed
2022-10-11 22:49:33 -06:00
Kenneth Myhra
7ea987456a Documentation: Update CLion Configuration to use the x86-64 target
Since the default target is x86-64 after PR #15441 was merged, then let
us update the CLion Configuration accordingly.
2022-10-12 00:09:51 +02:00
Andreas Kling
e6de382679 LibWeb: Constrain abspos element heights by min-height and max-height 2022-10-11 22:31:51 +02:00
Andreas Kling
0e295f727a LibWeb: Fix dumb typos in solver helpers for abspos height 2022-10-11 22:23:13 +02:00
Sam Atkins
f754f45680 LibHTTP: Include request body in HttpRequest::from_raw_request() 2022-10-11 21:52:13 +02:00
Sam Atkins
437c6fc277 pro: Stop closing stdout early
This was causing a race-condition where sometimes the response body
would not get printed.

Co-authored-by: Ali Mohammad Pur <mpfard@serenityos.org>
2022-10-11 21:52:13 +02:00
Sam Atkins
f06a7f40bf LibProtocol: Remove redundant return statement 2022-10-11 21:52:13 +02:00
Sam Atkins
ee72a11ca9 pro: Add argument --method/-m for controlling the HTTP method
This lets you send requests like DELETE.
2022-10-11 21:52:13 +02:00
Sam Atkins
53b7edd5b9 pro: Print the response code if it's an error 2022-10-11 21:52:13 +02:00
Sam Atkins
9b891a423b LibHTTP: Make HTTP method names more accessible
Previously you could only get the name of an HttpRequest::Method if you
already had an HttpRequest.
2022-10-11 21:52:13 +02:00
Andreas Kling
84953c5020 LibWeb: Calculate height of absolute-position elements according to spec
This patch implements the full "old model" height algorithm from the
CSS Positioned Layout spec. I went with the old model since we don't
yet have the machinery required to implement the new model.

Also, the width calculations already follow the old model, so this
is symmetric with that. Eventually we should of course implement the new
positioned layout model.
2022-10-11 21:49:48 +02:00
Andreas Kling
e77798f5fd LibWeb: Implement a large chunk of the Selection API
This patch implements enough of the Selection API specification
that we stop hitting unimplemented functions when loading Twitter.
2022-10-11 21:49:48 +02:00
Andreas Kling
317ab7a04b LibWeb: Make Range's boundary point comparison a public function
We'll need this in the Selection API implementation as well.
2022-10-11 21:49:48 +02:00
Andreas Kling
33c6559561 LibWeb: Add spec link for DOM::Document::m_selection 2022-10-11 21:49:48 +02:00
Andreas Kling
5ab501c92f LibWeb: Scroll elements into view when they become focused
This makes both user-interactive (tab keys) and programmatic focus
changes scroll the viewport if necessary to reveal the newly focused
element.
2022-10-11 21:49:48 +02:00
Andreas Kling
7dcbb403bb LibWeb: Update layout in Element.getClientRects()
We always have to flush any pending layout updates before inspecting the
layout tree.
2022-10-11 21:49:48 +02:00
Sam Atkins
a0d44026fc AK+Tests: Correct off-by-one error when right-trimming text
If the entire string you want to right-trim consists of characters you
want to remove, we previously would incorrectly leave the first
character there.

For example: `trim("aaaaa", "a")` would return "a" instead of "".

We can't use `i >= 0` in the loop since that would fail to detect
underflow, so instead we keep `i` in the range `size .. 1` and then
subtract 1 from it when reading the character.

Added some trim() tests while I was at it. (And to confirm that this was
the issue.)
2022-10-11 17:49:32 +02:00
Mart G
8202beeb2b WindowServer+LibGUI: Shrink window edge resize hot-spots
The hot-spots for resizing a window by dragging its corner are now
limited to a small area around the actual corner instead of an area with
1/3rd the length or width of the window.

The hot-spots to resize a window while holding a modifier key and the
right mouse button are unchanged.
2022-10-11 17:48:48 +02:00
Timothy Slater
eb9db167da HackStudio: Set proper action scope for editor shortcuts
This fixes issue #14429. The editor actions were not given a parent as
scope so defaulted to global. Because HackStudio can have multiple
editors and even multiple editor tab widgets, I chose the
VerticalSplitter that all editor tab widgets get added to as the parent.
With a Widget set as the parent, the action gets WidgetLocal scope and
allows the embedded terminals to receive shortcuts.

Thanks to Andreas for doing a quick look at this and pointing in the
right direction during an Office Hours stream :)
2022-10-11 11:12:41 +02:00
Tim Schumacher
a61a0a63c1 Toolchain: Force makeinfo to be a no-op
Neither are we changing any of our documentation files, nor do we need
any of the documentation that is likely being built.

With macOS potentially removing makeinfo from the default Xcode lineup,
SerenityOS not being able to install it at all currently due to a lack
of perl, and it otherwise just being a dependency that has to be
installed to make the build system happy, lets just stub it out.
2022-10-11 09:28:46 +02:00
Andreas Kling
0f2d5f91dc LibWeb: Fix two uninitialized variables in FormattingContext 2022-10-10 23:42:35 +02:00
Andreas Kling
a2348ebcc0 LibWeb: Make Window.getSelection() forward to Document.getSelection()
(And have document create the Selection object on demand.)
2022-10-10 21:23:03 +02:00
Andreas Kling
b945d164e2 LibWeb: Split intrinsic heights cache based on available width
Now that intrinsic heights (correctly) depend on the amount of available
width, we can't just cache the first calculated min-content and
max-content heights and reuse it without thinking.

Instead, we have to cache three pairs:

- min-content & max-content height with definite available width
- min-content & max-content height with min-content available width
- min-content & max-content height with max-content available width

There might be some more elegant way of solving this, but basically this
makes the cache work correctly when someone's containing block is being
sized under a width constraint.
2022-10-10 20:22:50 +02:00