Commit Graph

60669 Commits

Author SHA1 Message Date
Shannon Booth
5bf34ecc32 Ladybird: Add an option to enable internals object outside of test mode
Sometimes I like to play around with running Ladybird tests using full
blown Ladybird instead of just headless browser to interactively mess
around with the test page. One problem with this is that the internals
object is not exposed in this mode.

This commit supports this usecase by adding an option to specifically
expose the internals object without needing to run headless-browser
in test mode.
2024-04-22 08:10:08 +02:00
Shannon Booth
1ec6399c00 Everywhere: Remove uneeded short option argument where possible 2024-04-22 08:10:08 +02:00
Shannon Booth
88b343061e LibCore: Make short_name optional for ArgsParser
This allows us to not need to pass through a 0 in many cases for
options which do not support a short value.
2024-04-22 08:10:08 +02:00
Sam Atkins
59c79e848c LibWeb: Parse dimension values using TokenStream 2024-04-22 06:47:05 +02:00
Sam Atkins
efce563abd LibWeb: Parse identifier values using TokenStream 2024-04-22 06:47:05 +02:00
Sam Atkins
e8115d6a56 LibWeb: Parse transform values using the existing comma-parsing code
Also add a spec link and grammar comment.
2024-04-22 06:47:05 +02:00
Sam Atkins
e4e048f278 LibWeb: Parse color values using TokenStream 2024-04-22 06:47:05 +02:00
Sam Atkins
710e5c24d3 LibWeb: Parse string values using TokenStream 2024-04-22 06:47:05 +02:00
Sam Atkins
e42f052b00 LibWeb: Parse rect() values using TokenStream 2024-04-22 06:47:05 +02:00
Sam Atkins
e00f41a274 LibWeb: Parse URL values using TokenStream 2024-04-22 06:47:05 +02:00
Sam Atkins
cfa221944c LibWeb: Parse image values using TokenStream 2024-04-22 06:47:05 +02:00
Sam Atkins
384b18b271 LibWeb: Make parse_color_stop_list() a CSS Parser method
This lets us remove the color/dimension-parsing lambdas, since these
always forwarded to the same methods. This will make it easier to later
convert those methods to take a TokenStream.
2024-04-22 06:47:05 +02:00
Andreas Kling
8e56367092 LibWeb: Allow moving StyleSheets between documents without falling apart
We have to unregister link element stylesheets from the old document's
StyleSheetList when moving them into a new document.

This makes it possible to load GitHub contributor graphs. :^)
2024-04-22 06:43:05 +02:00
Sönke Holz
511e411def Kernel/riscv64: Implement Processor::read_cpu_counter
This simply reads the current cycle count from the cycle CSR.
x86-64 uses the similar rdtsc instruction here, which also may or may
not tick at a constant rate.
2024-04-21 13:37:32 -06:00
Sönke Holz
c57e39d52b Kernel/riscv64: Don't flush the entire TLB in Processor::flush_tlb_local 2024-04-21 13:37:06 -06:00
Dan Klishch
cf92efc497 LibELF: Get rid of DynamicLoader::m_cached_dynamic_object
The strategy of recreating an object for the second time after
DynamicLoader::map is interesting, of course, but it doesn't help
comprehensibility of the code, unfortunately.
2024-04-21 13:35:12 -06:00
Dan Klishch
c9a6bcf81d LibC+LibELF: Use AT_RANDOM ELF auxiliary vector for __stack_chk_guard
Kernel provided it for about 4 years at this point. I think it is about
time to finally use it in userspace.
2024-04-21 13:34:04 -06:00
Dan Klishch
bdfc77b725 LibELF: Treat STB_WEAK like STB_GLOBAL during global symbol lookup
This is what POSIX mandates and this also matches the behavior of modern
Linux.
2024-04-21 13:34:04 -06:00
Dan Klishch
d8119c4b4a LibLocale: Statically link LibLocaleData into LibLocale 2024-04-21 13:34:04 -06:00
Dan Klishch
932a722623 LibC+LibELF: Do not override existing weak symbols during magic lookup
Previously, the actual behavior of magic lookup and one described in its
commit description have not matched. Instead of being weak definitions
in a library that is always in the end of load order, the definitions
were normal ones and thus were able to override other weak definitions
in LibC. While this was consistent with how DynamicLoader resolves
ambiguity between normal and weak relocations, this is not the behavior
POSIX mandates -- we should always choose first available definition wrt
load order. To fix this problem, the patch makes sure we don't define
any of magic symbols in LibC.

In addition to this, it makes all provided magic symbols functions
(instead of objects), what renders MagicWeakSymbol class unnecessary.
2024-04-21 13:34:04 -06:00
Timothy Flynn
306041f4ac LibWebView: Do not update cookie access time when fetched with WebDriver
When WebDriver accesses cookies, it specifically says to run:

    the first step of the algorithm in RFC6265 to compute cookie-string

So we should skip subsequent steps. We already skip step 2, which sorts
the cookies, but neglected to skip step 3 to update their last access
time.
2024-04-21 14:46:54 -04:00
Andreas Kling
193fc7ef98 LibWeb: Allow cloneNode() to clone elements with weird attributes
We can't rely on Element.setAttribute() in cloneNode() since that will
throw on weird attribute names. Instead, just follow the spec and copy
attributes into cloned elements verbatim.

