Commit graph

67969 commits

Author SHA1 Message Date
Timothy Flynn
b9e2c79ebb LibWeb: Pass along the init dictionary for error / buffer change events
Otherwise, information stored in the base event init dictionary will be
dropped.
2025-03-24 17:25:12 -04:00
Aliaksandr Kalenik
a8285f255b LibJS: Skip allocation of temp object for primitive types in Value::get
Previously, `String.prototype.split()` caused the construction of a
temporary StringObject when a string primitive was passed as an
argument, solely to perform a Symbol.split lookup. This change allows
skipping that allocation by looking directly into the prototype of
primitive values.

As a result, we can avoid ~200000 StringObject allocations in a single
test from the Speedometer 2 benchmark.

Co-Authored-By: Andreas Kling <andreas@ladybird.org>
2025-03-24 20:38:11 +01:00
Aliaksandr Kalenik
057e643a63 LibWeb: Don't assume length-percentage is always a length [GFC]
Fixes crashing when trying to get length from LengthPercentage with
percentage value.
2025-03-24 18:59:21 +01:00
Jelle Raaijmakers
685cc1aae8 Everywhere: Remove Nix build support
A significant portion of reported build problems come from people trying
to build Ladybird with Nix, and it seems there's always something broken
for someone. The maintainers are currently not focused on supporting
Nix, and as a result PRs are not reviewed as well as they could have
been.

This removes all Nix-related files.
2025-03-24 17:22:08 +00:00
Jelle Raaijmakers
582084e74e CI: Call webhook as soon as new JS benchmark results are in
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
2025-03-24 12:49:30 +01:00
Sam Atkins
82b1d5537e Documentation: Document the new PseudoElements.json file 2025-03-24 09:49:50 +00:00
Sam Atkins
9e65291ebd LibWeb/CSS: Discard unsupported style properties on pseudo-elements
Quite simply, ignore any declarations for properties we don't want,
while computing a pseudo-element's style.

I've imported a WPT test for this, which fails without this patch.
2025-03-24 09:49:50 +00:00
Sam Atkins
1108988656 LibWeb/CSS: Generate property-filtering code for pseudo-elements
Pseudo-elements have specific rules about which CSS properties can be
applied to them. This is a first step to supporting that.

- If a property whitelist isn't present, all properties are allowed.
- Properties are named as in CSS.
- Names of property groups are prefixed with `#`, which makes this match
  the spec more clearly. These groups are implemented directly in the
  code generator for now.
- Any property name beginning with "FIXME:" is ignored, so we can mark
  properties we don't implement yet.
2025-03-24 09:49:50 +00:00
Sam Atkins
193adee164 LibWeb/CSS: Implement aliases for pseudo-elements
We previously supported a few -webkit vendor-prefixed pseudo-elements.
This patch adds those back, along with -moz equivalents, by aliasing
them to standard ones. They behave identically, except for serializing
with their original name, just like for unrecognized -webkit
pseudo-elements.

It's likely to be a while before the forms spec settles and authors
start using the new pseudo-elements, so until then, we can still make
use of styles they've written for the non-standard ones.
2025-03-24 09:49:50 +00:00
Sam Atkins
2c86fd539d LibWeb: Generate an enum for generated pseudo-elements 2025-03-24 09:49:50 +00:00
Sam Atkins
021e3f5c7d LibWeb/CSS: Generate is_has_allowed_pseudo_element() 2025-03-24 09:49:50 +00:00
Sam Atkins
ffa1dba96a LibWeb: Generate pseudo-element code from JSON
Initially, this generates the enum and to/from-string functions. The
JSON itself contains more data than that, but it's unused for now.
2025-03-24 09:49:50 +00:00
Sam Atkins
0ed2e71801 LibWeb/CSS: Move and rename PseudoElement types to prep for code gen
The upcoming generated types will match those for pseudo-classes: A
PseudoElementSelector type, that then holds a PseudoElement enum
defining what it is. That enum will be at the top level in the Web::CSS
namespace.

