Commit Graph

53277 Commits

Author SHA1 Message Date
kleines Filmröllchen
d385adf6bd LibGUI: Don't silently create a 0 UIDimension when the JSON is invalid
The function already can report an invalid JSON value for the dimension,
so let's actually use that for when the number is too large or some
other invalid JSON type, like an object or a boolean, was passed.
2023-08-11 21:33:48 +02:00
kleines Filmröllchen
ea0ab87b88 LibGUI: Allow creating margins from arrays
This is necessary for upcoming GML -> C++ compilation.
2023-08-11 21:33:48 +02:00
Aliaksandr Kalenik
9101c8d079 LibWeb: Use available space to resolve table container width
Using avilable space directly while resolving table container width
allows to avoid assigning it to table wrapper box content width which
sometimes involves infinite (saturated) values.

Also this allows to get rid of set_max_content_width() which is a hack
that allows to bypass set_content_width() to assign infinite
(saturated) width to a box.

Closes https://github.com/SerenityOS/serenity/issues/19521
2023-08-11 19:36:19 +02:00
Liav A
fb60db7b00 Shell: Add builtin command to reset the internal state
The new builtin command "reset" now resets the entire internal state by
virtually destructing the Shell state and re-constructing it.

This helps for example when setting a new hostname and wanting to view
it in the current Shell program.
2023-08-11 18:48:53 +03:30
kleines Filmröllchen
489fce0ed2 Base: Document IPC syntax formally and informally 2023-08-11 08:31:46 -06:00
Liav A
73523cef2b Ports/tree: Update to version 2.1.1 2023-08-11 15:45:28 +02:00
kleines Filmröllchen
0b91d36a1e Toolchain: Build Clang with RISC-V support 2023-08-11 13:35:17 +02:00
kleines Filmröllchen
e21af23754 Toolchain: Provide the RISC-V 64 emulator with our QEMU build 2023-08-11 13:35:17 +02:00
Beckett Normington
ed0936065f Ports: Add xorriso port 2023-08-11 13:15:52 +02:00
Andi Gallo
a426263dee LibWeb: Remove 3 decimal places rounding hack in Length::percentage_of
CSSPixels uses fixed point now.
2023-08-11 11:00:27 +01:00
Lucas CHOLLET
f2c60b7716 LibGfx/JPEGXL: Support images encoded with the YCbCr color space
While being way less frequent than for classical JPEG images, JPEG XL
images can use the YCbCr color space. Supporting it makes us properly
decode the "The Smoke Machine" image on https://jpegxl.info/jxl-art.html
2023-08-11 10:30:48 +02:00
Andi Gallo
b34b80104f LibWeb: Fix buttons with TextNode label
Fixes #20472.
2023-08-11 10:02:27 +02:00
Gurkirat Singh
afb19a2cff Ports: Fix clean_dist function in .port_include.sh
A bug was introduced in commit #20413, where the `clean_dist` function
was missed from refactoring to the new "files" format.
2023-08-11 09:43:46 +02:00
Tim Ledbetter
5aa0be1a32 Ports/PrBoom+: Explicitly exclude optional dependencies
Previously, optional dependencies could be unintentionally included if
they were present on the host machine.
2023-08-11 09:36:41 +02:00
Sönke Holz
9522794a0e Toolchain: Add (basic) support for riscv64
This makes `ARCH=riscv64 Toolchain/BuildGNU.sh` work, but the patches
might not be completely correct.
2023-08-11 09:20:08 +02:00
Justin Brown
68924a8e81 Documentation: Update formatting on Ports package.sh example 2023-08-11 09:09:53 +02:00
Andrew Kaster
941a9846a3 Meta: Assume files already extracted for ENABLE_NETWORK_DOWNLOADS=OFF
This allows external meta build systems to extract a cached archive into
our Cache directory without having to also copy the .tar.gz file.
2023-08-10 20:10:05 -06:00
Andrew Kaster
68953f798b CMake: Add option to disable network downloads altogether
This is useful for fully offline builds, and some distribution platforms
2023-08-10 20:10:05 -06:00
Andrew Kaster
b046940679 CMake: Download Commonmark and Wasm spec tests using download_file()
This makes sure we have no bare file(DOWNLOAD) calls in the build
2023-08-10 20:10:05 -06:00
Andrew Kaster
92214b59ab CMake: Make sure to install generated sources and header files
We weren't installing a lot of generated sources for the top level Lagom
build or for LibWeb, making it impossible to use LibWeb from a
find_package. ...And also Kernel/API/KeyCode.h, which is included by
no less than 8 different files in Userland/Libraries. We also weren't
installing any Ladybird header files.
2023-08-10 20:10:05 -06:00
Andrew Kaster
79108f615d Ladybird: Add configuration option to build without Qt
This should open the door for adding more GUI chromes to the repository
2023-08-10 20:10:05 -06:00
Andrew Kaster
1d78e07f6b Meta: Promote SERENITY_CACHE_DIR to a real option
We've had it as a secret option for long enough, let's make it more
visible.
2023-08-10 20:10:05 -06:00
Lucas CHOLLET
7a5cd7e5f4 LibGfx/JPEGXL: Add support for LZ77 encoded stream
On top of the Brotli/ANS compression, the entropy stream can have
another compression layer, this time using LZ77. This patch adds support
for this last layer, which makes us decode the `lz77_flower` test. This
double-compression is also often used for ICC profiles.
2023-08-10 22:39:31 +02:00
Lucas CHOLLET
80cb377990 LibGfx/JPEGXL: Factorize the code to read symbols from distributions
This will soon be used by the LZ77 decoder, so let's avoid some
duplication.
2023-08-10 22:39:31 +02:00
Lucas CHOLLET
3fdc000b90 LibGfx/JPEGXL: Use a wider type for the context id
These numbers can be way bigger than 255, let's use a `u32` instead of a
`u8`, which is what other decoders do.
2023-08-10 22:39:31 +02:00
Lucas CHOLLET
07ea66528e LibGfx/JPEGXL: Make EntropyDecoder::read_config() static
This function will soon be used for the LZ77 decoder with a different
parameter than `m_log_alphabet_size`.
2023-08-10 22:39:31 +02:00
Andreas Kling
a0bceeb704 LibJS: Remove unused VM::destructuring_assignment_evaluation() 2023-08-10 16:36:18 +02:00
Andreas Kling
0ff9992ea1 LibJS: Remove now-unused mutable caches from AST nodes
The Identifier and TaggedTemplateLiteral AST nodes had caches that were
only used by the AST interpreter.
2023-08-10 16:36:18 +02:00
Andreas Kling
f49c5ca553 LibJS: Fix most clang-tidy warnings in AST.h
Mostly adding a bunch of move() to avoid ref-count churn.
2023-08-10 16:36:18 +02:00
Xexxa
8d17ede197 Base: Improve emoji
Remove unnecessary left/right padding