This fixes a crash when loading the "issues" tab on GitHub repos.
They are actually sending us unintentionally broken markup, but we
should still support cloning it. :^)
2024-04-21 19:51:24 +02:00
Andreas Kling
d94a6d8873 LibWeb: Avoid creating tons of temporary FlyStrings in HTMLParser 2024-04-21 19:32:49 +02:00
Andreas Kling
990f8e10a5 LibWeb: Avoid redundant UTF-8 validation in HTML tokenizer 2024-04-21 19:32:49 +02:00
Andreas Kling
df547bb321 LibUnicode: Avoid redundant UTF-8 validation in AK::String helpers 2024-04-21 19:32:49 +02:00
Andreas Kling
1068518bdf LibLocale: Use String::from_utf8_without_validation() in generated code
The unnecessary UTF-8 validation performed here was actually visible
while profiling navigation between pages on GitHub.
2024-04-21 19:32:49 +02:00
Andreas Kling
819f2c1df6 LibWeb: Don't redundantly re-sort StyleSheetList on sheet removal
The list is already kept sorted. Removing one sheet anywhere from the
list will not make it unsorted.
2024-04-21 19:32:49 +02:00
MacDue
9d8ab826cb LibWeb: Add an initial implementation of the SVG .getBBox() method
This just reuses the layout to compute the bounding box rather than
implementing the full bounding box algorithm, which is likely the slower
option, but also much simpler to implement.

This is enough to fix the faces on https://zengm.com/facesjs/.
2024-04-21 17:30:51 +02:00
Aliaksandr Kalenik
3c33e1eba9 LibWeb: Make ChangingNavigableContinuationState be GC-allocated
This struct is captured by `after_document_populated` callback so making
it be GC-allocated results in more understandable GC-graph.
2024-04-21 16:44:05 +02:00
Aliaksandr Kalenik
2f345c4ab5 LibWeb: Use HeapFunction for update_document callback 2024-04-21 16:44:05 +02:00
Aliaksandr Kalenik
3b3816e683 LibWeb: Remove changing_navigable_continuation capture in callback
Capturing a struct that owns bunch of JS::Handle makes it very hard to
understand what keeps these handles alive in the GC-graph.

Instead let's capture only members of a struct used in the callback.
2024-04-21 16:44:05 +02:00
implicitfield
c15b473c1a Kernel/FATFS: Only read the requested blocks in read_bytes_locked()
This dramatically improves performance when working with large files,
since we no longer re-read the entire file for each read.
2024-04-21 15:34:33 +02:00
implicitfield
5bc87ad1a5 Kernel/FATFS: Free an inode's clusters upon removal 2024-04-21 15:34:33 +02:00
implicitfield
32692f032c Kernel/FATFS: Keep the FSInfo sector's free cluster count in sync 2024-04-21 15:34:33 +02:00
implicitfield
bd76dd2dc2 Kernel/FATFS: Initialize special directory entries 2024-04-21 15:34:33 +02:00
implicitfield
66e1f8812f Kernel/FATFS: Don't ignore special entries when traversing directories 2024-04-21 15:34:33 +02:00
Undefine
31174c43bf Kernel/FATFS: Implement a hacky replace_child
This is not a proper implementation, but it's good enough to get
the write support fully working.
2024-04-21 15:34:33 +02:00
Undefine
511b298a1d Kernel/FATFS: Implement remove_child 2024-04-21 15:34:33 +02:00
Undefine
3b39a2f71b Kernel/FATFS: Implement add_child 2024-04-21 15:34:33 +02:00
Undefine
5e87b78935 LibFileSystem: Ignore ENOTSUP when using chown and chmod during copy
With FAT write support copying the file would show two errors because
it does not support chown and chmod and would return ENOTSUP. After
this commit these errors are ignored in that case.
2024-04-21 15:34:33 +02:00
Undefine
2952401c58 Kernel/FATFS: Implement create_child
This is a large commit because it implements a lot of stuff to make
add_child simpler to get working. This allows us to create new files
on a FAT partition.
2024-04-21 15:34:33 +02:00
Undefine
098518cc57 Kernel/FATFS: Implement file modification
This is the first part of write support, it allows for full file
modification, but no creating or removing files yet.

Co-Authored-By: implicitfield <114500360+implicitfield@users.noreply.github.com>
2024-04-21 15:34:33 +02:00
Undefine
fde7bd9190 Kernel/FATFS: Make the debug logs nicer
They now look the same way as the ones in Ext2FS inodes which are
quite nice for debugging.
2024-04-21 15:34:33 +02:00
Undefine
33f00a7efb Kernel/FATFS: Cache the cluster list and don't cache the InodeMetadata
Caching the cluster list allows us to fill the two fields in the
InodeMetadata. While at it, don't cache the metadata as when we
have write support having to keep both InodeMetadata and FATEntry
correct is going to get very annoying.
2024-04-21 15:34:33 +02:00
Undefine
d4badfac72 Kernel/FATFS: Store cluster list instead of block list
Once we have write support, managing clusters is going to be
way easier than managing blocks.
2024-04-21 15:34:33 +02:00
Undefine
92d58a91a6 Kernel/FATFS: Read the FAT32 FSInfo structure
This structure contains information about free clusters which
is going to be useful when allocating clusters.
2024-04-21 15:34:33 +02:00
Undefine
7e251c3b4f Kernel/FATFS: Return ENOTSUP on chown and chmod 2024-04-21 15:34:33 +02:00
Undefine
eb2721d650 Kernel/FATFS: Pass the FATEntry location to FATInode constructor
This is going to be necessary to flush the metadata later on.
2024-04-21 15:34:33 +02:00
Undefine
de574b9ed9 Kernel/FATFS: Improve error propagation in FATInode 2024-04-21 15:34:33 +02:00
implicitfield
0f828768bb Kernel/FATFS: Implement fat_write 2024-04-21 15:34:33 +02:00