Commit graph

62740 commits

Author SHA1 Message Date
sideshowbarker
1a9dabe5ff LibGfx: Handle UTF-16-encoded OpenType font names
This change makes OpenType::Name::string_for_id handle fonts whose names
are UTF-16-encoded (along with handling UTF-8-encoded names).

Otherwise, without this change, the existing code assumes the names are
UTF-8-encoded, fails gracelessly if they’re not, and crashes.

Fixes https://github.com/LadybirdBrowser/ladybird/issues/75
2024-07-20 12:41:02 +01:00
Andreas Kling
3faff34bf6 LibWeb: Make details and summary elements display:block in the UA style
This is the expected behavior per the HTML spec. Fixes an issue where
styling these elements wouldn't have the expected effect unless you also
set the display property.
2024-07-20 13:09:28 +02:00
Diego Frias
4b9649282e LibWasm: Implement the rest of the SIMD conversions 2024-07-20 11:17:29 +02:00
Diego Frias
21c5084d23 LibWasm: Fix v128.any_true instruction 2024-07-20 11:17:29 +02:00
Diego Frias
616048c67e LibWasm: Implement integer conversion and narrowing SIMD instructions 2024-07-20 11:17:29 +02:00
Diego Frias
146646b597 LibWasm: Implement bitmask and float conversion instructions 2024-07-20 11:17:29 +02:00
Edwin Hoksberg
5f154ba372 LibWeb: Implement Element::check_visibility 2024-07-20 09:14:50 +01:00
sideshowbarker
4a2d5bcf89 CI: Make the notes-push.yml workflow fetch the entire repo history
This change makes the notes-push.yml·workflow fetch the entire history
on each push, rather than just the one HEAD commit it otherwise sees.

Because we push multiple commits from PR merges, git-gloss need access
on each push to an arbitrary number of commits (however many commits
were pushed in a PR that got merged). There’s no easy way from GH
Actions to know how may commits got pushed at the same time. So we
instead fetch the whole history.
2024-07-20 09:30:43 +02:00
Timothy Flynn
e8f4ae487d LibJS: Pre-allocate the resolved rope string's underlying buffer
For performance, rather than slowly incrementing the capacity of the
rope string's buffer, compute an approximate length for that buffer to
be reserved up front.
2024-07-20 06:45:49 +02:00
Timothy Flynn
29879a69a4 AK: Construct Strings from StringBuilder without re-allocating the data
Currently, invoking StringBuilder::to_string will re-allocate the string
data to construct the String. This is wasteful both in terms of memory
and speed.

The goal here is to simply hand the string buffer over to String, and
let String take ownership of that buffer. To do this, StringBuilder must
have the same memory layout as Detail::StringData. This layout is just
the members of the StringData class followed by the string itself.

So when a StringBuilder is created, we reserve sizeof(StringData) bytes
at the front of the buffer. StringData can then construct itself into
the buffer with placement new.

Things to note:
* StringData must now be aware of the actual capacity of its buffer, as
  that can be larger than the string size.
* We must take care not to pass ownership of inlined string buffers, as
  these live on the stack.
2024-07-20 06:45:49 +02:00
Timothy Flynn
77eef8a8f6 AK: Add missing includes to StringData.h
Opening StringData.h in any clangd-enabled editor previously resulted in
a sea of clangd errors.
2024-07-20 06:45:49 +02:00
Timothy Flynn
af220af8bf AK: Remove StringBuilder's UseInlineCapacityOnly feature
This feature is unused in Ladybird and will complicate an upcoming patch
to hand-off StringBuilder's memory to String.
2024-07-20 06:45:49 +02:00
Andreas Kling
33207174a9 LibWeb: Allow splitting surrogate pairs in CharacterData.replaceData()
We're expected to handle this situation gracefully, and certainly not
by falling apart like we were.

Found by Domato.
2024-07-20 06:41:25 +02:00
Andreas Kling
416c478876 LibWeb: Don't try to set selection with anchor/focus in different roots
If the anchor and focus nodes are not within the same document, we can't
use them for a selection range.

Found by Domato.
2024-07-20 06:41:25 +02:00
Andreas Kling
4e0edd42b9 LibWeb: Cap HTML dimension values at 17895700 (same as Firefox)
Instead of allowing arbitrarily large values (which could eventually
overflow an i32), let's just cap them at the same limit as Firefox does.