❣️ - U+2763 HEART EXCLAMATION
🚶 - U+1F6B6 PERSON WALKING
🚴 - U+1F6B4 PERSON BIKING
🌻 - U+1F33B SUNFLOWER
🪻 - U+1FABB HYACINTH
🍉 - U+1F349 WATERMELON
🍍 - U+1F34D PINEAPPLE
🫒 - U+1FAD2 OLIVE
🌽 - U+1F33D EAR OF CORN
🌯 - U+1F32F BURRITO
🍘 - U+1F358 RICE CRACKER
🧁 - U+1F9C1 CUPCAKE
🍫 - U+1F36B CHOCOLATE BAR
🍭 - U+1F36D LOLLIPOP
🍼 - U+1F37C BABY BOTTLE
🧋 - U+1F9CB BUBBLE TEA
🧃 - U+1F9C3 BEVERAGE BOX
🥢 - U+1F962 CHOPSTICKS
💈 - U+1F488 BARBER POLE
🌛 - U+1F31B FIRST QUARTER MOON FACE
🌜 - U+1F31C LAST QUARTER MOON FACE
🌡️ - U+1F321 THERMOMETER
🪐 - U+1FA90 RINGED PLANET
 - U+26A1 HIGH VOLTAGE
💧 - U+1F4A7 DROPLET
🧨 - U+1F9E8 FIRECRACKER
🥇 - U+1F947 1ST PLACE MEDAL
🥈 - U+1F948 2ND PLACE MEDAL
🥉 - U+1F949 3RD PLACE MEDAL
🏓 - U+1F3D3 PING PONG
🪀 - U+1FA80 YO-YO
♟️ - U+265F CHESS PAWN
🧦 - U+1F9E6 SOCKS
💄 - U+1F484 LIPSTICK
📱 - U+1F4F1 MOBILE PHONE
🔌 - U+1F50C ELECTRIC PLUG
💡 - U+1F4A1 LIGHT BULB
📍 - U+1F4CD ROUND PUSHPIN
🔩 - U+1F529 NUT AND BOLT
🪝 - U+1FA9D HOOK
🧪 - U+1F9EA TEST TUBE
🔭 - U+1F52D TELESCOPE
🩸 - U+1FA78 DROP OF BLOOD
💊 - U+1F48A PILL
🩹 - U+1FA79 ADHESIVE BANDAGE
🧼 - U+1F9FC SOAP
🪥 - U+1FAA5 TOOTHBRUSH
♀️ - U+2640 FEMALE SIGN
♂️ - U+2642 MALE SIGN
 - U+2795 PLUS
 - U+2797 DIVIDE
 - U+2753 RED QUESTION MARK
 - U+2754 WHITE QUESTION MARK
 - U+2755 WHITE EXCLAMATION MARK
 - U+2757 RED EXCLAMATION MARK
