Commit graph

42215 commits

Author SHA1 Message Date
Linus Groh
47f25d4008 WebDriver: Add GET /session/{id}/window endpoint 2022-10-18 23:22:38 +02:00
Linus Groh
f2435a6237 WebDriver: Rename Session::get_window() to current_window_handle()
Pure getters should always match their member name. Also return a const
reference and let the caller make a copy if needed.
2022-10-18 23:22:38 +02:00
MacDue
c6fbeb5845 LibWeb: Don't attempt to paint text shadows for empty text fragments
This avoids the debug spam that happens then the shadow painting fails
to allocate a zero sized bitmap.
2022-10-18 23:18:53 +02:00
MacDue
89e308726e LibWeb: Print requested bitmap sizes in shadow painting debug logs
Also replace "box-shadow" with "text-shadow" in the text shadow
painting debug logs.
2022-10-18 23:18:53 +02:00
Luke Wilde
41d6307c17 LibHTTP: Fix not consuming the last byte of body in from_raw_request
`index + 1` was not correct. For example, if the body has two bytes, we
would consume the first byte and increment the index. We then add one
to the index and see it's equal to the size, so we take this one byte
and set the body result to it. The while loop would still continue and
we consume the second byte, adding it to the temporary buffer. We see
that the index is above the size, so we don't update the body, dropping
the last byte on the floor.
2022-10-18 23:18:20 +02:00
Tobias Christiansen
5fcf00f30d WebDriver: Add POST /session/{id}/element endpoint
This allows you to query for elements in the active document!
The IDs of matching elements are returned through the WebDriver
interface, for now there's nothing to do with this information.

This introduces a `LocalElement` to the Session, which for now only
holds the ID of a real browser-side element. Once more data of elements
are available to the Session, they can be stored alongside in this
struct.

Fixme's introduced are:
    - Only CSS selector location strategy is implemented for now
    - `get_or_create_a_web_element_reference` returns the elements ID
      instead of a UUID generated in a spec way.
2022-10-18 19:18:33 +02:00
Tobias Christiansen
5d762bd448 WebDriver+Friends: Add IPC and plumbing for Element-getting
This extends the IPC calls `get_document_element` and
`query_selector_all` to be usable by the WebDriver. For this the
`WebDriverConnection` provides the same interfaces and takes care of
routing the data through the Browser.
2022-10-18 19:18:33 +02:00
Tobias Christiansen
281991057c WebContent: Add more IPC endpoints for getting Elements
This patch adds `get_document_element()` and `query_selector_all()`
which return Node's IDs.

    `get_document_element` returns the ID of the document element

    `query_selector_all` returns the IDs of all elements matching the
    selector starting at the Node associated with the start_node_id
2022-10-18 19:18:33 +02:00
snooze6214
d3353ee0e7 PixelPaint: Add action to invert selection 2022-10-18 18:57:12 +02:00
snooze6214
295fcd639f PixelPaint: Make Wand Select tool select correctly on moved layers
Before this commit, when the wand select tool was used on a layer that
was moved, it would make the selection relative to the image, and not
relative to the layer. This commit fixes that issue.
2022-10-18 18:56:33 +02:00
Gunnar Beutner
ce8d410f36 Ports: Make the quake3 port buildable on ARM64 hosts
Previously, on ARM64 hosts we'd try to build ARM64 binaries even when
SERENITY_ARCH was set to x86_64. This would cause the build to fail.
2022-10-18 17:23:52 +02:00
Timothy Flynn
27737f613c LibTimeZone+LibJS: Update to TZDB version 2022e
https://mm.icann.org/pipermail/tz-announce/2022-October/000074.html

This version changes America/Chicago's transtion from LMT to CST from
1883 Nov 18 12:09:24 to 1883 Nov 18 18:00.
2022-10-18 16:01:44 +02:00
Andreas Kling
0e06d4a767 Meta: Add Timon Kruiper to the contributors list :^) 2022-10-18 15:48:29 +02:00
Liav A
74a080fb68 LibC: Use proper casting in fgetc and fgetc_unlocked functions
In the fgetc function, a fix was already in place but was clunky. A real
proper solution is to use an unsigned char instead of a char when
returning the value, so an implicit cast is happening based on the
assumption that the value is unsigned, so if the variable contained 0xff
it won't be treated as -1, but as unsigned 0xff, so the result int will
be 0xff and not -1.