Found by Domato.
2024-07-20 06:41:25 +02:00
Andreas Kling
093f1dd805 LibWeb: Propagate exceptions from setAttribute() in DOMStringMap setter
We were incorrectly assuming that setAttribute() could never fail here,
even when passed an invalid name.

Found by Domato.
2024-07-20 06:41:25 +02:00
Andreas Kling
1c00e5688d LibWeb: Fix StringView OOB access when parsing 3-character legacy color
Found by Domato.
2024-07-20 06:41:25 +02:00
sideshowbarker
7360f7fbc6 CI: Fix the permissions syntax for the notes-push.yml workflow 2024-07-20 06:40:02 +02:00
sideshowbarker
980ffd5e19 CI: Give the notes-push.yml workflow write permissions 2024-07-19 21:06:43 +02:00
sideshowbarker
fe3f1c743c CI: Add notes-push.yml, for updating commit Notes on push to master
This change, for each commit pushed/merged to master:

- causes new git Notes with GitHub PR/issue/reviewer/author links to be
  auto-generated for that commit

- pushes the updated refs/notes/commits tree+references back to the repo
2024-07-19 20:15:54 +02:00
Aliaksandr Kalenik
0c1405ad6d LibWeb: Add missing requests to use antialiasing in Skia painter 2024-07-19 15:52:30 +02:00
Aliaksandr Kalenik
0be57df54d LibWeb: Subtract left inset from size_available_for_margins for abspos
Fixes https://github.com/LadybirdBrowser/ladybird/issues/712
2024-07-19 13:29:20 +01:00
Aliaksandr Kalenik
715f033007 Tests+headless-browser: Move screenshot ref-tests into own directory
This change will make it easier to disable screenshot comparison tests
on a specific platform or have per-platform expectations.

Additionally, it's nice to be able to tell if a ref-test uses a
screenshot as an expectation by looking at the test path.
2024-07-19 13:52:00 +02:00
Edwin Hoksberg
0ae048102c LibWeb: Resolve content-visibility fixme in html details element 2024-07-19 09:04:30 +01:00
Edwin Hoksberg
020b20d817 LibWeb: Support content-visibility css 2024-07-19 09:04:30 +01:00
Tim Ledbetter
bd72ff5669 LibWeb: Expose ChildNode methods on the DocumentType IDL interface 2024-07-19 09:22:08 +02:00
Tim Ledbetter
7e8d71f7fc Tests/LibWeb: Add some tests for Node.isEqualNode 2024-07-19 09:22:08 +02:00
Tim Ledbetter
5a578e8f15 LibWeb: Compare node names case insensitively in Node::is_equal_node() 2024-07-19 09:22:08 +02:00
Tim Ledbetter
7ab7be694d LibWeb: Don't consider nodes in different namespaces to be equal
Previously, `Node::is_equal_node()` would return true for nodes in
different namespaces that were otherwise equal.
2024-07-19 09:22:08 +02:00
Holger Hans Peter Freyther
319bb6353e LibWeb: Fix assertion failure on telekom.de
The EntryType has three possible values: Fetching, Failed or
ModuleScript. It is possible that we transition from Fetching to Failed
as in #13.1. Change the assertion to include the failed scenario.

Fixes: https://github.com/LadybirdBrowser/ladybird/issues/661
2024-07-19 09:20:09 +02:00
Daniel Bertalan
31eb0ed938 LibWeb/DOM: Work around GCC 14 warning on always true is<T>()
GCC 14 emits a warning when an always succeeding `dynamic_cast`'s return
value is compared to NULL inside the `AK::is<T>(U)` template when `T` ==
`U`.

While warning on tautological `is` calls seems useful, it's a bit
awkward when it comes from a function template where the cast may fail
in some instantiation. There is a GCC bug open for it:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115664

