Commit graph

31289 commits

Author SHA1 Message Date
Andreas Kling ad7e6878fe LibWeb: Allocate CSS::ComputedValues objects on the heap
This makes them cheap to move around, since we can store them in a
NonnullOwnPtr instead of memcopying 2584(!) bytes.

Drastically reduces the chance of stack overflow while building the
layout tree for deeply nested DOMs (since tree building was putting
these things on the stack).

This change also exposed a completely unnecessary ComputedValues deep
copy in block layout.
2024-01-27 12:27:44 +01:00
Nico Weber d89e42902e LibGfx/JPEGLoader: Extract inverse_dct_8x8() function
No behavior change.
2024-01-27 10:21:33 +00:00
Nico Weber 494fc1234e LibGfx/JPEGWriter: Rename y<=>x, u<=>v
Usually x and u go horizontally and y and v go vertically.

No behavior change.
2024-01-27 10:20:56 +00:00
Sam Atkins e025bcc4f9 LibWeb: Make use of transform-box when calculating transforms
We don't currently calculate the fill- or stroke-boxes of SVG elements,
so for now we use the content- and border-boxes respectively, as those
are the closest equivalents. The test will need updating when we do
support them.

Also, the test is a screenshot because of rendering differences when
applying transforms: a 20px box does not get painted the same as a 10px
box scaled up 2x. Otherwise that would be the more ideal form of test.
2024-01-27 07:46:37 +01:00
Sam Atkins 391cfdc085 LibWeb: Parse the CSS transform-box property 2024-01-27 07:46:37 +01:00
Nico Weber c3c7707de4 LibGfx/JPEGWriter: Don't throw away highest-frequency component in FDCT 2024-01-26 20:19:55 -05:00
Timothy Flynn 83d2f59e2a LibWebView: Port the CookieJar to String 2024-01-26 20:22:39 +01:00
Timothy Flynn 30fae8fa1d LibSQL: Allow constructing SQL values from a String
LibSQL still uses ByteString internally for storage, but to help outside
application port to String, add helpers to construct values from String
and to convert a value to a String.
2024-01-26 20:22:39 +01:00
Timothy Flynn c4820838bf LibWeb+WebContent: Port the did_request_named_cookie IPC to String 2024-01-26 20:22:39 +01:00
Timothy Flynn 9b957ead13 LibWebView+WebContent: Do not manually serialize cookie sources over IPC
LibIPC can serialize enumeration automatically (this was not the case
when these IPCs were added).
2024-01-26 20:22:39 +01:00
Timothy Flynn 85b8971a80 Ladybird+LibWeb+WebContent: Port the did_request_cookie IPC to String 2024-01-26 20:22:39 +01:00
Timothy Flynn dcd9962d7b Browser: Remove some needless indirection from Cookie-related IPCs
We don't need to forward Cookie-related IPCs from the WebView through
the Tab to the BrowserWindow. We can skip the Tab like we do in other
chromes.

This is primarily to reduce overhead when changing Cookie IPCs in future
patches.
2024-01-26 20:22:39 +01:00
Timothy Flynn 8ea4e37c27 LibWebView: Convert trivial ByteString uses to StringView in CookieJar 2024-01-26 20:22:39 +01:00
Nico Weber db4982bd29 LibGfx+image: Implement writing ICC profiles to jpeg files 2024-01-26 14:03:20 -05:00
Nico Weber 83ab9f7c2d LibGfx/PNM: Remove unnecessary line
This is already done at the caller decode() in
PortableImageLoaderCommon.h, as pointed out by @LucasChollet at
https://github.com/SerenityOS/serenity/pull/22935#discussion_r1467158789

No behavior change.
2024-01-26 14:53:33 +01:00
Nico Weber c431cf4907 LibGfx: Add comparison operators to CMYK 2024-01-26 07:36:53 +01:00
Nico Weber 556addc5cb LibGFX/PAM: Allow reading CMYK .pam files
These are written by `mutool extract` for CMYK images.

They don't contain color profiles so they're not super convenient.
But `image` can convert them (*) to sRGB as long as you use it with
`--assign-color-profile` pointing to some CMYK icc profile of your
choice.

