summaryrefslogtreecommitdiff
path: root/Userland/Libraries
AgeCommit message (Collapse)Author
2021-01-18LibWeb: Add support for XMLHttpRequest request headersAndreas Kling
Implement XMLHttpRequest.setRequestHeader() and include the headers in the outgoing HTTP request.
2021-01-18LibWeb: Make the Window object "inherit" from EventTarget :^)Andreas Kling
Since Web::Bindings::WindowObject inherits from JS::GlobalObject, it cannot also inherit from Web::Bindings::EventTargetWrapper. However, that's not actually necessary. Instead, we simply set the Window object's prototype to the EventTargetPrototype, and add a little extra branch in the impl_from() function that turns the JS "this" value into a DOM::EventTarget*. With this, you can now call window.addEventListener()! Very cool :^) Fixes #4758.
2021-01-18LibWeb: Move IDL attributes and functions to the prototypeAndreas Kling
Instead of each IDL interface wrapper having its own set of all the attributes and functions, they are moved to the prototype. This matches what we already do in LibJS. Also, this should be spec compliant with the web as well, though there may be *some* content out there that expects some things to be directly on the wrapper since that's how things used to work in major browsers a long time ago. But let's just not worry about that for now. More work towards #4789
2021-01-18LibWeb: Construct the IDL interface prototype chains automaticallyAndreas Kling
Have each IDL prototype trigger the construction of its own prototype.
2021-01-18LibWeb: Actually instantiate all the web constructors/prototypesAndreas Kling
We now instantiate all the generated web API constructors and expose them on the window object. We also set the generated prototypes on instantiated wrappers. Also, we should obviously find a way to generate this code. :^)
2021-01-18LibWeb: Generate constructor and prototype classes for IDL interfacesAndreas Kling
This patch adds a FooPrototype and FooConstructor class for each IDL interface we generate JS bindings for. These classes are very primitive and don't do everything they should yet, but we have to start somewhere. :^) Work towards #4789
2021-01-18LibJS: Add JS::NativeFunction to the forwarding headerAndreas Kling
2021-01-18LibWeb: Move HTML::SubmitEvent functions out of lineAndreas Kling
2021-01-17Kernel: Some futex improvementsTom
This adds support for FUTEX_WAKE_OP, FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET, FUTEX_REQUEUE, and FUTEX_CMP_REQUEUE, as well well as global and private futex and absolute/relative timeouts against the appropriate clock. This also changes the implementation so that kernel resources are only used when a thread is blocked on a futex. Global futexes are implemented as offsets in VMObjects, so that different processes can share a futex against the same VMObject despite potentially being mapped at different virtual addresses.
2021-01-17LibGfx: Make Painter take the scale factor as constructor argumentNico Weber
I want to give Bitmap an intrinsic scale factor and this is a step in that direction. No behavior change.
2021-01-17LibGfx: Convert all the dbg() in BMPLoader to dbgln()Andreas Kling
Also get rid of the awkward IF_BMP_DEBUG macro while we're here.
2021-01-17LibWeb: Add fast_is<T>() for some DOM and layout node subclassesAndreas Kling
The generic is<T>() uses dynamic_cast which is fine in the majority of cases, but when one of them shows up in profiles, we can make it faster by answering the is-a question manually.
2021-01-17LibJS: Replace ASTNode::class_name() with RTTIAndreas Kling
This is only used for debugging anyway, so performance doesn't matter too much.
2021-01-17Kernel+Userland: Remove shared buffers (shbufs)Andreas Kling
All users of this mechanism have been switched to anonymous files and passing file descriptors with sendfd()/recvfd(). Shbufs got us where we are today, but it's time we say good-bye to them and welcome a much more idiomatic replacement. :^)
2021-01-17AudioServer+LibAudio: Pass audio buffers as Core::AnonymousBufferAndreas Kling
This was the last remaining user of shbufs! :^)
2021-01-17LibC: Change a couple of ASSERT_NOT_REACHED() to TODO()Linus Groh
Just for semantic correctness and better visibility of those unimplemented stub functions.
2021-01-17LibGfx: Let PNGLoader handle failed chunk decoding gracefullyLinus Groh
decode_png_chunks() is not handling "critical" chunks, unlike decode_png_size() for example. When we encounter a chunk decoding failure, e.g. because not enough bytes were left to read, just continue with decoding the bitmap - which will fail on its own, if we're missing some required chunk(s). Fixes #4984.
2021-01-17Kernel: Remove sys$shbuf_seal() and userland wrappersAndreas Kling
There are no remaining users of this syscall so let it go. :^)
2021-01-17Clipboard+LibGUI: Move clipboard service to anonymous filesAndreas Kling
2021-01-17Everywhere: Remove more <AK/SharedBuffer.h> includesAndreas Kling
2021-01-17LibGfx: Remove remaining SharedBuffer support in Gfx::BitmapAndreas Kling
2021-01-16ImageDecoder: Use Core::AnonymousBuffer and Gfx::ShareableBitmapAndreas Kling
...instead of sending shbufs back and forth. :^)
2021-01-16LibGfx+LibGUI: Make Gfx::ShareableBitmap transmit indexed palettesAndreas Kling
2021-01-16LibWeb+WebContent: Use anonymous files for OOPWV backing storesAndreas Kling
To support this, the GUI process and the WebContent service will now coordinate their backing store bitmaps. Each backing store can be referred to by a serial ID, and we don't need to keep resending it as a file descriptor. We should probably do something similar in WindowServer. :^)
2021-01-16LibGfx: Make Gfx::Bitmap::create_shareable() use an anonymous fileAndreas Kling
Note that this is only used by OOPWV in LibWeb at the moment.
2021-01-16LibVT: Convert dbgprintf() => dbgln() and remove some debug codeAndreas Kling
2021-01-16Kernel+Userland: Remove sys$shbuf_allow_all() and userland wrappersAndreas Kling
Nobody is using globally shared shbufs anymore, so let's remove them.
2021-01-16Kernel+LibC: Make sys$getcwd truncate the result silentlyBen Wiederhake
This gives us the superpower of knowing the ideal buffer length if it fails. See also https://github.com/SerenityOS/serenity/discussions/4357
2021-01-16LibC: Avoid silent truncation after overlong realpathBen Wiederhake
The realpath syscall can attempt to return arbitrarily long paths, in particular paths that are longer than PATH_MAX. The only way to detect this case is checking whether 'rc', the true length of the returned path including NUL byte, exceeds our buffer length. In such a case, the buffer contains invalid data. All Serenity code calls LibC's realpath() with a nullptr buffer, meaning that realpath is supposed to allocate memory on its own. All Serenity code can handle arbitrarily long paths returned by LibC's realpath, so it is safe to "do the dance" and repeat the syscall with a new buffer. Ports are likely to be graceful in this regard, too. If a Port calls realpath() with a pre-allocated buffer, however, there is nothing better we can do than return a truncated buffer.
2021-01-16LibCore: Fix invalid errnoBen Wiederhake
Noone seems to check 'errno' when using LibCore, but let's make sure it's correct anyway.
2021-01-16LibC: Fix memory leak in getcwdBen Wiederhake
2021-01-16LibC: Fix memory leak in realpathBen Wiederhake
2021-01-16LibELF: validate_program_headers: Validate PT_INTERP header p_filesz > 1Brendan Coles
2021-01-16LibGUI: Don't bubble window events up to parent windowsTom
Always accept the events so that they don't bubble up to the parent object. Fixes #4967
2021-01-16WindowServer+LibGUI: Pass the system theme using Core::AnonymousBufferAndreas Kling
This was the last remaining user of shbufs in WindowServer, and so WindowServer no longer pledges "shared_buffer" :^)
2021-01-16LibCore+LibIPC: Add Core::AnonymousBuffer, an IPC-friendly buffer classAndreas Kling
This will be used to migrate remaining clients off of shbufs.
2021-01-16Kernel+LibC+WindowServer: Remove unused thread/process boost mechanismAndreas Kling
The priority boosting mechanism has been broken for a very long time. Let's remove it from the codebase and we can bring it back the day someone feels like implementing it in a working way. :^)
2021-01-16Kernel: Remove unused syscall sys$minherit()Andreas Kling
This is no longer used. We can bring it back the day we need it.
2021-01-16Everywhere: Replace a bundle of dbg with dbgln.asynts
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
2021-01-16Everywhere: Replace a bundle of dbg with dbgln.asynts
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
2021-01-16Everywhere: Replace a bundle of dbg with dbgln.asynts
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
2021-01-16LibC: Bump FD_SETSIZE to 1024Andreas Kling
64 was cutting it pretty close, especially now as we start using file descriptor passing more and more. This (1024) matches many other systems, and if we need more there's always sys$poll().
2021-01-16LibGfx: Short-circuit ShareableBitmap construction in IPC decoderAndreas Kling
When decoding a ShareableBitmap that came over IPC, it's safe to assume that it's backed by an anonymous file (since we just decoded it.)
2021-01-16LibGfx: Make sure Bitmap::create_with_anon_fd() always closes if neededAndreas Kling
If this is called with ShouldCloseAnonymousFile::Yes, it's entrusted with closing the anon_fd and nobody else will take care of it.
2021-01-16LibGfx: Don't expose anon_fd inside Gfx::ShareableBitmapAndreas Kling
Nobody outside needs to see this, so let's just hide it.
2021-01-16WindowServer+LibGUI: Send menu item icons as Gfx::ShareableBitmapAndreas Kling
2021-01-16LibGfx: Don't encode invalid Gfx::ShareableBitmap as IPC::FileAndreas Kling
IPC::File should only be used when there's an actual file to pass. Invalid ShareableBitmaps don't have a backing file, so fix this by first encoding a "valid" flag.
2021-01-16Everywhere: Remove a bunch of <AK/SharedBuffer.h> includesAndreas Kling
2021-01-16WindowServer+LibGUI: Pass drag&drop bitmaps via Gfx::ShareableBitmapAndreas Kling
This makes them backed by anonymous files instead of shbufs and also simplifies the code significantly on both client and server side.
2021-01-16WindowServer, LibGUI: RefreshSystemTheme implementationNick Vella
Adds a mechanism through which windowing clients can re-request an UpdateSystemTheme message. This is currently used in SystemMenu's ShutdownDialog to refresh it's theme when the dialog is instantiated.