◼️ - U+25FC BLACK MEDIUM SQUARE
◻️ - U+25FB WHITE MEDIUM SQUARE
 - U+25FE BLACK MEDIUM-SMALL SQUARE
 - U+25FD WHITE MEDIUM-SMALL SQUARE
▪️ - U+25AA BLACK SMALL SQUARE
▫️ - U+25AB WHITE SMALL SQUARE
🚩 - U+1F6A9 TRIANGULAR FLAG
2023-08-10 07:52:36 -04:00
Xexxa
5b0b063d9b Base: Add emoji
🧑‍🌾 - U+1F9D1 U+200D U+1F33E FARMER
🏇 - U+1F3C7 HORSE RACING
🚵 - U+1F6B5 PERSON MOUNTAIN BIKING
🚵‍♂️ - U+1F6B5 U+200D U+2642 MAN MOUNTAIN BIKING
🚵‍♀️ - U+1F6B5 U+200D U+2640 WOMAN MOUNTAIN BIKING
🐺 - U+1F43A WOLF
🏟️ - U+1F3DF STADIUM
🏚️ - U+1F3DA DERELICT HOUSE
🏢 - U+1F3E2 OFFICE BUILDING
🏤 - U+1F3E4 POST OFFICE
🎠 - U+1F3A0 CAROUSEL HORSE
🚝 - U+1F69D MONORAIL
🚕 - U+1F695 TAXI
🏎️ - U+1F3CE RACING CAR
🧳 - U+1F9F3 LUGGAGE
🪁 - U+1FA81 KITE
👚 - U+1F45A WOMAN’S CLOTHES
🎒 - U+1F392 BACKPACK
🥾 - U+1F97E HIKING BOOT
🎻 - U+1F3BB VIOLIN
🎦 - U+1F3A6 CINEMA
2023-08-10 07:52:36 -04:00
Hendiadyoin1
ce188c9a9c LibWeb: Allow direct rouding of CSSPixelRects to CSSPixelRects
Preciously we were casting to float, round and cast back, which actually
might loose precision and was quite ugly.
2023-08-10 12:24:21 +02:00
Hendiadyoin1
17b4109ba9 LibGfx: Allow outside specilization of Rect::to_rounded 2023-08-10 12:24:21 +02:00
Andreas Kling
9e22f01eba LibWeb: Stub out SVGMaskElement
Just enough that we stop creating layout nodes for mask elements, which
was making some SVG content look very wrong. :^)
2023-08-10 11:36:17 +02:00
Gurkirat Singh
adf70b8a16 FileManager: Add "Copy Path" action to the context menus
Adding a feature to "Copy Path" of the selected entries to the
context menus of directory_view, tree_view and file_view which
copies the absolute path of the entry in the global clipboard.

It will change the label text "Copy Path" -> "Copy Paths" when
multiple entries are selected in the directory_view.
2023-08-10 09:17:26 +02:00
Luke Wilde
fb33514029 LibWeb: Support skew{X,Y} in stacking context transforms
https://drafts.csswg.org/css-transforms/#SkewDefined
2023-08-10 05:21:33 +02:00
Andi Gallo
34cd7f4c22 LibWeb: Verify that table cells have a paintable when collecting them
Replicate the more conservative way it's done for other nodes, for
which we verify whether they have a paintable before doing
painting-related operations with it.

