Commit graph

54168 commits

Author SHA1 Message Date
Zaggy1024
34c5043cbe LibWeb: Use CSSPixelFraction to represent aspect ratios
This allows us to retain perfect precision for aspect ratios derived
from either the intrinsic sizes of replaced elements, or the
`aspect-ratio` CSS property.
2023-09-04 12:40:17 +02:00
Ali Mohammad Pur
4fb209d25f LibWasm: Explicitly place the paddings in the WASI API types
This makes it so we don't rely on e.g. u64 to have an 8-byte alignment,
fixing breakage on i686 systems.
2023-09-04 13:32:36 +03:30
Sönke Holz
d6906736cc Meta: Add -fno-omit-frame-pointer flag
We currently only use frame pointer-based backtrace generation.
This option is necessary for RISC-V as otherwise the compiler doesn't
save `fp` most of the time.
I made this flag not riscv64 exclusive, as we should do everything
to make that kind of backtrace generation work.
(https://discord.com/channels/830522505605283862/1139481927594803260/1148020960499351643)
2023-09-04 07:45:35 +02:00
Andreas Kling
b52cbf673d LibJS: Avoid DeprecatedString allocation in Token::double_value()
Instead of allocating a DeprecatedString just so we can call strtoull()
on it, we now collect the relevant token characters in a vector and add
a null terminator manually.

2% speed-up on Kraken/imaging-darkroom.js :^)
2023-09-03 18:59:00 +02:00
Andreas Kling
008b9f4c9f LibJS: Add fast-path for Value::to_numeric() on number values
We can skip a whole bunch of checks in this case and just return the
value itself.

2% speed-up on Kraken/imaging-darkroom.js :^)
2023-09-03 18:59:00 +02:00
Aliaksandr Kalenik
5951a93f51 LibWeb: Remove GC allocations in FetchAlgorithms constructor
We should not GC allocate in the constructors of GC-allocated objects
because a new allocation might trigger garbage collection, which in
turn might access not fully initialized objects.
2023-09-03 18:52:31 +02:00
Bastiaan van der Plaat
f9f9c38de3 Maps: Add new basic maps application and map widget 2023-09-03 18:10:58 +02:00
Andreas Kling
50d72f0d8c LibWeb: Handle case where abspos flex child position depends on height
There's a particularly awkward case where the static position of an
abspos child of a flex container is dependent on its height. This can
happen when `align-items: center` is in effect, as we have to adjust
the abspos child's Y position by half of its height.

This patch solves the issue by reordering operations in the abspos
height resolution algorithm, to make sure that height is resolved
before the static position is calculated.
2023-09-03 15:44:47 +02:00
Andreas Kling
f77256fcba LibWeb: Use should_height_treat_as_auto() consistently in abspos layout 2023-09-03 15:44:47 +02:00
Bastiaan van der Plaat
5cd35b633a LibWeb: Add DOMMatrix translate 2023-09-03 15:05:41 +02:00
Bastiaan van der Plaat
61c063f7b3 LibWeb: Add DOMMatrix multiply 2023-09-03 15:05:41 +02:00
Bastiaan van der Plaat
ff1bcc694d LibWeb: Add DOMMatrix and DOMMatrixReadOnly fromMatrix 2023-09-03 15:05:41 +02:00
MacDue
bbf66ea055 LibGfx: Remove maximum size limit for decoded images
It is unlikely this is needed anymore, and as pointed out things should
now safely return OOM if the bitmap is too large to allocate.

Also, no recently added decoders respected this limit anyway.

Fixes #20872
2023-09-03 14:36:54 +02:00
Alexander Bosu-Kellett
13d1c37ea0 LibCore: Recognize .xht as an HTML document
This allows opening the WPT .xht files directly with ladybird.
2023-09-03 12:33:34 +02:00
Aliaksandr Kalenik
ed0dc2ff72 LibWeb: Use flex layout for button content alignment
Using flex layout inside button solves the issue with wrongly calculated
height when it has: pseudo element and whitespaces inside.

Also using flex instead of a table layout allows for the same vertical
alignment but with fewer layout nodes: a flex container and anonymous
wrapper for content instead of a table wrapper, table, row, and cell.
2023-09-03 12:33:10 +02:00
Andrew Kaster
3216cc34a6 Documentation: Remove outdated Android build docs
We'll add new docs once the new build has been tested by enough folks
:^)
2023-09-03 11:38:51 +02:00
Andrew Kaster
7bc009d80f Ladybird: Add new template Kotlin Android application without Qt
This template app from Android Studio should hopefully be more fun to
work on than the Qt wrapped application we were using before. :^)