In order to keep the diffs clearer, this commit renames and moves the
types, and then a following one will replace the handwritten enum with
a generated one.
2025-03-24 09:49:50 +00:00
Jelle Raaijmakers
b11064c0ae CI: Reduce js-benchmarks artifact retention to 90 days
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
This is GitHub's default maximum. Prevents generating a warning on each
workflow run.
2025-03-24 01:20:00 +01:00
Manuel Zahariev
4ed8e9e596 LibCrypto: Improve precision of Crypto::BigFraction::to_double()
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Before:
    - FIXME: very naive implementation
    - was preventing passing some Temporal tests
    - https://github.com/tc39/test262
    - https://github.com/LadybirdBrowser/libjs-test262

Bonus: Unrelated formatting change (Line 249) that unblocks the CI
lint check.
2025-03-23 19:33:25 +01:00
Manuel Zahariev
d2ea77c099 LibCrypto: Improve efficiency of UnsignedBigInteger::shift_left
Before:
- a separate Word element allocation of the underlying Vector<Word> was
necessary for every new word in a multi-word shift
- two additional temporary UnsignedBigInteger buffers were allocated
and passed through, including in downstream calls (e.g. Multiplication)
- an additional allocation and word shift for the carry
- FIXME note seems to point to some of these issues

After:
- main change is in LibCrypto/BigInt/Algorithms/BitwiseOperations.cpp
- one single allocation per call, using shift_left_by_n_words
- only the input "number" and "output" need to be allocated by the
  caller
- downstream calls are adapted not to allocate or pass temporary
  buffers
- noticeable performance improvement when running TestBigInteger:
  0.41-0.42s (before) to 0.28-0.29s (after) Intel Core i9 laptop

Bonus: remove unused variables from UnsignedBigInteger::divided_by
- These were likely cut-and-paste artifacts from
  UnsignedBigInteger::multiplied_by; not caught by "unused-varible".

NOTE: making this change in a separate commit than shift_right, even if
it touches the same file BitwiseOperations.cpp since:
- it is a "bonus" addition: not necessary for fixing the shift_right
  bug, but logically unrelated to the shift_right code
- it brings a chain of downstream interface modifications (7 files),
  unrelated to shift_right
2025-03-23 19:33:25 +01:00
Manuel Zahariev
05cfbdd6fb LibCrypto: Add support for shift_right more than one word
- Before: UnsignedBigInteger::shift_right( n ) trigger index
  verification error for n>31. An assumption of
  num_bits<UnsignedBigInteger::BITS_IN_WORD was being made
- After: shift_right( n ) works correctly for n>31.

NOTE: "bonus" change; not necessary for fixing BigFraction::to_double
2025-03-23 19:33:25 +01:00
Noah
add380d6e2 LibWeb: Update Element::directionality() for bdi elements to match spec
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
This fixes three WPT test cases at html/dom/elements/global-attributes/dir-assorted.window.html

Update test expectations for Tests/LibWeb/Text/expected/wpt-import/css/selectors/dir-pseudo-on-bdi-element.txt
2025-03-23 09:58:42 +01:00
Andreas Kling
5f12b2a05d LibJS: Make IteratorRecord inherit from Cell, not Object
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
This shaves its size down from 104 bytes to 48 bytes, cutting GC
pressure caused by this type in more than half.
2025-03-22 16:59:44 -05:00
Andreas Kling
1d88c4529c LibJS: Allow JS::Value to store a non-object Cell
This will allow us to refer to non-object Cells more readily in bytecode
and opens up for some nice optimizations.
2025-03-22 16:59:44 -05:00
Andreas Kling
f0abf5a43b LibWeb: Avoid allocating DOMRect objects for internal engine use
Some checks failed
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Build Dev Container Image / build (push) Has been cancelled
Instead of bothering the GC heap with a bunch of DOMRect allocations,
we can just pass around CSSPixelRect internally in many cases.

Before this change, we were generating so much DOMRect garbage that
we had to do a garbage collection *every frame* on the Immich demo.
This was due to the large number of intersection observers checked.

We still need to relax way more when idle, but for comparison, before
this change, when doing nothing for 10 seconds on Immich, we'd spend
2.5 seconds updating intersection observers. After this change, we now
spend 600 ms.
2025-03-22 14:33:59 -05:00
Jelle Raaijmakers
bf517f9ac2 LibGfx+LibWeb: Convert bitmap alpha type when creating ImmutableBitmaps
When decoding data into bitmaps, we end up with different alpha types
(premultiplied vs. unpremultiplied color data). Unfortunately, Skia only
seems to handle premultiplied color data well when scaling bitmaps with
an alpha channel. This might be due to Skia historically only supporting
premultiplied color blending, with unpremultiplied support having been
added more recently.