*: Once #22922 is merged.
2024-01-26 07:36:53 +01:00
Nico Weber 187862ebe0 LibGfx: Add a .pam loader
.pam is a "portrable arbitrarymap" as documented at
https://netpbm.sourceforge.net/doc/pam.html

It's very similar to .pbm, .pgm, and .ppm, so this uses the
PortableImageMapLoader framework. The header is slightly different,
so this has a custom header parsing function.

Also, .pam only exixts in binary form, so the ascii form support
becomes optional.
2024-01-26 07:36:53 +01:00
Aliaksandr Kalenik 0d76a9da17 LibWeb: Resolve text-decoration-thickness during layout commit
Refactoring towards stop resolving CSS lengths during paintable
commands recording.
2024-01-26 07:36:40 +01:00
Aliaksandr Kalenik d5e3158cfe LibWeb: Use PaintableFragment::baseline() in paint_text_decoration()
No need to calculate baseline based on glyph height when we can get
this information from a fragment.
2024-01-26 07:36:40 +01:00
Aliaksandr Kalenik 1c4ce2c5f1 LibWeb: Don't check containing block of fragments in hit testing
We do not rely on existence of containing block in
`PaintableWithLines::hit_test()` so it should be safe to remove this
check.
2024-01-26 07:36:40 +01:00
Aliaksandr Kalenik 270bbf43ab LibWeb: Remove is<BlockContainer> check for fragments in hit testing
This change introduces a method for direct access to the paintable of
a PaintableFragment. This method is intended to replace the usage of
the layout node pointer. Currently, we are only eliminating the use
of `layout_node()` in hit testing.

Additionally, we no longer check if a fragment's layout node is a
`BlockContainer` before recursing into its children during hit testing.
This check was likely relevant when all fragments were owned by
`PaintableWithLines`, but now it should be safe to remove this check.
2024-01-26 07:36:40 +01:00
Timothy Flynn 09124fc3a5 LibWeb: Set up the Fetch response's body with the appropriate stream 2024-01-25 21:34:03 +01:00
Aliaksandr Kalenik a319037706 LibWeb: Remove SetFont painting command
It was only used in ImagePaintable for alt text and now it is replaced
by saving font inside DrawText command.
2024-01-25 21:33:54 +01:00
Andrew Kaster d85a0e306a headless-browser: Add option to filter which tests are run with a glob
This is the same feature that run-tests has on Serenity.
2024-01-25 09:44:42 -07:00
Nico Weber fac48fdda4 image: Allow converting CMYK inputs to RGB
This worked in PDFs for a while, but now `image` can also do
CMYK->RGB conversions that actually use color profiles :^)
2024-01-25 15:53:44 +01:00
Nico Weber 88b49a639e LibGfx/ICC: Add a convert_cmyk_image() method
It converts from a CMYKBitmap to an (rgb) bitmap, using a real
color profile.

The API design here isn't super scalable (what if we want to also
handle grayscale inputs? What if we also want to convert _to_ cmyk
or grayscale?), but we have to start somewhere. Uses of this can
inform future API improvements.
2024-01-25 15:53:44 +01:00
Nico Weber 11b623b1fd LibGfx: Add data_size() accessors to Bitmap and CMYKBitmap
These return the size of the data in bytes.
2024-01-25 15:53:44 +01:00
Nico Weber 0acc370f7b image: Load images that contain CMYK data into a CMYKBitmap
Every single of images's functions then go ahead and error out on
CMYKBitmaps for now.

(Alternatively, we could make them the low-quality CMYK->RGB
conversion that previously happened implicitly, but let's go
with this for now.)

(With this structure, we could also do something smarter for
Vector images in the future.)