It currently builds the native code using gradle rules, and has a stub
WebViewImplementationNative class that will wrap a c++ class of the same
name that inhertis from WebView::ViewImplementation. Spawning helper
processes and creating proper views in Kotlin is next on the list.
2023-09-03 11:38:51 +02:00
Andrew Kaster
6e8f1549a3 AK+LibCore: Don't use unsupported features on Android 2023-09-03 11:38:51 +02:00
Daniel Bertalan
725584881a LibC: Set (U)LONG_WIDTH correctly for 64-bit
All supported targets use an LP64 ABI, where both `long` and `long long`
are 64 bits wide. We set `LONG_WIDTH` to 32, which caused an error when
compiling gnulib's `vasnprintf` routine.

We might consider using built-in macros to avoid such issues in the
future.
2023-09-03 09:18:22 +02:00
Andreas Kling
e2dcd97c88 LibWeb: Stub out HTMLDialogElement APIs
This makes https://null.com/ load instead of throwing a React internal
error and showing a black background.
2023-09-03 07:51:11 +02:00
Andrew Kaster
aa03f73c2e AK: Demangle symbols on assertion failure on Linux as well
While macOS backtrace(3) puts a space directly after the mangled symbol
name, some versions of glibc put a + directly after it. This new logic
accounts for both situations when trying to demangle.

Co-Authored-By: Andreas Kling <kling@serenityos.org>
2023-09-03 07:51:03 +02:00
Liav A
4cee3b65d3 Ports: Add lcms2 2023-09-03 06:34:52 +02:00
Liav A
cd3c06dcef Ports: Add liblzf
This small data compression library also provides userspace utilities to
compress and decompress data.
2023-09-03 06:30:36 +02:00
René Hickersberger
bd3d185b3b Ports: Add nnn port
This ports the nnn (n³ / Nnn's Not Noice) file manager.
2023-09-03 06:21:40 +02:00
René Hickersberger
a969e55bf2 Ports: Add libfts port
This ports an implementation of the FTS functions that can be used to
traverse the file system. They are non-standard, but provided by glibc
and most BSD systems. This ported library implements FTS for musl-based
Linux systems and happens to work on Serenity.
2023-09-03 06:21:40 +02:00
René Hickersberger
f2bd3904da LibC: Implement memccpy 2023-09-03 06:21:40 +02:00
René Hickersberger
ad560cff0f LibC: Implement vdprintf and dprintf
These functions work just like `vfprintf` and `fprintf`, except that
they take a file descriptor as their first argument instead of a FILE*.
2023-09-03 06:21:40 +02:00
Zaggy1024
daf3d4c6ef LibWeb: Don't send audio time updates until audio is playing
We would start the timer to send playback time updates to the element
before playback had started, so in cases where the `HTMLMediaElement`
(incorrectly) creates both an `AudioTrack` and `VideoTrack`, it will
not cause the seek bar to flicker between the current video position
and zero.
2023-09-02 19:36:09 -04:00
Shannon Booth
a53459192f LibWeb: Add Optional<String> overload for Element::set_attribute
Which for now will just call the DeprecatedString version of this
function. This is intended to be used in porting code over to using the
new String equivalent with the end goal of removing the DeprecatedString
version of this function.

This allows us to port a whole heap of IDL interfaces from
DeprecatedString to String.
2023-09-02 19:23:41 +01:00
Shannon Booth
d4a890080d LibWeb: Switch IDL from UseNewAKString to UseDeprecatedAKString
NewAKString is effectively the default for any new IDL interface, so
let's mark this as the default behavior. It also makes it much easier to
figure out whatever interfaces are still left to port over to new AK
String.
2023-09-02 19:23:41 +01:00
Dan Klishch
198591cc20 JSSpecCompiler: Add infrastructure to run compiler passes on AST 2023-09-02 19:57:06 +02:00
Dan Klishch
cd8f4aaa7d JSSpecCompiler: Introduce Function and ExecutionContext classes
Currently, they are not extremely useful, but the plan is to store
all function-local state in JSSpecCompiler::Function and all
"translation unit" state in ExecutionContext.
2023-09-02 19:57:06 +02:00
Timothy Flynn
f05d291b41 LibWeb: Use the spec-mandated set-value when setting an attribute 2023-09-02 13:55:32 -04:00
Timothy Flynn
5ec76331e8 LibWeb: Invoke our internal attribute change handler from Attr
Currently, every public DOM::Element method which changes an attribute
fires this handler itself. This was missed in commit 720f7ba, so any
user of that API would not fire the internal handler.

To fix this, and prevent any missing invocations in the future, invoke
the handler from from Attr::handle_attribute_changes. This method is
reached for all attribute changes, including adding/removing attributes.
This ensures the handler will always be fired, and reduces the footprint
of this ad-hoc behavior.

Note that our ad-hoc handler is not the "attribute change steps" noted
by the spec. Those are overridden only by a couple of specific elements,
e.g. HTMLSlotElement. However, we could easily make our ad-hoc handler
hook into those steps in the future.
2023-09-02 13:55:32 -04:00
Timothy Flynn
9aae50a9c3 LibWeb: Handle attribute changes after actually changing the attribute
This is a normative change in the DOM spec. See:
https://github.com/whatwg/dom/commit/3fb0aa6
2023-09-02 13:55:32 -04:00
Timothy Flynn
2d97dd019e LibWeb: Use the spec-mandated change-attribute when setting an attribute 2023-09-02 13:55:32 -04:00
Timothy Flynn
50ec91fbe3 LibWeb: Add a missing spec-mandated return in Element::toggle_attribute 2023-09-02 13:55:32 -04:00
Andreas Kling
c78506d79b LibJS: Only update EC instruction pointer when pushing to EC stack
Instead of trying to keep a live reference to the bytecode interpreter's
current instruction stream iterator, we now simply copy the current
iterator whenever pushing to the ExecutionContext stack.

This fixes a stack-use-after-return issue reported by ASAN.
2023-09-02 19:24:29 +02:00
Liav A
2966188ea3 Userland: Always call syscall(SC_prctl, ...) with 4 arguments
The arguments are passed on registers, so if we pass only 3 defined
arguments then the fourth argument for the prctl syscall could have
garbage value within it.

To avoid possible bugs, always pass 3 arguments to a raw syscall prctl
call in addition to the prctl sub-option (the first argument).
2023-09-02 18:22:07 +02:00
Cubic Love
ab4262d49e About: Display Application's Icon in File Manager
Before, when looking in /bin in File Manager, the About application's
icon was missing. Now it is a serenity_app instead of serenity_bin the
icon is visible!
2023-09-02 16:27:08 +01:00
Shannon Booth
5b8be3a08d LibWeb: Handle immutable state for HTMLInputElement pickers
Which should not be shown if the element is not mutable.
2023-09-02 15:53:33 +02:00
Shannon Booth
7167d6a1c8 LibWeb: Support readonly attribute for input elements 2023-09-02 15:53:33 +02:00
Andreas Kling
1c06111cbd LibJS: Add file & line number to bytecode VM stack traces :^)
This works by adding source start/end offset to every bytecode
instruction. In the future we can make this more efficient by keeping
a map of bytecode ranges to source ranges in the Executable instead,
but let's just get traces working first.