When using Skia to blend bitmaps, we need the color data to be
premultiplied. ImmutableBitmap gains a new method to enforce the alpha
type to be used, which is now used by SharedResourceRequest and
CanvasRenderingContext2D to enforce the right alpha type.

Our LibWeb tests actually had a couple of screenshot tests that exposed
the graphical glitches caused by Skia; see the big smiley faces in the
CSS backgrounds tests for example. The failing tests are now updated to
accommodate the new behavior.

Chromium and Firefox both seem to apply the same behavior; e.g. they
actively decode PNGs (which are unpremultiplied in nature) to a
premultiplied bitmap.

Fixes #3691.
2025-03-22 17:49:38 +01:00
Jelle Raaijmakers
c6644c92e7 LibGfx: Factor out PNG frame decoding logic
The logic for decoding APNGs and single-frame PNGs had some duplicated
code. No functional changes.
2025-03-22 17:49:38 +01:00
Jelle Raaijmakers
d30c217866 LibWeb: Change ASSERTs into VERIFYs when comparing bitmap alpha types
For non-debug builds, this is still very useful to check and doesn't
significantly impact any hot paths.
2025-03-22 17:49:38 +01:00
Jelle Raaijmakers
e4a5be0206 LibGfx+ImageDecoder: Use RefPtr<Bitmap> instead of optional
Simplify the list of bitmaps a bit by changing
`Optional<NonnullRefPtr<Bitmap>>` into `RefPtr<Bitmap>`. No functional
changes.
2025-03-22 17:49:38 +01:00
aplefull
19bee8393d LibGfx: Add support for YCCK jpeg files 2025-03-22 17:35:29 +01:00
Tim Ledbetter
7b0b6e7493 LibWeb/CSS: Make empty GridTrackSize value serialize to "none"
This is the default value of the `grid-template-rows` and
`grid-template-columns` properties.
2025-03-22 17:33:37 +01:00
Timothy Flynn
9bdd22c6b1 UI/Qt: Add a menu item to open about:settings
This replaces the existing menu item that would open the Qt settings
dialog. That menu item still exists, but is no longer the default
settings action.
2025-03-22 17:27:45 +01:00
Timothy Flynn
7a5387b0ab UI/AppKit: Add a menu item to open about:settings 2025-03-22 17:27:45 +01:00
Timothy Flynn
b169a98495 LibWeb+LibWebView+WebContent: Introduce a basic about:settings page
This adds a basic settings page to manage persistent Ladybird settings.
As a first pass, this exposes settings for the new tab page URL and the
default search engine.

The way the search engine option works is that once search is enabled,
the user must choose their default search engine; we do not apply any
default automatically. Search remains disabled until this is done.

There are a couple of improvements that we should make here:

* Settings changes are not broadcasted to all open about:settings pages.
  So if two instances are open, and the user changes the search engine
  in one instance, the other instance will have a stale UI.

* Adding an IPC per setting is going to get annoying. It would be nice
  if we can come up with a smaller set of IPCs to send only the relevant
  changed settings.
2025-03-22 17:27:45 +01:00
Timothy Flynn
e084a86861 LibWebView+UI: Introduce a persistent settings object
This adds a WebView::Settings class to own persistent browser settings.
In this first pass, it now owns the new tab page URL and search engine
settings.

For simplicitly, we currently use a JSON format for these settings. They
are stored alongside the cookie database. As of this commit, the saved
JSON will have the form:

    {
        "newTabPageURL": "about:blank",
        "searchEngine": {
            "name": "Google"
        }
    }

(The search engine is an object to allow room for a future patch to
implement custom search engine URLs.)

For Qt, this replaces the management of these particular settings in the
Qt settings UI. We will have an internal browser page to control these
settings instead. In the future, we will want to port all settings to
this new class. We will also want to allow UI-specific settings (such as
whether the hamburger menu is displayed in Qt).
2025-03-22 17:27:45 +01:00
Timothy Flynn
b4fde1ef64 LibWebView: Remove non-generic search engines
It really doesn't make sense for GitHub to be the default search engine.
If some really wants this, we can eventually implement setting custom
search engine URLs.
2025-03-22 17:27:45 +01:00
Timothy Flynn
a69ecc3943 UI: Add a default CSS file for internal Ladybird pages
In order to maintain a consistent look and feel between internal about:
pages going forward, let's use a central CSS file to define Ladybird
colors and some common form control styles.
2025-03-22 17:27:45 +01:00
Timothy Flynn
5f0f97b3cc LibWeb: Do not insert "return" key presses into input element values
When the return key is pressed, we try to handle it as a commit action
for input elements. However, we would then go on to actually insert the
return key's code point (U+000D) into the input element. This would be
sanitized out, but would leave the input element in a state where it
thinks it has text to commit. This would result in a change event being
fired when the return key is pressed multiple times in a row.