Here's how this looks:

    % Build/lagom/bin/image \
        -o out.png Tests/LibGfx/test-inputs/jpg/ycck-2111.jpg
    Runtime error: Can't save CMYK bitmaps yet, convert to RGB first
                   with --convert-to-color-profile

    % Build/lagom/bin/image \
        --convert-to-color-profile serenity-sRGB.icc \
        -o out.png Tests/LibGfx/test-inputs/jpg/ycck-2111.jpg
    Runtime error: No source color space embedded in image.
                   Pass one with --assign-color-profile.

    % Build/lagom/bin/image \
        --assign-color-profile path/to/CMYK/USWebCoatedSWOP.icc \
        --convert-to-color-profile serenity-sRGB.icc \
        -o out.png Tests/LibGfx/test-inputs/jpg/ycck-2111.jpg
    Runtime error: Psych, can't convert CMYK bitmaps yet either

As usual, serenity-sRGB.icc is from
`Build/lagom/bin/icc  -n sRGB --reencode-to serenity-sRGB.icc` and
the adobe cmyk profiles are available at
https://www.adobe.com/support/downloads/iccprofiles/iccprofiles_win.html
which ultimately leads to:
https://download.adobe.com/pub/adobe/iccprofiles/win/AdobeICCProfilesCS4Win_end-user.zip
2024-01-25 15:53:44 +01:00
Nico Weber c6eac16d00 LibGfx: Remove unused parameter from cmyk_frame() 2024-01-25 15:53:44 +01:00
Nico Weber 2c40886851 image: Update an error string
We have been able to write .jpg files for a while now.
2024-01-25 15:53:44 +01:00
Nico Weber 8a56abf48b image: Move image writers up that don't return bytes
Makes the early returns a bit easier to see.

Also alphabetize them while touching these lines.

No behavior change.
2024-01-25 15:53:44 +01:00
Nico Weber 96c71b7042 image: Move image loading code into a separate function
Haters will say this is overkill, but this function will do a bit more
once we allow loading CMYK data.

No behavior change.
2024-01-25 15:53:44 +01:00
Nico Weber 653b614611 image: Move image saving code into helper function
No behavior change.
2024-01-25 15:53:44 +01:00
Nico Weber 0681df7f3b image: Move profile conversion code into helper function
No behavior change.
2024-01-25 15:53:44 +01:00
Nico Weber 48a0fb1e8e image: Introduce a struct "LoadedImage" to hold bitmap and icc data
This makes it easier to move the color space conversion code out
into a helper function, and will be used to pass around CMYK bitmaps.

No behavior change.
2024-01-25 15:53:44 +01:00
Nico Weber a339f297d1 image: Move image modification code to helper functions
No behavior change.
2024-01-25 15:53:44 +01:00
Nico Weber da243ebb8b image: Use Error::from_string_view() for errors
...instead of warn() + manual return.

Before:

    % Build/lagom/bin/image -o out.asdf in.png
    can only write .bmp, .png, .ppm, and .qoi

Now:

    % Build/lagom/bin/image -o out.asdf in.png
    Runtime error: can only write .bmp, .png, .ppm, and .qoi

That doesn't look worse, and it's less code (and makes moving the
code into helper functions easier).
2024-01-25 15:53:44 +01:00
Aliaksandr Kalenik c02820759b LibWeb: Test nested elements in InlinePaintable::hit_test()
Before this change we were ignoring nested paintables inside inline
paintable during hit-testing, but now we recurse into subtree.

Fixes https://github.com/SerenityOS/serenity/issues/22927
2024-01-25 15:53:18 +01:00
Andreas Kling 1583e6ce07 LibWeb: Clamp justification space between flex items to 0
Before this change, it was possible for flex lines with negative
remaining space (due to overflowing items) to put a negative amount
of space between items for some values of `justify-content`.

This makes https://polar.sh/SerenityOS look much better :^)
2024-01-25 15:10:21 +01:00
Sam Atkins 7bcb560060 uptime: Add -s/--since option to output only when the system came online
This also matches Linux and the BSDs.
2024-01-25 09:07:32 +01:00
Sam Atkins 8faeb13036 uptime: Bring output closer to Linux/BSDs, and add -p flag
The -p flag is equivalent to the previous behavior: outputting the
uptime in a human-readable form.

