Commit graph

48883 commits

Author SHA1 Message Date
Nico Weber ae1f7124ac LibGfx: Correctly handle more than one PrefixCodeGroup in webp decoder
The `static` here meant we always kept the alphabet sizes of the
first image we happened to load -- and a single webp lossless image
can store several helper images used during decoding.

Usually, the helper images wouldn't use a color cache but the main
image would, but the main image would then use the first entry from
the helper images due to the `static`, which led us to not decoding
the codes for the color cache symbols.
2023-04-07 09:47:04 +02:00
Kenneth Myhra 4d87072201 LibWeb: Port {HTML,UIEvents,XHR}::EventNames to new String 2023-04-06 23:49:08 +02:00
Kenneth Myhra d6cf9f5329 AK: Add FlyString::is_one_of for variadic string comparison 2023-04-06 23:49:08 +02:00
Kenneth Myhra 3aa485aa09 LibWeb: Move string literals to {HTML,UIEvents}::EventNames.h
This moves the reamining string literals from GlobalEventHandlers.h to
{HTML,UIEvents}::EventNames.h.
2023-04-06 23:49:08 +02:00
Matthew Olsson bdab61ad93 LibWeb: Add the WritableStreamDefaultWriter interface 2023-04-06 22:54:58 +02:00
Matthew Olsson e93560b769 LibWeb: Add the WritableStream interface 2023-04-06 22:54:58 +02:00
Matthew Olsson 78feba401d LibWeb: Move property_to_callback to Streams/AbstractOperations
This will be necessary for UnderlyingSink, which is WritableStream's
equivalent of UnderlyingSource, and functions in much the same way.
2023-04-06 22:54:58 +02:00
Timon Kruiper 2b6c44852c Kernel/aarch64: Actually remove Arch/aarch64/init.cpp
The idea was to remove this file in bd2011406, but that did not actually
happen. Let's actually remove it.
2023-04-06 22:06:03 +03:00
Timon Kruiper e9b40863ab Kernel: Make dispatch_signal work for aarch64 2023-04-06 21:19:58 +03:00
Timon Kruiper 00df1fc060 Kernel: Store FPU state when dispatching signal on aarch64
And make sure to also restore it in sys$sigreturn.
2023-04-06 21:19:58 +03:00
Timon Kruiper 4e00c63897 Kernel: Implement signal trampoline for aarch64
With this change, we are now able to successfully boot into the text
mode! :^)
2023-04-06 21:19:58 +03:00
Timon Kruiper ec765544a5 Kernel/aarch64: Add getters/setters in RegisterState and ThreadRegisters
Specifically this commit implements two setters set_userspace_sp and
set_ip in RegisterState.h, and also adds a stack pointer getter (sp) in
ThreadRegisters.h. Contributed by konrad, thanks for that.
2023-04-06 21:19:58 +03:00
Timon Kruiper 36362b9679 Kernel/aarch64: Implement copying of kernel regs into ptrace regs
And also vice versa. Contributed by konrad, thanks for that.
2023-04-06 21:19:58 +03:00
Timon Kruiper 200e91cd7f Kernel+LibC: Modify aarch64's __mcontext to store registers in an array
This commit also removes the unnecessary ifdefs from
sys/arch/aarch64/regs.h. Contributed by konrad, thanks for that.
2023-04-06 21:19:58 +03:00
Timon Kruiper 7440112cd9 Kernel: Implement ScopedAddressSpaceSwitcher using PageDirectory
This makes the code architecture independent, and thus makes it work for
aarch64.
2023-04-06 21:19:58 +03:00
Timon Kruiper 6a8581855d Kernel/aarch64: Flush entire TLB cache when changing TTBR0_EL1
Setting the page table base register (ttbr0_el1) is not enough, and will
not flush the TLB caches, in contrary with x86_64 where setting the CR3
register will actually flush the caches. This commit adds the necessary
code to properly flush the TLB caches when context switching. This
commit also changes Processor::flush_tlb_local to use the vmalle1
variant, as previously we would be flushing the tlb's of all the cores
in the inner-shareable domain.
2023-04-06 21:19:58 +03:00
Timon Kruiper 188a52db01 Kernel: Implement TimeManagement::boot_time() for aarch64
For now just return 0 as we have no RTC support on aarch64 yet, and add
a FIXME to return the correct value.
2023-04-06 21:19:58 +03:00
Idan Horowitz 1c2dbed38a Kernel: Extend the lifetime of Regions during page fault handling
Previously we had a race condition in the page fault handling: We were
relying on the affected Region staying alive while handling the page
fault, but this was not actually guaranteed, as an munmap from another
thread could result in the region being removed concurrently.

