1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 18:10:56 +09:00
Commit graph

3496 commits

Author SHA1 Message Date
stelar7
82d17fa17e LibWeb/IDB: Sort IDBCursor fields according to IDL 2025-05-13 10:48:40 -06:00
Psychpsyo
a0be82b2cb LibWeb: Move containment checks to Layout::Node
It fits better there and avoids having to reach into the Element
all the time.
2025-05-13 15:30:14 +03:00
Psychpsyo
4989c5c793 LibWeb: Add paint containment clipping
The contain-paint-stacking-context-001a.html test has been removed
for now because it has a 1px tall blue line at the top that should
not be there. With paint containment, this line is removed only in
the actual test case, but not in the reference. This is because of
the font that we use in testing and happens in Chromium as well if
the test is run with that font.
2025-05-13 15:30:14 +03:00
Psychpsyo
ed7374783d LibWeb: Enable different overflow along the x and y axis 2025-05-13 15:30:14 +03:00
Psychpsyo
85883ee5ce LibWeb: Deduplicate clipping code
This makes it so that PaintableWithLines no longer has its own
bespoke clipping logic, using the same code as regular scroll/
overflow clipping.
2025-05-13 15:30:14 +03:00
Aliaksandr Kalenik
bb53485dea LibJS+LibWeb: Add fast path for builtin iterators in iterator_step()
We already have fast path for built-in iterators that skips `next()`
lookup and iteration result object allocation applied for `for..of` and
`for..in` loops. This change extends it to `iterator_step()` to cover
`Array.from()`, `[...arr]` and many other cases.

Makes following function go 2.35x faster on my computer:
```js
(function f() {
  let arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
  for (let i = 0; i < 1000000; i++) {
    let [a, ...rest] = arr;
  }
})();
```
2025-05-13 15:14:25 +03:00
Psychpsyo
31301ef08b LibWeb: Add support for trees of pseudo-elements
This is needed for CSS view transitions.
2025-05-13 12:38:42 +01:00
stelar7
a2ecafb968 LibWeb/IDB: Use enum flags in IDBKeyRange 2025-05-13 22:46:43 +12:00
stelar7
a5023ec053 LibWeb/IDB: Use enum flags in IDBCursor 2025-05-13 22:46:43 +12:00
Tim Ledbetter
03e34db9f8 LibWeb: Interpolate the content-visibility property correctly 2025-05-13 11:24:05 +01:00
Tim Ledbetter
882ad4726e LibWeb: Interpolate the visibility property correctly 2025-05-13 11:24:05 +01:00
Psychpsyo
f52df06a2a LibWeb: Do not forget to unapply empty masks 2025-05-13 10:31:08 +02:00
stelar7
a11efe3139 LibWeb/IDB: Sort IDBObjectStore according to the IDL 2025-05-13 08:27:52 +12:00
stelar7
7250aa0b6b LibWeb/IDB: Implement IDBObjectStore::getAllKeys 2025-05-13 08:27:52 +12:00
stelar7
927237c736 LibWeb/IDB: Implement retrieve_multiple_keys_from_an_object_store 2025-05-13 08:27:52 +12:00
stelar7
c56ec49ce6 LibWeb/IDB: Implement IDBObjectStore::openKeyCursor 2025-05-13 08:27:52 +12:00
stelar7
c700bfaaf1 LibWeb/IDB: Implement IDBObjectStore::getAll 2025-05-13 08:27:52 +12:00
stelar7
ddaae635ac LibWeb/IDB: Implement retrieve_multiple_values_from_an_object_store 2025-05-13 08:27:52 +12:00
stelar7
7f98d708ef LibWeb/IDB: Implement IDBObjectStore::getKey 2025-05-13 08:27:52 +12:00
stelar7
c47ddf11ba LibWeb/IDB: Implement retrieve_a_key_from_an_object_store 2025-05-13 08:27:52 +12:00
Daniel Bertalan
a2167f126d Everywhere: Fix trivial -Wunnecessary-virtual-specifier instances
- `Threading::Thread` is not polymorphic, there is no need for a virtual
  destructor.
- `HTMLAnchorElement::has_download_preference` isn't overridden by
  anything.

This warning was introduced in llvm/llvm-project#131188.
2025-05-12 11:40:45 -06:00
Mikkel Krautz
c48a78e37f LibWeb: Fix copyright headers with inconsistent > characters 2025-05-12 11:21:04 -06:00
Shannon Booth
b478274e0b LibWeb: Use infra sorting for URLSearchParam's sort()
Adopts editiorial change to the URL spec of:

59979a1
2025-05-12 11:20:32 +02:00
Shannon Booth
74334ea1ce LibWeb: Only use code unit length for is_code_unit_prefix
Fixes a crash in the included test.
2025-05-12 11:20:32 +02:00
Shannon Booth
1cd09724f1 LibWeb/Infra: Ignore OOM for utf16 conversion in 'is code unit prefix' 2025-05-12 11:20:32 +02:00
Psychpsyo
91159df0dd LibWeb: Draw text even if it needs to go into a 0-size inline box 2025-05-12 10:49:46 +02:00
Andreas Kling
096eed35cc LibWeb: Avoid O(n^2) traversal in play-or-cancel-animations logic
The play_or_cancel_animations_after_display_property_change() helper
was being called by Node::inserted() and Node::removed_from() and then
recursing into the shadow-including subtree.

This had quadratic complexity since inserted() and removed_from() are
themselves already invoked recursively for everything in the
shadow-including subtree.