We don't seem to expose the number of online users or the load averages,
so those sections are missing from the output compared to those OSes.
2024-01-25 09:07:32 +01:00
Sam Atkins 388856dc7e AK+Userland: Return String from human_readable_size() functions 2024-01-25 09:07:32 +01:00
Sam Atkins 7e8cfb60eb AK+Userland: Return String from human_readable_[digital_]time() 2024-01-25 09:07:32 +01:00
Andreas Kling b12541b286 LibWeb: Add SVGSVGElement.viewBox attribute
This attribute has some compatbility issues...
- The spec says it should be an SVGAnimatedRect which contains
  a DOMRect and a DOMReadOnlyRect.
- Blink gives you an SVGAnimatedRect with 2x SVGRect
- Gecko gives you an SVGAnimatedRect with 2x SVGRect? (nullable)

I ended up with something similar to Gecko, an SVGAnimatedRect
with 2x DOMRect? (nullable)

With this fixed, we can now load https://polar.sh/ :^)
2024-01-25 08:23:41 +01:00
Timothy Flynn 2fd034d1df LibWebView: Prevent quoting attribute values twice in the Inspector
As of commit ccd701809f, the formatter for
JsonValue now fully serializes the value. The serializer will surround
the string value with quotes. We want control over when we add quotes to
the generated Inspector HTML, so avoid formatting attributes as raw JSON
values.
2024-01-25 08:22:24 +01:00
Dan Klishch 982799f7a0 LibC+LibELF: Pass information from linker via magic lookup
This works by defining a set of weak symbols in dynamic linker whose
value would be provided by it. This has the same effect as preloading
library that magically knows right addresses of functions shared between
dynamic linker and LibC.

We were previously passing the same information by rewriting values
based on hardcoded library name, so the new approach seems a little
nicer to me.
2024-01-24 22:17:49 -07:00
Lucas CHOLLET a17041fe7f LibGfx/TIFF: Add support for CMYK
The test case has been generated with Krita.
2024-01-24 22:16:22 -07:00
Lucas CHOLLET 984272d83e LibGfx/TIFF: Put manage_extra_channels in its own function 2024-01-24 22:16:22 -07:00
Lucas CHOLLET 3f4bf7a0c7 LibGfx/ExifOrientedBitmap: Add support for CMYKBitmap 2024-01-24 22:16:22 -07:00
Lucas CHOLLET c80b2cf782 LibGfx/ExifOrientedBitmap: Use scanline instead of set_pixel()
The former has the advantage to be available in CMYKBitmap too.

No behavior change.
2024-01-24 22:16:22 -07:00
Lucas CHOLLET 8229a19081 LibGfx/ExifOrientedBitmap: Reorganize create parameters
No behavior change.
2024-01-24 22:16:22 -07:00
Lucas CHOLLET 09b2b3539b LibGfx/JPEG+CMYKBitmap: Extract the CMYK to RGB conversion code
Right now, the JPEG decoder is the only one supporting CMYK, but that
won't last for long. So, let's move the conversion to CMYKBitmap.
2024-01-24 22:16:22 -07:00
Lucas CHOLLET 0462858247 LibGfx/JPEG: Keep the original CMYK data in memory
When decoding a CMYK image and asked for a normal `frame()`, the decoder
would convert the CMYK bitmap into an RGB bitmap. Calling `cmyk_frame()`
after that point will provoke a null-dereference.
2024-01-24 22:16:22 -07:00
Aliaksandr Kalenik 980b61470c LibAccelGfx+LibWeb+WebContent: Handle OpenGL Context init errors
Now, if OpenGL context fails, an error will be returned and a message
printed, instead of crashing.
2024-01-24 19:43:51 +01:00
Sam Atkins 315c95a1ce HackStudio: Replace custom recent-project management with the LibGUI one
The only downside is we are limited to 4 recent projects now. LibGUI
currently relies on the number of recent files being constexpr, so that
will take some more work to make it variable.
2024-01-24 11:07:03 +00:00
Sam Atkins 343de324db LibGUI: Don't update the recent files if we haven't created them yet
We previously assumed that `set_most_recently_open_file()` would only be
called after `Menu::add_recent_files_list()` had been called, and would
crash if we hadn't called it yet. This stops the crash. We're fine to
do this, because we always call `update_recent_file_actions()` in
`register_recent_file_actions()` so it's guaranteed to be up to date
when we do need it.
2024-01-24 11:07:03 +00:00
Sam Atkins f8fe6d11b2 LibGUI: Allow creating a recent-files list without a trailing separator
This is useful in situations where we want this list in a submenu.
2024-01-24 11:07:03 +00:00
Sam Atkins 9657f4cabb LibGUI+Userland: Take ByteString in set_most_recently_open_file() 2024-01-24 11:07:03 +00:00
Sam Atkins d30f13a88d HackStudio: Jump to file location when choosing a Locator suggestion
A couple of tweaks here to make it work better:
- Call `set_cursor_and_focus_line()` to make the Editor scroll to the
  symbol's location.