We were also firing the beforeinput/input events twice for all return
key presses.

To fix this, this patch changes the input event target to signify if it
actually handled the return key. If not (i.e. for textarea elements),
only then do we insert the code point. We also must not fall through to
the generic key handler, to avoid the repeated input events.
2025-03-22 17:27:45 +01:00
Timothy Flynn
206ec6694c LibWeb: Update the select element's text when setting the selected index
We were updating the IDL values, but the rendered text would remain on
the previously selected value.
2025-03-22 17:27:45 +01:00
Timothy Flynn
9b6ae962d0 LibWebView+UI: Handle DPR for select elements like other menus
The select dropdown was doing its own ad-hoc method of handling DPR. We
now handle it just like other context menus. Previously, the drop down
in the AppKit chrome was twice as large as it should be.
2025-03-22 17:27:45 +01:00
Timothy Flynn
3961a4f16a AK: Fully qualify use of move in TemporaryChange
For some reason, after some seemingly unrelated upcoming changes, the
unqualified `move`s in this header result in an ADL failure:

AK/TemporaryChange.h:22:39: error: call to function 'move' that is
neither visible in the template definition nor found by argument-
dependent lookup
   22 |     ~TemporaryChange() { m_variable = move(m_old_value); }
      |                                       ^

Libraries/LibDNS/Resolver.h:491:29: note: in instantiation of member
function 'AK::TemporaryChange<bool>::~TemporaryChange' requested here
  491 |             TemporaryChange change(m_attempting_restart, true);
2025-03-22 17:27:45 +01:00
Tim Ledbetter
cbf47abd24 LibWeb/CSS: Set the initial value of the appearance property to "none" 2025-03-22 17:05:17 +01:00
Tim Ledbetter
ecd6636b3e LibWeb/CSS: Use "0s" as the initial value for animation-duration 2025-03-22 17:04:33 +01:00
Tim Ledbetter
e1f6a170d5 LibWeb: Invalidate style when media content attribute changes
Previously, we would only invalidate style when setting the `media` IDL
attribute; changing the attribute via `setAttribute()` and
`removeAttribute()` had no immediate effect.
2025-03-22 17:03:56 +01:00
Ryan Liptak
0b0f47e320 LibWeb: Make named character references more spec-compliant & efficient
There are two changes happening here: a correctness fix, and an
optimization. In theory they are unrelated, but the optimization
actually paves the way for the correctness fix.

Before this commit, the HTML tokenizer would attempt to look for named
character references by checking from after the `&` until the end of
m_decoded_input, which meant that it was unable to recognize things like
named character references that are inserted via `document.write` one
byte at a time. For example, if `&notin;` was written one-byte-at-a-time
with `document.write`, then the tokenizer would only check against `n`
since that's all that would exist at the time of the check and therefore
erroneously conclude that it was an invalid named character reference.

This commit modifies the approach taken for named character reference
matching by using a trie-like structure (specifically, a deterministic
acyclic finite state automaton or DAFSA), which allows for efficiently
matching one-character-at-a-time and therefore it is able to pick up
matching where it left off after each code point is consumed.

Note: Because it's possible for a partial match to not actually develop
into a full match (e.g. `&notindo` which could lead to `&notindot;`),
some backtracking is performed after-the-fact in order to only consume
the code points within the longest match found (e.g. `&notindo` would
backtrack back to `&not`).

With this new approach, `document.write` being called one-byte-at-a-time
is handled correctly, which allows for passing more WPT tests, with the
most directly relevant tests being
`/html/syntax/parsing/html5lib_entities01.html`
and
`/html/syntax/parsing/html5lib_entities02.html`
when run with `?run_type=write_single`. Additionally, the implementation
now better conforms to the language of the spec (and resolves a FIXME)
because exactly the matched characters are consumed and nothing more, so
SWITCH_TO is able to be used as the spec says instead of RECONSUME_IN.

