Commit graph

58408 commits

Author SHA1 Message Date
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
Fabian Dellwing
e8b5055349 Ports: Update zlib to 1.3.1 2024-01-23 18:31:00 +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
Tim Schumacher
5d9fa2b9a9 Meta: Use BXSHARE instead of a hardcoded Bochs directory
This allows using Bochs instances that are installed in non-standard
directories.
2024-01-22 20:18:38 -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
Sönke Holz
0e6d87fe83 Kernel/riscv64: Don't disable stack protector and sanitizers
I am not sure why 096cecb95e disabled the stack protector and sanitizers
for all files, but this is not necessary.
Only the pre_init code needs to run without them, as that code runs
identity mapped.
2024-01-22 20:07:36 -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
dependabot[bot]
f1347bc4e0 CI: Bump actions/cache from 3 to 4
Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-22 09:02:37 -05:00
Timothy Flynn
aa0a6d58b2 Userland: Remove LibCore dependency from libraries that do not use it 2024-01-22 08:48:34 -05:00
Timothy Flynn
5945cdc054 Ladybird+Meta: Extract AK into its own library on Lagom
We currently bundle AK with LibCore on Lagom. This means that to use AK,
all libraries must also depend on LibCore. This will create circular
dependencies when we create LibURL, as LibURL will depend on LibUnicode,
which will depend on LibCore, which will depend on LibURL.
2024-01-22 08:48:34 -05:00
Timothy Flynn
1e7b06aa11 Meta: Add a helper to create a Lagom utility
This helper can automatically link against libraries needed by all
utilities, such as LibCore. This is to make extracting AK into its own
library a bit easier.
2024-01-22 08:48:34 -05:00
Timothy Flynn
b81a6cfe1d Meta: Port recent changes to the GN build
d125d16287
60c3a1a77b
4364a28d3d
271c9d1ae9
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
Cubic Love
6685e4cb61 Base: Improve ColorLines Icons
The previous icons were downsampled games assets.
The new 32px and 16px application icons are purposefully crafted pixel
art for improved sharpness.
2024-01-22 09:20:54 +00:00
Cubic Love
0f59579d91 Base: Improve ColorLines manpage
Co-authored-by: spraines <spraines@umich.edu>
2024-01-22 09:20:54 +00: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
Andrew Kaster
333454456b Meta: Add Dan Klishch to the contributors list :^) 2024-01-21 16:19:39 -07:00
Dan Klishch
870a947040 AK: Remove StringInternals.h
Since we do not expose memory layout anymore in StringBase, there is no
need to keep StringData public.
2024-01-21 16:16:15 -07:00
Dan Klishch
611adf1591 AK: Make the state of StringBase private
Now it actually only exposes methods to allocate uninitialized storage
and to create substring with a shared superstring. All the details of
the memory layout are fully encapsulated.
2024-01-21 16:16:15 -07:00
Dan Klishch
fa52f68142 AK: Store data in FlyString as StringBase
Unfortunately, it is not clear to me how to split this commit into
several atomic ones.
2024-01-21 16:16:15 -07:00
Dan Klishch
e7700e16ee AK: Forward substring creation with shared superstring to StringBase 2024-01-21 16:16:15 -07:00
Dan Klishch
5d6cd65e29 AK: Simplify String::repeated by leveraging StringBase helpers 2024-01-21 16:16:15 -07:00
Dan Klishch
7dbe357e9f AK: Simplify String::from_stream by leveraging StringBase helpers 2024-01-21 16:16:15 -07:00
Dan Klishch
7506736869 AK: Stop using ShortString in String::from_code_point
Refactor it to use StringBase::replace_with_new_short_string instead.
2024-01-21 16:16:15 -07:00
Dan Klishch
dcd1fda9c8 AK: Introduce StringBase::replace_with_new_{short_,}string 2024-01-21 16:16:15 -07:00
Dan Klishch
d6290c4684 AK: Move String::hash() and String::String() to StringBase 2024-01-21 16:16:15 -07:00
Dan Klishch
1b09a1851e AK: Move String::~String() and String::destroy_string() to StringBase 2024-01-21 16:16:15 -07:00
Dan Klishch
54d149bc25 AK: Move String::bytes() and String::operator==(String) to StringBase
The idea is to eventually get rid of protected state in StringBase. To
do this, we first need to remove all references to m_data and
m_short_string from String.
2024-01-21 16:16:15 -07:00
Dan Klishch
4364a28d3d AK: Move data fields from AK::String to a newly created AK::StringBase
This starts separating memory management of string data and string
utilities like `String::formatted`. This would also allow to reuse the
same storage in `DeprecatedString` in the future.
2024-01-21 16:16:15 -07:00
Dan Klishch
6e2f627cb3 AK: Move StringData from String.cpp to a newly created StringInternals.h
This is done to allow using it in files other than AK/String.cpp.
2024-01-21 16:16:15 -07:00
Dan Klishch
855ea192be AK: Add AK_MAKE_DEFAULT_COPYABLE 2024-01-21 16:16:15 -07:00
Dan Klishch
7f8d69ee2f AK: Remove explicit String::operator!= in favor of defaulted one 2024-01-21 16:16:15 -07:00
Dan Klishch
b5f1a48a7c AK+Everywhere: Remove JsonValue APIs with implicit default values 2024-01-21 15:47:53 -07:00
Dan Klishch
c49819cced AK+GMLCompiler+LibWeb: Remove JsonValue::is_double
This concludes a series of patches which remove the ability to observe
which arithmetic type is used to store number in JsonValue.
2024-01-21 15:47:53 -07:00
Dan Klishch
faef802229 AK+GMLCompiler: Remove JsonValue::as_double()
Replace its single (non-test) usage with newly created as_number(),
which does not leak information about internal integer storage type.
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
Dan Klishch
b74df136fe JSSpecCompiler: Always treat trailing MemberAccess as punctuation
Due to the way expression parser is written, we need to resolve the
ambiguity between member access operators and dots used for punctuation
during lexing. The lexer uses a (totally bulletproof) heuristic to do
that: whenever '.' is followed by ' ' or '\n', it is considered a dot
and member access otherwise. While it works fine for prettified test
cases, non-prettified files often lack enter after a trailing dot
character. Since MemberAccess will always be invalid at that position,
explicitly treat trailing dot as a part of punctuation.
2024-01-21 14:57:10 -07:00