summaryrefslogtreecommitdiff
path: root/Meta/Lagom
AgeCommit message (Collapse)Author
2023-03-15LibWeb: Support generating IDL namespacesTimothy Flynn
These are similar to prototypes and constructors in that they will now be lazily instantiated when they are first requested.
2023-03-15Lagom: Remove debug line in LibJSGCVerifierMatthew Olsson
2023-03-15LibJS+LibWeb: Wrap raw JS::Cell*/& fields in GCPtr/NonnullGCPtrMatthew Olsson
2023-03-14AK: Rename CaseInsensitiveStringViewTraits to reflect intentgustrb
Now it is called `CaseInsensitiveASCIIStringViewTraits`, so we can be more specific about what data structure does it operate onto. ;)
2023-03-14LibWeb: Implement the [PutForwards] IDL extended attributeTimothy Flynn
For example, consider the attribute: interface Element { [PutForwards=value] readonly attribute DOMTokenList classList; } When `classList` is set, we should instead set the attribute `value` on the `classList` attribute of the Element interface.
2023-03-14LibWeb: Prevent variadic arguments from reserving heaps of memoryTimothy Flynn
Don't try to reserve capacity for a variadic arguments list unless we actually have enough arguments to fill it with anything. Otherwise we may overflow to an extremely large size if, e.g., the argument count is 0 and the start of the variadic arguments is index 1.
2023-03-14LibWeb: Begin adding support for Function IDL types in unionsTimothy Flynn
For example, setTimeout/setInterval use a TimerHandler, which is a union of (DOMString or Function).
2023-03-14LibWeb: Support variadic "any..." parameters in IDLTimothy Flynn
For example, this is used by setTimeout/setInterval.
2023-03-13file: Read more metadata from audio fileskleines Filmröllchen
We can always read the basic format information (sample rate, bit depth, etc.), but we will also print artist, album, and title if available in the metadata.
2023-03-13CodeGenerators: Ensure that we always print the entire generated outputTim Schumacher
2023-03-13AK: Rename Stream::read_entire_buffer to Stream::read_until_filledTim Schumacher
No functional changes.
2023-03-13AK: Rename Stream::{read,write} to Stream::{read_some,write_some}Tim Schumacher
Similar to POSIX read, the basic read and write functions of AK::Stream do not have a lower limit of how much data they read or write (apart from "none at all"). Rename the functions to "read some [data]" and "write some [data]" (with "data" being omitted, since everything here is reading and writing data) to make them sufficiently distinct from the functions that ensure to use the entire buffer (which should be the go-to function for most usages). No functional changes, just a lot of new FIXMEs.
2023-03-13LibAudio: Move audio stream buffering into the loaderkleines Filmröllchen
Before, some loader plugins implemented their own buffering (FLAC&MP3), some didn't require any (WAV), and some didn't buffer at all (QOA). This meant that in practice, while you could load arbitrary amounts of samples from some loader plugins, you couldn't do that with some others. Also, it was ill-defined how many samples you would actually get back from a get_more_samples call. This commit fixes that by introducing a layer of abstraction between the loader and its plugins (because that's the whole point of having the extra class!). The plugins now only implement a load_chunks() function, which is much simpler to implement and allows plugins to play fast and loose with what they actually return. Basically, they can return many chunks of samples, where one chunk is simply a convenient block of samples to load. In fact, some loaders such as FLAC and QOA have separate internal functions for loading exactly one chunk. The loaders *should* load as many chunks as necessary for the sample count to be reached or surpassed (the latter simplifies loading loops in the implementations, since you don't need to know how large your next chunk is going to be; a problem for e.g. FLAC). If a plugin has no problems returning data of arbitrary size (currently WAV), it can return a single chunk that exactly (or roughly) matches the requested sample count. If a plugin is at the stream end, it can also return less samples than was requested! The loader can handle all of these cases and may call into load_chunk multiple times. If the plugin returns an empty chunk list (or only empty chunks; again, they can play fast and loose), the loader takes that as a stream end signal. Otherwise, the loader will always return exactly as many samples as the user requested. Buffering is handled by the loader, allowing any underlying plugin to deal with any weird sample count requirement the user throws at it (looking at you, SoundPlayer!). This (not accidentally!) makes QOA work in SoundPlayer.
2023-03-13headless-browser: Re-implement headless-browser using an OOPWVTimothy Flynn
headless-browser currently uses its own PageClient to load web pages in-process. Due to this, it also needs to set up a whole bunch of other objects needed to run LibWeb, e.g. image decoders, request servers, etc. This changes headless-browser to instead implement a WebView to launch WebContent out-of-process. This implementation is almost entirely empty, but can be filled in as-needed. For example, we may want to print JavaScript console messages.
2023-03-12Userland: Add an `image` utilityNico Weber
At the moment, all it can do is read all image formats that LibGfx can read and save to any image format that LibGfx can write (currently bmp, png, qoi). Currently, it drops all image metadata (including color profiles). Over time, this could learn tricks like keeping color profiles, converting an image to a different color profile, cropping out a part of an image, and so on.
2023-03-10Everywhere: Rename equals_ignoring_case => equals_ignoring_ascii_caseAndreas Kling
Let's make it clear that these functions deal with ASCII case only.
2023-03-10Meta/Lagom: Add a fuzzer for QOAkleines Filmröllchen
2023-03-10Documentation: Reorganize Lagom README and update fuzzer documentationAndrew Kaster
Add some prose to the introduction of Lagom about how we use it. Also, move the section on including Lagom in other projects above the fuzzer documentation. Remove the explicit cmake commands from the Fuzzer documentation, as the script should be the source of truth.
2023-03-09LibIMAP: Propagate OOM errors from decode_quoted_printable()Linus Groh
2023-03-08LibWeb: Move generated #include statement for iterators out of loopKenneth Myhra
When an IDL file has #imports and the IDL interface exposes an iterator, the bindings generator would generate #include statements missing the class name of the iterator in the form 'LibWeb/{namespace}/Iterator'. This change only generates the iterator #include statement for the top interface that is the iterator.
2023-03-07LibWeb/HTML: Port Window.structuredClone() to IDLLinus Groh
2023-03-07LibWeb/HTML: Port Window.performance to IDLLinus Groh
2023-03-07LibWeb/HTML: Port Window.event to IDLLinus Groh
2023-03-07LibWeb: Generate setter for [Replaceable] IDL attributesLinus Groh
The code is directly stolen from the REPLACEABLE_PROPERTY_SETTER() macro which will hopefully be removed soon.
2023-03-07LibWeb: Support interfaces with the [Global] extended attributeLinus Groh
These are treated differently as the interface members are placed on the object itself, not its prototype. As the object itself still needs to be hand-written code, and we can no longer fully hide the gnarly generated code in the prototype object, these now generate a 'mixin' class that is added to the actual object through inheritance. https://webidl.spec.whatwg.org/#Global
2023-03-07LibWeb: Generate Window{Constructor,Prototype} from IDLLinus Groh
The Window object is massive, so let's do the conversion to IDL step by step. First up: getting rid of the manual constructor and prototype definitions, which can be generated from an empty `interface Window`.
2023-03-07LibWeb: Remove CSS::Parser::ParsingContext's default constructorLuke Wilde
This relied on pulling the current realm from the main thread VM, which requires an execution context to be on the VM's stack. This heavily relied on the dummy execution context that is always on the stack, for example, when parsing the UA style sheets where no JavaScript is running.
2023-03-06Everywhere: Stop using NonnullRefPtrVectorAndreas Kling
This class had slightly confusing semantics and the added weirdness doesn't seem worth it just so we can say "." instead of "->" when iterating over a vector of NNRPs. This patch replaces NonnullRefPtrVector<T> with Vector<NNRP<T>>.
2023-03-06Lagom: Add a tool to verify correctness of the LibJS GCMatthew Olsson
This is implemented as a Clang frontend tool, and currently does two things: - Ensure for all fields wrapped in {Nonnull,}GCPtr<T>, T inherits from JS::Cell - Ensure for all fields not wrapped in {Nonnull,}GCPtr, that the type does not inherit from JS::Cell (otherwise it should be wrapped in a Ptr class). In the future, this tool could be extended further. For example, we may consider validating all implementations of Cell::visit_impl.
2023-03-05LibCore+Everywhere: Return an Error from DirIterator::error()Sam Atkins
This also removes DirIterator::error_string(), since the same strerror() string will be included when you print the Error itself. Except in `ls` which is still using fprintf() for now.
2023-03-05LibUnicode: Use binary search for lookups into the generated emoji dataTimothy Flynn
This sorts the array of generated emoji data by code point (first by code point length, then by code point value). This lets us use a binary search to find emoji data, rather than the current linear search. In a profile of scrolling around /home/anon/Documents/emoji.txt, this reduces the runtime of Gfx::Emoji::emoji_for_code_points from 69.03% to 28.42%. Within that, Unicode::find_emoji_for_code_points reduces from 28.42% to just 1.95%.
2023-03-05LibWeb: Remove unused SourceGenerator mappingsLinus Groh
2023-03-05LibWeb: Don't use C++ name for error messages in generated bindingsLinus Groh
2023-03-05LibWeb: Use 'Base::initialize()' in generated bindingsLinus Groh
2023-03-04Meta: Link to libnsl and libsocket on Solaris in Lagom CMakeListsnipos
2023-03-03LibUnicode: Validate that all emoji images in /res/emoji actually existTimothy Flynn
This will raise a compile error if an emoji image was neglected to be added to e.g. emoji-serenity.txt, or if the code points are not correct.
2023-03-03LibWeb: Fix duplicate enum-to-string conversion in generated codeLinus Groh
This regressed in e3a9ed0.
2023-03-01LibWeb: Handle optional return values for getters returning new StringKenneth Myhra
2023-03-01LibWeb: Add new String support for parameters with empty string defaultsKenneth Myhra
This adds new string support for parameters with an optional default value of empty string ("").
2023-03-01LibGfx+LibUnicode: Support specifying the path to search for emojiTimothy Flynn
Similar to the FontDatabase, this will be needed for Ladybird to find emoji images. We now generate just the file name of emoji image in LibUnicode, and look for that file in the specified path (defaulting to /res/emoji) at runtime.
2023-02-28Everywhere: Use '_{short_,}string' literals moreLinus Groh
This mostly updates code what was written before but merged after these were added.
2023-02-28AK+Everywhere: Make GenericLexer::ignore_until() stop before the valueSam Atkins
`consume_until(foo)` stops before foo, and so does `ignore_until(Predicate)`, so let's make the other `ignore_until()` overloads consistent with that so they're less confusing.
2023-02-28Userland+AK: Stop using getopt() for ArgsParserAli Mohammad Pur
This commit moves the implementation of getopt into AK, and converts its API to understand and use StringView instead of char*. Everything else is caught in the crossfire of making Option::accept_value() take a StringView instead of a char const*. With this, we must now pass a Span<StringView> to ArgsParser::parse(), applications using LibMain are unaffected, but anything not using that or taking its own argc/argv has to construct a Vector<StringView> for this method.
2023-02-27LibWeb: Make [UseNewAKString] work for enums and stringifiersLuke Wilde
2023-02-26Lagom: Look for clang the same way serenity.sh does in BuildFuzzers.shAndrew Kaster
Also note that Xcode does not ship libfuzzer and is not usable for a fuzzer build.
2023-02-26LibWasm+LibWeb: Sneak a JS::Completion into Wasm::ResultAli Mohammad Pur
Imported functions in Wasm may throw JS exceptions, and we need to preserve these exceptions so we can pass them to the calling JS code. This also adds a `assert_wasm_result()` API to Result for cases where only Wasm traps or values are expected (e.g. internal uses) to avoid making LibWasm (pointlessly) handle JS exceptions that will never show up in reality.
2023-02-26BindingsGenerator: Use JS::Value::to_string() when new StringKenneth Myhra
Make sure to use JS::Value::to_string() when the IDL interface is marked with the extended attribute UseNewAKString.
2023-02-26BindingsGenerator: Conditionally check dictionary member is stringKenneth Myhra
This adds the condition member.type->is_string() to the if statement, so that we now conditionally check the dictionary member is a new string and associated with an optional constructor parameter.
2023-02-25Everywhere: Use _{short_,}string to create Strings from literalsLinus Groh
2023-02-25Meta: Document how to manipulate CMake caches for the fuzzing buildkleines Filmröllchen