Commit Graph

54264 Commits

Author SHA1 Message Date
Sergey Bugaev
bba193d6a0 Tests, LibTest: Implement disabling core dumps on GNU Hurd 2023-09-06 11:41:16 -06:00
Sergey Bugaev
f31df017f9 LibCore: Port Socket to GNU Hurd
The Hurd supports sending file descriptors over local sockets using
the SCM_RIGHTS / cmsg mechanism just like the other systems. It doesn't
have anything like ucred/PEERCRED, though.
2023-09-06 11:41:16 -06:00
Sergey Bugaev
79431b32b2 AK: Add AK_OS_GNU_HURD :^)
This is defined when building on GNU/Hurd, the GNU operating system with
the Hurd as its kernel (as it was designed originally, before Linux and
GNU/Linux came to be).

Also, define the corresponding part of User-Agent.
2023-09-06 11:41:16 -06:00
Sergey Bugaev
e6cf125535 Utilities: Fix building ntpquery without SO_TIMESTAMP
If SO_TIMESTAMP is unsupported, we won't be able to determine
kernelspace-to-userspace latency. But other than that, things should
still build and work.

(It's a separate question of what "kernelspace-to-userspace latency"
even means on a microkernel system, where the network card drivers, the
network stack, and ntpquery(1) are all running as userspace programs.)

Also, don't fail completely if settting receive timeout fails.
2023-09-06 11:41:16 -06:00
Sergey Bugaev
7cb765173c LibELF: Fix building without PTHREAD_STACK_MIN defined
It may or may not be defined according to Dr. POSIX.
Also, sneak in a little fix for passing a 64-bit value into a
size_t-typed argument.
2023-09-06 11:41:16 -06:00
Shannon Booth
76449c21b2 LibWeb: Port TextEncoder interface from DeprecatedString to String 2023-09-06 11:44:45 -04:00
Shannon Booth
278061e8b9 LibWeb: Port TextDecoder interface from DeprecatedString to String 2023-09-06 11:44:45 -04:00
Shannon Booth
41928c2902 LibWeb: Port DOMException interface from DeprecatedString to String 2023-09-06 11:44:45 -04:00
Shannon Booth
bcb6851c07 LibWeb: Port Text interface from DeprecatedString to String 2023-09-06 11:44:45 -04:00
Shannon Booth
6789a2dd8e LibWeb: Port ShadowRoot interface from DeprecatedString to String 2023-09-06 11:44:45 -04:00
Shannon Booth
0ce5a920f7 LibWeb: Port MutationObserver interface from DeprecatedString to String 2023-09-06 11:44:45 -04:00
Shannon Booth
8531d11fab LibWeb: Port DOMParser interface from DeprecatedString to String 2023-09-06 11:44:45 -04:00
Shannon Booth
cc1e4c5cb3 LibWeb: Port Comment interface from DeprecatedString to String 2023-09-06 11:44:45 -04:00
Andreas Kling
4da1f4e836 LibWeb: Make FontPlugin::generic_font_name() return FlyString 2023-09-06 11:29:03 -04:00
Andreas Kling
13db3c5ce0 LibGfx: Convert FontDatabase APIs to use FlyString 2023-09-06 11:29:03 -04:00
Andreas Kling
e4d14e1afc AK: Add FlyString::operator<=>(FlyString const&)
Same as String already has.
2023-09-06 11:29:03 -04:00
Andreas Kling
1e820385d9 AK: Add case-insensitive hashing for the new String classes
Bringing over this functionality from DeprecatedString.
2023-09-06 11:29:03 -04:00
Andreas Kling
545d8336b8 LibGfx: Convert Font APIs to return String instead of DeprecatedString 2023-09-06 11:29:03 -04:00
Andrew Kaster
4e9dc127ae Meta: Run Android CI via gradle wrapper instead of via CMake 2023-09-06 11:26:20 -04:00
Andrew Kaster
0a05440220 Ladybird: Target JDK 11 instead of 1.8, which was the default
Also use CMake >=3.23.0 instead of 3.27.4, which is much more reasonable
for diverse host systems.
2023-09-06 11:26:20 -04:00
Ali Caglayan
1ee3ec16a9 Userland: Fix absolute paths in man page links
Absolute paths in man page links such as