Fixes crash on https://www.haiku-os.org/.
2023-08-10 05:14:40 +02:00
Andi Gallo
670bbf24e5 LibWeb: Check paintable of target against null in mousewheel handling 2023-08-10 05:13:02 +02:00
Luke Wilde
ae7a0c43a9 LibJS: Implement await properly for async functions
Fixes #20275

```
Summary:
    Diff Tests:
        +4     -4    

Diff Tests:
    test/built-ins/Array/fromAsync/non-iterable-input-with-thenable
    -async-mapped-awaits-callback-result-once.js  -> 
    test/language/expressions/await/async-await-interleaved.js  -> 
    test/language/expressions/await/await-awaits-thenables-that-
    throw.js  -> 
    test/language/expressions/await/await-awaits-thenables.js  -> 
```
2023-08-10 05:12:07 +02:00
Aliaksandr Kalenik
5003b1a421 LibWeb: Use automatic width to resolve min/max-width for inline boxes 2023-08-10 05:10:44 +02:00
Aliaksandr Kalenik
b34b0a1cd3 LibWeb: Use root content width as automatic width if children inline
Returning greatest_child_width() from automatic_content_width() in BFC
if root box children are inline and there are min/max-width that caused
width to be changed after IFC layout while content_width should be
always set to correct value by layout_inline_children() regardless of
layout mode.
2023-08-10 05:10:44 +02:00
Liav A
1f88109d78 Documentation/Kernel: Explain why and when to use FixedCharBuffers 2023-08-09 21:06:54 -06:00
Liav A
58b509584a Kernel: Allocate version string in the Process::initialize() method
Instead of allocating a KString on each uname syscall, just allocate
during boot so we never have to worry about heap allocation in that
syscall.
2023-08-09 21:06:54 -06:00
Liav A
d8b514873f Kernel: Use FixedStringBuffer for fixed-length strings in syscalls
Using the kernel stack is preferable, especially when the examined
strings should be limited to a reasonable length.

This is a small improvement, because if we don't actually move these
strings then we don't need to own heap allocations for them during the
syscall handler function scope.

In addition to that, some kernel strings are known to be limited, like
the hostname string, for these strings we also can use FixedStringBuffer
to store and copy to and from these buffers, without using any heap
allocations at all.
2023-08-09 21:06:54 -06:00
Liav A
3fd4997fc2 Kernel: Don't allocate memory for names of processes and threads
Instead, use the FixedCharBuffer class to ensure we always use a static
buffer storage for these names. This ensures that if a Process or a
Thread were created, there's a guarantee that setting a new name will
never fail, as only copying of strings should be done to that static
storage.

The limits which are set are 32 characters for processes' names and 64
characters for thread names - this is because threads' names could be
more verbose than processes' names.
2023-08-09 21:06:54 -06:00
Liav A
0d30f558f4 AK+Kernel: Add the FixedStringBuffer class and StdLib functions for it
This class encapsulates a fixed Array with compile-time size definition
for storing ASCII characters.

There are also new Kernel StdLib functions to copy user data into such
objects so this class will be useful later on.
2023-08-09 21:06:54 -06:00
Liav A
3b09560251 Kernel/Memory: Split the MemoryManager.h file from user address checks 2023-08-09 21:06:54 -06:00
Luke Wilde
7550b4175e LibWeb: Unregister IntersectionObserver in finalize, not the destructor
Otherwise it UAFs the intersection root. Not sure how this didn't cause
a lot of crashes!
2023-08-09 22:12:54 -04:00
Luke Wilde
5694981352 LibWeb: Implement Element.hasAttributeNS
Particularly needed by xkcd's Right Click comic. https://xkcd.com/1975/
2023-08-09 22:10:58 -04:00
Tim Ledbetter
3a98c48f20 Ports/SDL2: Avoid accumulation errors in resampler
This adds a patch to the SDL2 port to fix a segfault which occurs in
the resampler.

Taken from this upstream commit:
https://github.com/libsdl-org/SDL/commit/78f9710

This fixes a crash we were seeing in the julius port.
2023-08-10 02:45:01 +02:00