Work around the warning by performing the algorithm on the base type
(`EventTarget`), with a wrapper that casts it to the more specialized
input type.
2024-07-19 09:18:27 +02:00
Diego Frias
ea67bc989f LibWasm: Remove some unnecessary memory checks
Also make `store_to_memory` take a `MemoryArgument` so that we no longer
have to make "synthetic instructions" in some scenarios.
2024-07-19 03:19:04 +02:00
Diego Frias
56ae6b3968 LibWasm: Remove some dead code 2024-07-19 03:19:04 +02:00
Timothy Flynn
368dad54ef LibTextCodec: Use AK facilities to validate and convert UTF-16 to UTF-8
This allows LibTextCodec to make use of simdutf, and also reduces the
number of places with manual UTF-16 implementations.
2024-07-18 19:43:57 +02:00
Timothy Flynn
71c29504af AK: Support non-native endianness in Utf16View
Utf16View currently assumes host endianness. Add support for specifying
either big or little endianness (which we mostly just pipe through to
simdutf). This will allow using simdutf facilities with LibTextCodec.
2024-07-18 19:43:57 +02:00
circl
e59048e90f LibWebView: Add keyboard navigation to the Inspector 2024-07-18 07:09:50 -06:00
circl
8357f18e9b LibWeb: Set document.activeElement using the spec algorithm 2024-07-18 07:09:50 -06:00
circl
1aa9282103 LibWeb: Move retarget function to its own file 2024-07-18 07:09:50 -06:00
Ali Mohammad Pur
8cf0f36f7d LibWasm: Replace a hashtable with an RBTree to make instantiation faster
...by about 40%.
2024-07-18 14:54:50 +02:00
Ali Mohammad Pur
f1abc36689 LibWasm/WASI: Make the premapped stdio files configurable 2024-07-18 14:54:50 +02:00
Ali Mohammad Pur
16dd8d4d3b LibWasm/WASI+wasm: Make WASI exit() "noreturn" instead of making it exit
This makes it so exit() traps with a known error; an embedder (wasm.cpp)
can simply match this format and handle the request accordingly.
2024-07-18 14:54:50 +02:00
Ali Mohammad Pur
e08a7cb94d LibWasm/WASI: Add support for fd_seek() 2024-07-18 14:54:50 +02:00
Ali Mohammad Pur
708abf6bb1 LibWasm/WASI: Add support for fd_fdstat_get() 2024-07-18 14:54:50 +02:00
Ali Mohammad Pur
e22408b8b4 LibWasm: Make import errors a bit more descriptive and helpful
Instead of "yeah something went wrong", show what went wrong.
2024-07-18 14:54:50 +02:00
Timothy Flynn
fb228a3d85 LibJS: Implement Iterator.prototype.constructor according to spec
The spec allows setting a constructor on non built-in Iterator objects.

This is a normative change in the Iterator Helpers proposal. See:
https://github.com/tc39/proposal-iterator-helpers/commit/30b3501
2024-07-18 14:49:25 +02:00
Timothy Flynn
734e37442d LibJS: Implement Iterator.prototype [ @@toStringTag ] according to spec
The spec allows setting the prototype on non built-in Iterator objects.

This is a normative change in the Iterator Helpers proposal. See:
https://github.com/tc39/proposal-iterator-helpers/commit/30b3501
2024-07-18 14:49:25 +02:00
Andrew Kaster
2225b837f8 Documentation: Remove now-unnecessary environment settings for VsCode 2024-07-18 14:48:20 +02:00
Andrew Kaster
8e5d28de3c CMake: Force vcpkg to use CMAKE_CXX_COMPILER as specified to CMake
Override the vcpkg/scripts/detect_compiler behavior of always pulling
$CC and $CXX at the time that vcpkg install is determined to need called
by forcing $ENV{CXX} and $ENV{CC} to our CMake-determined compiler.

This prevents strange behavior such as running the following:

./Meta/ladybird.sh run
    make changes...
ninja -C Build/ladybird

Where the second build step would be run without CC or CXX set in the
environment, causing a total cache miss from vcpkg and a full rebuild.

It also helps prevent full rebuilds when an IDE passes a slightly
different compiler to the build step than ladybird.sh.
2024-07-18 14:48:20 +02:00
Aliaksandr Kalenik
1e4720700c LibWeb: Use premultiplied alpha for gradient interpolation in Skia
This change fixes the rest of regressions in
Tests/LibWeb/Ref/css-gradients.html
2024-07-18 14:47:32 +02:00
Timothy Flynn
0c14a9417a AK: Replace converting to and from UTF-16 with simdutf
The one behavior difference is that we will now actually fail on invalid
code units with Utf16View::to_utf8(AllowInvalidCodeUnits::No). It was
arguably a bug that this wasn't already the case.
2024-07-18 14:46:25 +02:00