```
[some link](/foo/bar)
```

Were being interpreted as relative paths when rendered in HTML. This
issue was observed in #20889 and #20041.

The fix is to make sure we don't leave any absolute paths when parsing
links. Instead we check if a directory is absolute (by checking for `/`)
and add `file://` accordingly. This turns the above link into:

```
[some link](file:///foo/bar)
```

Which does get interpreted correctly when rendered as HTML.

- fixes #20889
- fixes #20041

Before this patch, opening the Help application would raise an error.
Now all the pictures in the man pages render correctly.
2023-09-06 15:02:44 +01:00
Sergey Bugaev
8ebddc1ff6 LibGfx: Misc 32-bit build fixes 2023-09-06 07:21:07 -06:00
Sergey Bugaev
79022090bf LibWeb: Add CSSPixels operator overloads for unsigned int
Fixes building on 32-bit, where using operators with size_t (aka
unsigned int) results in ambiguity between the overloads for int
and unsigned long.
2023-09-06 07:21:07 -06:00
Sergey Bugaev
e97c2538b6 Tests: Fix building TestSIMD on non-SSE ABIs 2023-09-06 07:21:07 -06:00
Sergey Bugaev
7bce0e5d1a Tests: Fix TestDuration build with 32-bit time_t
There are a bunch of tests that check for time_t handling 64-bit values
properly. This makes sense, but also obviously doesn't work when time_t
is 32-bit, and causes compile-time errors. Compile these tests out in
that case.

Since there's no straightforward way to check sizeof(time_t) inside the
proprocessor, only do this when glibc's __TIMESIZE is defined.
2023-09-06 07:21:07 -06:00
Sergey Bugaev
b21382bd4e LibWeb: Set CPU_STRING for i386 2023-09-06 07:21:07 -06:00
Sergey Bugaev
88a3b4da9e AK: Add back ARCH(I386)
This now checks whether the platform is i386-based (but not x86_64).
2023-09-06 07:21:07 -06:00
Hendiadyoin1
35e3e3d483 AK: Make FixedPoint work on platforms without __int128 2023-09-06 07:17:03 -06:00
Sergey Bugaev
de6664c0cb LibTimeZone: Replace PATH_MAX usage with heap allocation 2023-09-06 07:14:35 -06:00
Sergey Bugaev
ae10d085ba LibFileSystem: Replace PATH_MAX usage with heap allocation 2023-09-06 07:14:35 -06:00
Sergey Bugaev
4825919bcf AK, LibCore: Enable misc things on glibc
program_invocation_name, pthread_getattr_np(), EXECINFO_BACKTRACE are
all glibc specifics (that other libcs may also have).
2023-09-06 07:14:35 -06:00
Sergey Bugaev
0143e5a36d AK: Enable arc4random_buf on glibc 2.36+
We have arc4random starting from 2.36, no reason not to use it :^)
2023-09-06 07:14:35 -06:00
Sergey Bugaev
3f90e9a8a0 AK: Add AK_LIBC_GLIBC
This is defined when we're compiling against the GNU C Library, whether
on Linux or on other kernels that glibc works on. More AK_LIBC_xxxx
definitions could be potentially added in the future.