Only one caller of this API actually needed the recursive behavior,
so this patch moves that responsibility to the caller and puts the logic
in style recomputation instead.

1.02x speedup on Speedometer's TodoMVC-jQuery.
2025-05-11 20:22:17 +02:00
InvalidUsernameException
029bcf13fd Libweb: Invalidate layout for the value-attribute of li-elements 2025-05-11 01:14:31 +02:00
InvalidUsernameException
370098514a LibWeb: Invalidate layout for ol-attributes that affect it 2025-05-11 01:14:31 +02:00
Andreas Kling
263b125782 LibWeb: Let HTMLTokenizer walk over code points instead of UTF-8
Instead of using UTF-8 iterators to traverse the HTMLTokenizer input
stream one code point at a time, we now do a one-shot conversion up
front from the input encoding to a Vector<u32> of Unicode code points.

This simplifies the tokenizer logic somewhat, and ends up being faster
as well, so win-win.

1.02x speedup on Speedometer 2.1
2025-05-11 01:13:20 +02:00
Andrew Kaster
accb77fda9 LibWeb: Add missing WebIDL/Types include to MediaCapabilities.h
This causes a build failure when building a clang module for LibWeb.
2025-05-09 23:14:27 -06:00
Jelle Raaijmakers
70b52e0994 LibWeb: Use efficient background repeat path for either direction
We're able to efficiently draw repeated bitmaps through Skia, but for
backgrounds we only did so if the background was `repeat-x` _and_
`repeat-y`, and not if just one was set. This meant that for backgrounds
that were only repeating in one direction, we were taking the slow path.
Turns out that this slow path also produced graphical artifacts when
zooming in and out, so let's not do that :^)
2025-05-09 21:37:48 +02:00
Timothy Flynn
30e8f3f1ad LibWeb: Update the <details> layout tree when it is opened/closed
Otherwise, the arrow painted next to the <details> element does not
update.

Using a screenshot test here because apparently the direction of the
arrow has no effect on the layout or paint trees.
2025-05-09 21:37:14 +02:00
Andreas Kling
f61df9d34c LibWeb: Don't throw away UA shadow trees willy-nilly
We were unnecessarily discarding the shadow trees of various elements
when they were removed or detached from the DOM.

This especially caused a *lot* of churn when creating input elements via
setting .innerHTML on something. We ended up building each input
element's shadow tree 3 times instead of 1.

The original issue that we were trying to solve by discarding shadow
trees appears to have been solved elsewhere, and nothing else seems to
break by just allowing them to remain in place.

1.05x speedup on Speedometer's TodoMVC-jQuery.
2025-05-09 12:49:04 -04:00
Jelle Raaijmakers
123abe0e79 LibWeb: Overlap float space and left margins for all shared ancestors
We would only correct for the left margin of the containing block of the
child box that we are laying out, but we actually need to correct for
all left margins up until the containing block that contains both the
float and the child box.

Fixes #4639.
2025-05-09 14:13:02 +02:00
Sam Atkins
90d466e7e9 LibWeb: Add dumping code for keyframe/keyframes rules 2025-05-08 16:21:32 +01:00
Sam Atkins
fbdef98307 LibWeb: Dump CSSDescriptors in a generic way
This replaces the need for bespoke (and verbose) dumping for each
at-rule that has descriptors.
2025-05-08 16:21:32 +01:00
Sam Atkins
f0ce4f43a6 LibWeb: Make unknown webkit pseudo-elements safe to dump
This fixes a couple of crashes when dumping the style sheets on
ladybird.org
2025-05-08 16:21:32 +01:00
Sam Atkins
0925a32558 LibWeb/CSS: Extract a CSSDescriptors base class
This holds the boilerplate that's needed by any CSSStyleDeclaration
subclass that holds Descriptors. CSSFontFaceDescriptors now only has to
worry about initialization and its own exposed properties.
2025-05-08 16:21:32 +01:00
Kenneth Myhra
6941b63890 LibWeb: Add {,de}serialization steps for ImageData 2025-05-09 02:12:01 +12:00
Kenneth Myhra
5b4644d198 LibWeb: Use WebIDL types for IDL exposed attributes 2025-05-09 02:12:01 +12:00
stelar7
fa207c8fc6 LibWeb/IDB: Implement IDBObjectStore::clear 2025-05-08 14:13:21 +01:00
stelar7
637f35c0eb LibWeb/IDB: Implement clear_an_object_store 2025-05-08 14:13:21 +01:00
stelar7
aa35ced34f LibWeb/IDB: Implement IDBObjectStore::delete 2025-05-08 14:13:21 +01:00
stelar7
1fe6060ff9 LibWeb/IDB: Improve error messages slightly 2025-05-08 14:13:21 +01:00
stelar7
63e1cc7b50 LibWeb/IDB: Implement IDBIndex::open_cursor 2025-05-08 14:13:21 +01:00
stelar7
8f876e824b LibWeb/IDB: Implement IDBCursor::primary_key 2025-05-08 14:13:21 +01:00
stelar7
141093e032 LibWeb/IDB: Implement IDBCursor::effective_key 2025-05-08 14:13:21 +01:00
Jelle Raaijmakers
f996fb9d80 LibWeb: Translate special WebDriver keys for backspace, tab and return
These private code points are used extensively by WebDriver clients,
such as the WPT suite.
2025-05-08 07:06:02 -04:00
Timothy Flynn
c846616d51 LibWeb: Adjust positions by the scroll offset for scrollbar hit testing
This ensures we scroll to the correct position when dragging a scrollbar
or clicking its gutter.
2025-05-08 10:40:58 +01:00