Co-Authored-By: Andrew Kaster <akaster@serenityos.org>
2023-09-02 15:37:53 +02:00
Cubic Love
0b66656ca9 FlappyBug: Improve Application Icons
Add new 16px and 32px application icons for Flappy Bug
2023-09-02 07:25:53 +02:00
Cubic Love
6fa1a5c7d2 FlappyBug: Improve Character Assets
Add new sprites of Flappy Bug falling and flapping
2023-09-02 07:25:53 +02:00
Timothy Flynn
720f7ba746 LibWeb: Define getting and setting an attribute value 2023-09-02 01:46:37 +03:30
Timothy Flynn
2c096486a4 LibWeb: Extract changing an attribute to its own method
This will be needed outside of this the method to set an existing
attribute, so do not inline this implementation.
2023-09-02 01:46:37 +03:30
Tim Ledbetter
889e6ab43d find: Add the -empty option
This predicate returns true for empty regular files or directories.
2023-09-01 23:48:44 +02:00
Liav A
db2701f2e2 Ports: Add libwebp
This library includes webp converter to other formats as well and could
be used as reference implementation for performance improvements.
2023-09-01 23:01:34 +02:00
Tim Ledbetter
64bb5652a1 find: Add the -newer, -anewer and -cnewer options
These return true if the last modification time, last access time or
creation time of a file is greater than the given reference file.

If the `-L` option is in use and the given reference file is a
symbolic link then the timestamp of the file pointed to by the
symbolic link will be used.
2023-09-01 21:19:22 +02:00