The new approach is also an optimization:

- Instead of a linear search using `starts_with`, the usage of a DAFSA
  means that it is always aware of which characters can lead to a match
  at any given point, and will bail out whenever a match is no longer
  possible.
- The DAFSA is able to take advantage of the note in the section
  `13.5 Named character references` that says "This list is static and
  will not be expanded or changed in the future." and tailor its Node
  struct accordingly to tightly pack each node's data into 32-bits.
  Together with the inherent DAFSA property of redundant node
  deduplication, the amount of data stored for named character reference
  matching is minimized.

In my testing:

- A benchmark tokenizing an arbitrary set of HTML test files was about
  1.23x faster (2070ms to 1682ms).
- A benchmark tokenizing a file with tens of thousands of named
  character references mixed in with truncated named character
  references and arbitrary ASCII characters/ampersands runs about 8x
  faster (758ms to 93ms).
- The size of `liblagom-web.so` was reduced by 94.96KiB.

Some technical details:

A DAFSA (deterministic acyclic finite state automaton) is essentially a
trie flattened into an array, but it also uses techniques to minimize
redundant nodes. This provides fast lookups while minimizing the
required data size, but normally does not allow for associating data
related to each word. However, by adding a count of the number of
possible words from each node, it becomes possible to also use it to
achieve minimal perfect hashing for the set of words (which allows going
from word -> unique index as well as unique index -> word). This allows
us to store a second array of data so that the DAFSA can be used as a
lookup for e.g. the associated code points.

For the Swift implementation, the new NamedCharacterReferenceMatcher
was used to satisfy the previous API and the tokenizer was left alone
otherwise. In the future, the Swift implementation should be updated to
use the same implementation for its NamedCharacterReference state as
the updated C++ implementation.
2025-03-22 16:03:44 +01:00
Jelle Raaijmakers
2752e01fe7 CI: Add js-benchmarks workflow
This workflow starts after a successful js-artifacts workflow, picks up
the JS repl binary and runs our js-benchmarks tool. It does not yet
publish or otherwise store the benchmark results, but it's a start!
2025-03-22 13:05:43 +01:00
Jelle Raaijmakers
8671b0568d CI: Rename ladybird-js-artifacts to js-artifacts
Everything is Ladybird in this repository :^)
2025-03-22 13:05:43 +01:00
Aliaksandr Kalenik
c49dd2036b LibWeb: Mark height as definite before doing inner layout of abspos
...boxes with non-auto height.

We know for sure that by the time we layout abspos boxes, their
containing block has definite height, so it's possible to resolve
non-auto heights and mark it as definite before doing inner layout.

Big step towards having reasonable performance on
https://demo.immich.app/photos because now we avoid a bunch of work
initiated by mistakenly invoked intersection observer callbacks.

Co-Authored-By: Andreas Kling <andreas@ladybird.org>
2025-03-21 14:46:31 -05:00
Tim Ledbetter
ed62aa6224 Revert "LibJS: Reduce number of proxy traps called during for..in…
…iteration"

This reverts commit 357eeba49c.
2025-03-21 11:44:21 -05:00
Aliaksandr Kalenik
9ec986753a LibWeb: Delete const from GridDimension function parameters in GFC
Using const on primitive type was only adding unnecessary noise.
2025-03-21 15:19:39 +01:00
Aliaksandr Kalenik
76482559d0 LibWeb: Unify grid item's width and height resolution in GFC
It was annoying to maintain two separate but almost identical functions
that gradually accumulated small differences over time. This change
replaces them with a single function that resolves either width or
height, depending on the specified dimension.
2025-03-21 15:19:39 +01:00
Aliaksandr Kalenik
484cd8a0c3 LibWeb: Move item's available space getter into GridItem method in GFC
No behavior change intended.
2025-03-21 15:19:39 +01:00
Aliaksandr Kalenik
2ce40b5687 LibWeb: Move preferred size getter into GridItem method in GFC
No behavior change intended.
2025-03-21 15:19:39 +01:00
Aliaksandr Kalenik
c40f88ddcb LibWeb: Move minimum/maximum size getter into GridItem method in GFC
No behavior change intended.
2025-03-21 15:19:39 +01:00