The same solution is applied to the fgetc_unlocked function as well.
2022-10-18 13:21:38 +02:00
Timon Kruiper
1a84cb5457 Kernel/aarch64: Stub more functions to be able to build Scheduler.cpp
With all these functions stubbed, Scheduler.cpp is now buidable!
2022-10-18 13:08:25 +02:00
Timon Kruiper
352f980ca2 Kernel: Call Processor::are_interrupts_enabled in Scheduler::idle_loop
This expresses the intent better, and we shouldn't be calling global
functions anyway.
2022-10-18 13:08:25 +02:00
Jesse Buhagiar
c962cfdc28 Kernel: Reintroduce ScopedAddressSpaceSwitcher to aarch64 build 2022-10-18 13:08:25 +02:00
Jesse Buhagiar
2db73f2171 Kernel: Reintroduce Mutex.cpp to aarch64 build
A few more stubs have been added to support the building of this file
2022-10-18 13:08:25 +02:00
Jesse Buhagiar
07649bcb02 Kernel: Reintroduce Credentials.cpp to aarch64 build 2022-10-18 13:08:25 +02:00
Jesse Buhagiar
fd5671b5d5 Kernel: Add more stubs for the Thread class
Slowly getting there...
2022-10-18 13:08:25 +02:00
Jesse Buhagiar
e61d22b5b6 Kernel: Prevent atomic read/write from failing on nullptr
Having this function return `nullptr` explicitly triggers the compiler's
inbuilt checker, as it knows the destination is null. Having this as a
static (scoped) variable for now circumvents this problem.
2022-10-18 13:08:25 +02:00
Jesse Buhagiar
6582e34bbb Kernel: Include KBufferBuilder.cpp in aarch64 build 2022-10-18 13:08:25 +02:00
Gunnar Beutner
056e406a12 Kernel: Add even more AARCH64 stubs 2022-10-18 13:08:25 +02:00
Gunnar Beutner
63a91d6971 Kernel: Add more AARCH64 stubs 2022-10-18 13:08:25 +02:00
b14ckcat
bf3c99ef23 Kernel/USB: Refactor USB Pipe
Decompose the current monolithic USBD Pipe interface into several
subclasses, one for each pair of endpoint type & direction. This is to
make it more clear what data and functionality belongs to which Pipe
type, and prevent nonsensical things like trying to execute a control
transfer on a non-control pipe. This is important, because the Pipe
class is the interface by which USB device drivers will interact with
the HCD, so the clearer and more explicit this interface is the better.
2022-10-18 12:58:12 +02:00
b14ckcat
1304575190 Kernel/USB: Adjust USB Pipe buffer
Allocate DMA buffer pages for use within the USBD Pipe class, and allow
for the user to specify the size of this buffer, rounding up to the
next page boundary.
2022-10-18 12:58:12 +02:00
Zaggy1024
f0420def78 LibWeb: Implement HTMLSelectElement length, item() and namedItem()
These are simple calls through to the HTMLOptionsCollection functions
the same names, as with HTMLSelectElement.add().
2022-10-18 12:57:40 +02:00
Johannes Laudenberg
2547e0b966 LibWeb: Use calculate_min_content_height() for sizing of grid children
When sizing grid children we now also check whether
calculate_min_content_height() adds to the computed height. Previously
we were using the result of layout_inner() which led to zero height of
not specifically sized block level children.

This fixes a height issue with our GitHub page. The footer is now at
its place and is not hovering over other content anymore.
2022-10-18 12:55:34 +02:00
implicitfield
3dddc02400 2048: Do not decrement m_target_tile_power
This fixes an issue where the target tile would decrease each time that
the settings window was opened.
2022-10-17 22:40:52 +02:00
implicitfield
5d77daebf3 2048: Convert to GML 2022-10-17 22:40:52 +02:00
Linus Groh
a6ba82fc49 LibTimeZone: Resolve /etc/localtime with realpath(), not readlink()
On Fedora Silverblue and other OSTree-based systems, /etc/localtime is
a symlink to /run/host/etc/localtime, which then points to the expected
zoneinfo file, e.g. ../usr/share/zoneinfo/Europe/Berlin.
By using realpath() instead of readlink() we can resolve the symlink
recursively and avoid falling back to UTC.
2022-10-17 22:19:50 +02:00
Timothy Flynn
b1b17f286f LibC: Retrieve the current time zone from LibTimeZone
This ensures we have just one location for determining the time zone, so
that LibC and LibTimeZone will behave the same.

(Note the FIXME removed here is also in TimeZone::current_time_zone.)
2022-10-17 21:50:55 +02:00
Timothy Flynn
ed612d835d LibTimeZone: Default to UTC if parsing the TZ environment variable fails
Commit c3fd455 changed LibTimeZone to fall back to the system time zone
when we fail to parse the TZ environment variable. This behavior differs
from both our LibC and glibc; they abort parsing and default to UTC.