- Remove focus from the Locator's text box so your cursor jumps to the
  Editor instead of staying in the Locator.
2024-01-24 11:05:54 +00:00
Sam Atkins 9322f0d110 HackStudio: Use Autocomplete window type for Locator pop-up
This being a Popup window meant it behaved in a couple of janky ways:
- It would steal the focus each time it was shown, so after every key
  press in the TextBox.
- It would disappear when you focused that TextBox again.

Using the Autocomplete window type fixes both of these. While the
Locator is not technically an autocomplete, it shares the general "type
and get suggestions based on the input, which you can select" behavior,
so this is close enough.
2024-01-24 11:05:54 +00:00
Andreas Kling b84056c05b LibWeb: Add missing visits in MessageEvent
Also change a Vector<Handle> to a Vector<NonnullGCPtr> while we're
here, since there's no need to use handles for members of a cell.

Fixes an ASAN error on the HTML/Window-postMessage.html test.
2024-01-24 10:52:02 +01:00
Andreas Kling 413eb19579 LibWeb: Skip UTF-8 validation in Node::descendant_text_content()
Since we're just concatenating a bunch of strings that are already
UTF-8, we don't need to check that the result is also UTF-8.
2024-01-24 07:55:13 +01:00
Andreas Kling 7fedf806c2 LibWeb: Cache pointer to UsedValues for each FlexItem
This avoids expensive repeated LayoutState hash lookups.
2024-01-24 07:53:33 +01:00
Andreas Kling 4e6de47f93 LibWeb: Avoid LayoutState hash lookups in more parts of float layout 2024-01-24 07:53:16 +01:00
stelar7 423e77d5c3 LibWeb: Implement import_key for PBKDF2
Co-Authored-By: Andrew Kaster <akaster@serenityos.org>
2024-01-23 14:07:06 -07:00
Andrew Kaster 7bc7e2a48f LibWeb: Convert SubtleCrypto::digest to use WebIDL Promises
We should be using WebIDL Promise in these methods, per the spec
references in other specifications. That is, the HTML spec always links
to WebIDL when it talks about `Promise<T>`. The Crypto seems to be
missing those cross-references.

While we're here, actually resolve the digest promise in parallel.
2024-01-23 14:07:06 -07:00
stelar7 3e0c0ce7ae LibWeb: Move dictionaries to separate file
Co-Authored-By: Andrew Kaster <akaster@serenityos.org>
2024-01-23 14:07:06 -07:00
stelar7 1bf73482f5 LibWeb: Add using statement for simpler type names 2024-01-23 14:07:06 -07:00
stelar7 0afea792e2 LibWeb: Move dictionaries to the Bindings namespace 2024-01-23 14:07:06 -07:00
stelar7 a8ddf6c2a4 LibWeb: Add the CryptoKey interface 2024-01-23 14:07:06 -07:00
Mr.UNIX 69ffdd5738 Welcome: Port to GML Compiler 2024-01-23 21:14:12 +01:00
Aliaksandr Kalenik 91ef4fed93 LibWeb: Resolve all layout-dependent properties in one loop
Instead of using separate loops for each property, all the work can
be completed in one loop.