Also add AK_LIBC_GLIBC_PREREQ(), which checks for a specific glibc
version.
2023-09-06 07:14:35 -06:00
Shannon Booth
c4f12feadc LibWeb: Port CanvasGradient interface from DeprecatedString to String 2023-09-05 20:36:09 -04:00
Shannon Booth
2c69f273a0 LibWeb: Port HTMLElement interface from DeprecatedString to String 2023-09-05 20:36:09 -04:00
Shannon Booth
938356da98 LibWeb: Port HTMLInputElement interface from DeprecatedString to String 2023-09-05 20:36:09 -04:00
Shannon Booth
f4bc1602e2 LibWeb: Port HTMLMediaElement interface from DeprecatedString to String 2023-09-05 20:36:09 -04:00
Shannon Booth
e5910a4593 LibWeb: Port HTMLAnchorElement interface from DeprecatedString to String 2023-09-05 20:36:09 -04:00
Shannon Booth
76af9d434c LibWeb: Port HTMLCanvasElement interface from DeprecatedString to String 2023-09-05 20:36:09 -04:00
Shannon Booth
7206f1777a LibWeb: Port HTMLOptionElement interface from DeprecatedString to String 2023-09-05 20:36:09 -04:00
Shannon Booth
c405ba6b08 LibWeb: Port HTMLBaseElement interface from DeprecatedString to String 2023-09-05 20:36:09 -04:00
Shannon Booth
2a732e6ddd LibWeb: Port HTMLFormElement interface from DeprecatedString to String
Leaving a FIXME for HTMLFormElement::method as it looks like this could
be Reflect in the IDL.
2023-09-05 20:36:09 -04:00
Shannon Booth
63aa93aaf4 LibWeb: Port HTMLObjectElement interface from DeprecatedString to String 2023-09-05 20:36:09 -04:00
Shannon Booth
de07fb5132 LibWeb: Port HTMLAreaElement interface from DeprecatedString to String
Which required HTMLHyperlinkElementUtils to also be changed to support
this.
2023-09-05 20:36:09 -04:00
Shannon Booth
57d8b0ec73 LibWeb: Port HTMLButtonElement interface from DeprecatedString to String 2023-09-05 20:36:09 -04:00
Shannon Booth
2ab7129595 LibWeb: Port HTMLScriptElement interface from DeprecatedString to String 2023-09-05 20:36:09 -04:00
Shannon Booth
914fb90bbe LibWeb: Don't generate Optional<String> from IDL for non-null arguments
Previously if the IDL was something like:
```
constructor(optional DOMString data = "");
```

We were generating code that would be passing through to the constructor
an Optional<String> - even though for this situation it is not possible
for it to be null.

Instead, if we know if there is a default value that is non-null and the
type is not nullish, just generate the cpp code as a String.
2023-09-05 20:36:09 -04:00
Shannon Booth
f991e40d7f LibWeb: Support [Reflect] on IDL String attributes that may return null
This change allows IDL interfaces to be compiled using new AK String
which have a attribute in the interface that may return null.

Without this change we would run into a compile error from code such as
the following example:

```
auto retval = impl->deprecated_attribute(HTML::AttributeNames::ref);

if (!retval.has_value()) {
    return JS::js_null();
 }
 return JS::PrimitiveString::create(vm, retval.release_value());
```

As `deprecated_attribute` returns a `DeprecatedString` instead of an
`Optional<String>`. Fix that by using the non-deprecated attribute
implementation, and falling back to the empty string for where we cannot
return null.

Also add a test here to cover a regression I almost introduced here
which was not previously covered by our test suite.

Ideally, all of this should actually just be calling
Element::get_attribute_value, but I'm not entirely sure at this stage
what the behavioral change would be to test for here. Since this
implementation preserves the previous behavior, stick with it, and add a
FIXME for now.
2023-09-05 20:36:09 -04:00
Shannon Booth
6fb3586baa LibWeb: Add Optional<String> version of Element::attribute
As a non-deprecated alternative to DeprecatedString Element::attribute.
2023-09-05 20:36:09 -04:00
Shannon Booth
0f6782fae6 LibWeb: Rename Element::attribute to Element::deprecated_attribute
This should allow us to add a Element::attribute which returns an
Optional<String>. Eventually all callers should be ported to switch from
the DeprecatedString version, but in the meantime, this should allow us
to port some more IDL interfaces away from DeprecatedString.
2023-09-05 20:36:09 -04:00