This commit closes that hole by extending the lifetime of the region
affected by the page fault until the handling of the page fault is
complete. This is achieved by maintaing a psuedo-reference count on the
region which counts the number of in-progress page faults being handled
on this region, and extending the lifetime of the region while this
counter is non zero.
Since both the increment of the counter by the page fault handler and
the spin loop waiting for it to reach 0 during Region destruction are
serialized using the appropriate AddressSpace spinlock, eventual
progress is guaranteed: As soon as the region is removed from the tree
no more page faults on the region can start.
And similarly correctness is ensured: The counter is incremented under
the same lock, so any page faults that are being handled will have
already incremented the counter before the region is deallocated.
2023-04-06 20:30:03 +03:00
Idan Horowitz 003989e1b0 Kernel: Store a pointer to the owner process in PageDirectory
This replaces the previous owning address space pointer. This commit
should not change any of the existing functionality, but it lays down
the groundwork needed to let us properly access the region table under
the address space spinlock during page fault handling.
2023-04-06 20:30:03 +03:00
Idan Horowitz 65641187ff Kernel: Restructure execve to ensure Process::m_space is always in use
Instead of setting up the new address space on it's own, and only swap
to the new address space at the end, we now immediately swap to the new
address space (while still keeping the old one alive) and only revert
back to the old one if we fail at any point.

This is done to ensure that the process' active address space (aka the
contents of m_space) always matches actual address space in use by it.
That should allow us to eventually make the page fault handler process-
aware, which will let us properly lock the process address space lock.
2023-04-06 20:30:03 +03:00
Idan Horowitz 3f89a1b131 Kernel: Mark sys$msync as not needing the big lock
All accesses to shared mutable data are already serialized behind the
process address space spinlock.
2023-04-06 20:30:03 +03:00
Idan Horowitz 1dae6a2e4a Kernel: Mark sys$mremap as not needing the big lock
All accesses to shared mutable data are already serialized behind the
process address space spinlock.
2023-04-06 20:30:03 +03:00
Idan Horowitz db10f201c8 Kernel: Mark sys$munmap as not needing the big lock
All accesses to shared mutable data are already serialized behind the
process address space spinlock.
2023-04-06 20:30:03 +03:00
Idan Horowitz d1082a00b7 Kernel: Mark sys$set_mmap_name as not needing the big lock
All accesses to shared mutable data are already serialized behind the
process address space spinlock.
2023-04-06 20:30:03 +03:00
Idan Horowitz 2f79d0e8b9 Kernel: Mark sys$mprotect as not needing the big lock
All accesses to shared mutable data are already serialized behind the
process address space spinlock.
2023-04-06 20:30:03 +03:00
Idan Horowitz 3697214166 Kernel: Mark sys$mmap as not needing the big lock
All accesses to shared mutable data are already serialized behind the
process address space spinlock.
2023-04-06 20:30:03 +03:00
Idan Horowitz dcdcab0099 Kernel: Remove unused credentials() call in validate_inode_mmap_prot
For some reason GCC did not complain about this.
2023-04-06 20:30:03 +03:00
Idan Horowitz 0b14081ae1 Kernel: Mark sys$map_time_page as not needing the big lock
All accesses to shared mutable data are already serialized behind the
process address space spinlock.
2023-04-06 20:30:03 +03:00
Idan Horowitz 0e564240a6 Kernel: Mark sys$madvise as not needing the big lock
All accesses to shared mutable data are already serialized behind the
process address space spinlock.
2023-04-06 20:30:03 +03:00
Luke Wilde cb62ffbb8a LibWeb: Transform the default path in CRC2D#fill(CanvasFillRule)
Required by Factory Balls Forever to position anything that isn't an
image.
2023-04-06 17:45:07 +02:00
Andreas Kling b97229c9b5 LibWeb: Ignore preferred width when calculating intrinsic width of block
When calculating the intrinsic width of a block-level box, we now ignore
the preferred width entirely, and not just when the preferred width
should be treated as auto.