Performance improvement on https://html.spec.whatwg.org/
2024-01-23 21:06:02 +01:00
Aliaksandr Kalenik b9bbe4c166 LibWeb: Remove unnecessary layout tree disconnection during teardown
This code appears to be leftover from times when layout and paintable
trees were not GC-allocated.
2024-01-23 18:48:51 +01:00
Tim Ledbetter 7a3fc621bd LibWeb: Remove invalid assertion in table fixup
Previously, our code for the fixup of table rows assumed that missing
cells in a table row must be sequential. This may not be true if the
table contains cells have a rowspan greater than one.
2024-01-23 10:17:00 +01:00
kleines Filmröllchen 3f0a77e788 disasm: Allow disassembling just one symbol
This is done in a crude way for now in that we
disassemble all instructions up to the symbol without printing them.
2024-01-22 20:54:16 -07:00
kleines Filmröllchen 10a1b0de96 disasm: Overhaul symbol printing
We now split up symbols into zero-sized symbols that label single
instructions (no need to separate them by newlines; they are used for
jump labels and relocation targets within a larger block of code) and
ranged symbols that label functions. Empty symbols are discarded since
at least RISC-V ELF files contain quite a few of those. Zero-sized
symbols and ranged symbols are handled almost the same, but this way we
can make sure that zero-sized symbols don't interfere with ranged
symbol's newline separation logic. For zero-sized symbols, the "symbol
contains address" logic is updated so they actually contain the one
address they're pointing at, fixing the bug with many "dangling"
zero-sized symbols after a function that contained them. Zero-sized
labels are also no longer printed as a start-end range, since that is
unnecessary visual noise.
2024-01-22 20:54:16 -07:00
Lucas CHOLLET 5dfa660a94 LibGfx/TIFF: Add support for Float and Double types
We previously were considering Float and Doubles as non-supported types.
But this was done in a sneaky way, by letting them hit the default case
in the `read_type` method. So, when I ported this function to the
generator we started to make this types flow into the system without a
proper support there. Since 3124c161, we would have crashes on images
containing tags with a floating point value.
2024-01-22 20:50:06 -07:00
Lucas CHOLLET 6eb574a2b6 LibGfx/JPEG: Expose the Exif metadata
The Exif metadata is contained in the APP1 segment. We only need to
call the TIFF decoder to get the metadata back :^).
2024-01-22 20:16:32 -07:00
Lucas CHOLLET f6f647bf13 LibGfx/TIFF: Add an alternative entry point to only request metadata
A lot of images format use Exif to store there metadata. As Exif is
based on the TIFF structure, the TIFF decoder can, without modification
be able to decode the metadata. We only need a new API to explicitly
mention that we only need the metadata.
2024-01-22 20:16:32 -07:00
Lucas CHOLLET 12c38035db LibGfx/TIFF: Rename JPEG to OldJPEG and introduce a new JPEG tag
Support for JPEGs embedded in TIFF images was introduced with TIFF 6.0.
However, this implementation had major issues. It was so problematic
that they decided to reimplement it from scratch in 1995, three years
later. The two incarnations are obviously incompatible.

For more details see:
https://www.awaresystems.be/imaging/tiff/specification/TIFFTechNote2.txt
2024-01-22 20:13:53 -07:00
Lucas CHOLLET 1faf9bb44f LibGfx/TIFF: Apply the HorizontalDifferencing on the alpha channel
When present, the alpha channel is also affected by the horizontal
differencing predictor.

The test case was generated with GIMP with the following steps:
 - Open an RGB image
 - Add a transparency layer
 - Export as TIFF with the LZW compression scheme
2024-01-22 20:10:48 -07:00
Tom Finet 900ec37f81 LibC: Separate arch dependent fenv functions
Remove all functions with platform #if's from fenv, and
add arch dependent implementations instead. The build
system now selects the implementation based on the platform.
2024-01-22 20:06:09 -07:00
Nico Weber 9a207da368 LibGfx/ICC: Fix small mistake from #22700
Doesn't matter if both profiles are sRGB since
inv(A) * A == A * inv(A), but when converting e.g. a P3 image to
sRGB, the colors are very off if the matrices are the wrong way round
here.
2024-01-22 22:21:46 +00:00
Andreas Kling 8d0344a636 LibJS: Avoid unnecessary MarkedVector in Bytecode::Op::Call::execute()
perform_call() wants a ReadonlySpan<Value>, so just grab a slice of the
current register window instead of making a MarkedVector.