This changes LibTimeZone to behave the same way to avoid a very awkward
situation where some parts of the codebase thinks the timezone is UTC,
and others think the timezone is whatever /etc/timezone indicates.
2022-10-17 21:50:55 +02:00
brapru
6691ef5a44 route: Accept CIDR notation when specifying network
Now that the IPv4Address has the ability to generate valid IP addresses
from CIDR notations, this provides a nicer interface to the user when
specifying the network address to add or delete.
2022-10-17 20:18:44 +02:00
Timon Kruiper
c7aa05cdcc Kernel/aarch64: Initialize TimeManagement in init.cpp
Also remove the check for aarch64 in AK/Format.cpp, so now the format
functions will prepend the time since boot!
2022-10-17 20:11:31 +02:00
Timon Kruiper
01a14ac7af Kernel: Implement TimeManagement for aarch64
This sets up the RPi::Timer to trigger an interurpt every 4ms using one
of the comparators. The actual time is calculated by looking at the main
counter of the RPi::Timer using the Timer::update_time function.

A stub for Scheduler::timer_tick is also added, since the TimeManagement
code now calls the function.
2022-10-17 20:11:31 +02:00
Timon Kruiper
83b95c135e Kernel/aarch64: Implement HardwareTimer for RPi::Timer
This makes the RPi::Timer suitable for use in the TimeManagement code.
2022-10-17 20:11:31 +02:00
Timon Kruiper
de0bb99893 Kernel: Correctly calculate delta_ticks when 64-bit counter wraps around
We never caught this bug in the HPET, since it takes ages for a 64-bit
counter to wrap around. Also remove an unnecessary if check.
2022-10-17 20:11:31 +02:00
Timon Kruiper
6680241773 Kernel/aarch64: Add implementation for Processor::current_in_irq 2022-10-17 20:11:31 +02:00
Timon Kruiper
1348757dda Kernel/aarch64: Add implementation of Processor::is_bootstrap_processor
This should really go into a generic Processor class, but there is no
such class yet, so a FIXME is added for that.
2022-10-17 20:11:31 +02:00
Timon Kruiper
9827c11d8b Kernel: Move InterruptDisabler out of Arch directory
The code in this file is not architecture specific, so it can be moved
to the base Kernel directory.
2022-10-17 20:11:31 +02:00
Linus Groh
8b5b42f667 WebDriver: Replace Session* session = ... with auto* session = ... 2022-10-17 18:20:05 +02:00
Linus Groh
324eb98bb9 WebDriver: Pass endpoint handler function parameters by const reference 2022-10-17 18:20:05 +02:00
Linus Groh
727e982c50 WebDriver: Put endpoint functions in spec order 2022-10-17 18:20:05 +02:00
Linus Groh
eafb924580 WebDriver: Include section number and title in spec comments
Also, only add the HTTP method and path to the Client side where they
are relevant for seeing which parameters are available and such.
2022-10-17 18:20:05 +02:00
leeight
0d96468e9b LibJS: Implement RegExp legacy static properties
RegExp legacy static properties Spec url is https://github.com/tc39/proposal-regexp-legacy-features
2022-10-17 17:08:33 +02:00
Andrew Kaster
5e2fe7e2bf Lagom: Enable compile_commands.json for the lagom build directory
This allows a developer who only wants to look at Lagom to have their
IDE find source files and headers properly.
2022-10-17 15:55:55 +02:00
Andrew Kaster
b8e51425e9 Lagom+CMake: Propagate dependencies for generated custom targets
We have logic for serenity_generated_sources which works well for source
files that are specified in GENERATED_SOURCES prior to calling
serenity_lib or serenity_bin. However, code generated with
invoke_generator, and the LibWeb generators do not always follow the
pattern of the IDL and GML files.

For the LibWeb generators, we can just add_dependencies to LibWeb at the
time we declare the generate_Foo custom target. However for LibLocale,
LibTimeZone, and LibUnicode, we don't have the name of the target
available, so export the name in a variable to set into
GENERATED_SOURCES.

To make this work for Lagom, we need to make sure that lagom_lib and
serenity_bin in Lagom/CMakeLists.txt call serenity_generated_sources on
the target.

This enables the Xcode generator on macOS hosts, at least for Lagom.
2022-10-17 15:55:55 +02:00
Andrew Kaster
8160b53228 Lagom: Make lagom_lib take names prefixed with Lib
This matches serenity_lib, and consolidates the logic to strip Lib from
the front of the library name for the Lagom export name into one place
at the top of lagom_lib.
2022-10-17 15:55:55 +02:00
Andrew Kaster
3f13959c68 Kernel: Mark Version.h as a dependency of Kernel rather than ALL 2022-10-17 15:55:55 +02:00