The condition for this was both confused and wrong, as it looked at the
available width around the box, but didn't check for a width constraint
on the box itself.

Just because the available width has an intrinsic sizing constraint
doesn't mean that the box is undergoing intrinsic sizing. It could also
be the box's containing block!
2023-04-06 16:47:40 +02:00
Andreas Kling 68459d43e0 Tests/LibWeb: Move block & inline layout tests into own directory 2023-04-06 16:47:40 +02:00
Emily Trau 332bb8a299 LibEDID: Fix compiler error when ENABLE_PNP_IDS_DOWNLOAD=OFF 2023-04-06 10:26:21 -04:00
Lucas CHOLLET cfaa51203f LibGfx/JPEG: Use a smaller type to store coefficients
No need to store them in `i32`, the JPEG norm specifies that they are
not bigger than 16 bits for extended JPEGs. So, in this patch, we
replace `i32` with `i16`. It almost divides memory usage by two :^)
2023-04-06 12:00:08 +01:00
Luke Wilde a744ae79ff LibWeb: Implement the :defined pseudo class
This selects an element if it is either a built-in element, or an
upgraded custom element.
2023-04-06 11:36:56 +02:00
Luke Wilde 6ebdb9f824 LibWeb: Implement the HTMLConstructor extended attribute 2023-04-06 11:36:56 +02:00
Luke Wilde e3c3cc9e19 LibWeb: Implement the CEReactions extended attribute 2023-04-06 11:36:56 +02:00
Luke Wilde 32e27bc7fa LibWeb: Add a bunch of missing CEReactions
This is almost guaranteed not to be all CEReactions we need to add, but
this puts us in a much better situation.
2023-04-06 11:36:56 +02:00
Luke Wilde 034aaf3f51 LibWeb: Introduce CustomElementRegistry and creating custom elements
The main missing feature here is form associated custom elements.
2023-04-06 11:36:56 +02:00
Luke Wilde 083b547e97 LibWeb/WebIDL: Add the construct abstract operation
This will be used by custom elements to upgrade an element to a custom
element.
2023-04-06 11:36:56 +02:00
Luke Wilde 9b8b363445 LibWeb/WebIDL: Move call_user_object_operation out of line
This makes it in line with `invoke_callback`.
2023-04-06 11:36:56 +02:00
Luke Wilde 686e3a0d94 LibWeb: Support returning a callback function in IDL 2023-04-06 11:36:56 +02:00
Evan Smal 5b906d9a40 HackStudio: Add configuration domain pledge for FileManager
This fixes a bug where clicking the "Save" button would crash the
application because 'FileManager' was a pledged domain.
2023-04-06 08:56:57 +01:00
Julian Offenhäuser 602f5459bf LibGfx: Fix out of bounds read in BitmapFont::masked_character_set()
When creating a copy of the font containing only the glyphs that are in
use, we previously looped over all possible code points, instead of the
range of code points that are actually in use (and allocated) in the
font. This is a problem, since we index into the array of widths to find
out if a given glyph is used. This array is only as long as the number
of glyphs the font was created with, causing an out of bounds read when
that number is less than our maximum.
2023-04-06 08:26:22 +01:00
Cameron Youell 0c98cde18e GMLPlayground: Pledge Calendar domain
This now allows for the preview of `@GUI::Calendar` without
crashing the whole program.
2023-04-06 08:24:25 +01:00
Kenneth Myhra 1080281e58 LibWeb: Port AbstractBrowsingContext to String 2023-04-06 08:41:43 +02:00
Kenneth Myhra 03d6cb88ff LibWeb: Port KeyboardEvent to new String 2023-04-06 08:41:43 +02:00
Kenneth Myhra e14be3927a LibWeb: Port FocusEvent to new String 2023-04-06 08:41:43 +02:00
stelar7 d527edf0ab LibTLS: Change Certificate parsing to use ErrorOr
Loads of changes that are tightly connected... :/
* Change lambdas to static functions
* Add spec docs to those functions
* Keep the current scope around as a parameter
* Add wrapping classes for some Certificate members
* Parse ec and ecdsa data from certificates
2023-04-06 09:57:31 +03:30
stelar7 b1d80b35af LibCrypto: Add ability to rewrite current tag kind
This is used for IMPLICIT tags where the expected kind is overriden
by the encoding instructions.
2023-04-06 09:57:31 +03:30