10% speed-up on this function call microbenchmark:

    function callee(a, b, c) { }

    function caller(callee) {
        for (let i = 0; i < 10_000_000; ++i)
            callee(1, 2, 3)
    }

    caller(callee)
2024-01-22 23:05:16 +01:00
Edward Banner 791b0eb709 Shell: Use reverse iterators for history events
Replaces the custom find_reverse() function used for searching backwards
through string-based history events with reverse iterators + find_if()
2024-01-23 01:31:25 +03:30
Timothy Flynn aa0a6d58b2 Userland: Remove LibCore dependency from libraries that do not use it 2024-01-22 08:48:34 -05:00
Aliaksandr Kalenik 1294cfb55c LibWeb: Find font that has whitespace glyph in first_available_font()
Fixes https://github.com/SerenityOS/serenity/issues/22853
2024-01-22 14:14:59 +01:00
MacDue 9f710b0fb6 Revert "LibGfx: Slightly simplify Color::blend()"
This was producing incorrect results.

This reverts commit a1bafafd78.
2024-01-22 07:12:25 +01:00
Kemal Zebari 1d43bfc598 base64: Implement -w/--wrap
This is an option supported by coreutils, so we might as well support
it too.

It allows users to wrap their encoded output after the "column" value
they provide.

This commit also has the Markdown look more like what we see
when running ArgsParser::print_usage_markdown() (and it fixes some
of the examples).
2024-01-21 21:54:51 -05:00
Dan Klishch b5f1a48a7c AK+Everywhere: Remove JsonValue APIs with implicit default values 2024-01-21 15:47:53 -07:00
Dan Klishch 5230d2af91 AK+WebContent: Remove JsonValue::as_{i,u}{32,64}() 2024-01-21 15:47:53 -07:00
Dan Klishch 0388c828be LibGUI: Remove GUI::Variant::Variant(JsonValue const&)
Let's force callers of Variant constructor to know the type of the
object they are constructing.
2024-01-21 15:47:53 -07:00
Dan Klishch 77f36a9e46 LibJS: Remove redundant use of JsonValue::{is,as}_i32()
Value::Value(double) already converts double to int when it is safe, no
need to check for this here explicitly. While this technically removes
an optimization, I doubt that it will regress performance in any
measurable way.
2024-01-21 15:47:53 -07:00
Ali Mohammad Pur a2f7849238 LibHTTP: Ensure the ending \r\n is present before trying to read a line
Fixes #22838.
2024-01-21 21:13:58 +01:00
Ali Mohammad Pur 4f6c9f410c AK+LibCore: Add BufferedSocket::can_read_up_to_delimiter()
This method (unlike can_read_line) ensures that the delimiter is present
in the buffer, and doesn't return true after eof when the delimiter is
absent.
2024-01-21 21:13:58 +01:00
Andreas Kling 1a07205c33 LibJS: Don't reserve space in function environment for parameter locals
3% speed-up on Octane/typescript.js (but basically improves performance
on most JS.)
2024-01-21 21:03:59 +01:00
Andreas Kling bed78eb3cc LibJS: Don't add uncaptured parameter bindings to environment
For parameters that exist strictly as "locals", we can save time and
space by not adding them to the function environment.

This is a speed-up across the board on basically every test.
For example, ~11% on Octane/typescript.js :^)
2024-01-21 21:03:59 +01:00
Aliaksandr Kalenik 7e2308d290 LibWeb: Treat null as empty string in CSSStyleDeclaration::internal_set
Spec defines `[LegacyNullToEmptyString]` on `value` argument of
`setProperty` but since `internal_set` calls `setProperty` directly
instead of using IDL generated binding, we need to make sure that null
is treated as empty string.

Fixes items grid loading on https://d.rsms.me/stuff/
2024-01-21 21:03:39 +01:00
MacDue e9e1ee11d4 LibGfx: Decrease flatness a little in Path::stroke_to_fill()
Noticed larger stroke widths were looking a little 'low poly', this
looks a little nicer.

(Minor LibWeb test changes)
2024-01-21 19:23:31 +01:00