summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-03-19LibAudio: Improve FLAC seekingkleines Filmröllchen
"Improve" is an understatement, since this commit makes all FLAC files seek without errors, mostly with high accuracy, and partially even fast: - A new generic seek table type is introduced, which keeps an always-sorted list of seek points, which allows it to use binary search and fast insertion. - Automatic seek points are inserted according to two heuristics (distance between seek points and minimum seek precision), which not only builds a seek table for already-played sections of the file, but improves seek precision even for files with an existing seek table. - Manual seeking by skipping frames works properly now and is still used as a last resort.
2023-03-19Meta: Use non-VGA VirtIO GPU variants when running on macOSLiav A
It appears that QEMU on macOS doesn't have the VirtIO GPU variants that support VGA functionality. Those variants are not especially important to us, because we don't use any kind of VGA functionality in our kernel anyway. Therefore, for macOS, we could decide to use virtio-gpu-gl-pci and virtio-gpu-pci devices instead.
2023-03-19Kernel/Graphics: Use longer timeout settings in VirtIO GPU commandsLiav A
It appeared that we sometimes failed to invoke synchronous commands on the GPU. To temporarily fix this, wait 10 milliseconds for commands to complete before failing.
2023-03-19Kernel: Simplify VirtIOGPU attach_physical_range_to_framebuffer methodLiav A
According to the specification, modesetting can be invoked with no need for flushing the framebuffer nor with DMA to transfer the framebuffer rendering.
2023-03-19Kernel/VirtIO: Ignore the VIRTIO_PCI_CAP_PCI_CFG configuration typeLiav A
This configuration exposes a suboptimal mechanism to access other VirtIO device configurations. It is also the only configuration to use a zero length for a configuration structure, and specify a valid BAR which triggered a kernel panic when attaching a virtio-gpu-pci device before 95b15e49010299902abd2aa65bcc71e4158b7326 was applied. The real solution for that problem is to ignore this configuration type because we never actually use it. It means that we can VERIFY that all other configuration types have a valid length, as being expected.
2023-03-19Meta: Move global VM creation to fuzzer "global" structureTimothy Flynn
Turns out LLVMFuzzerTestOneInput may be called more than once per process.
2023-03-19FileManager: Extract .zip files to a temporary folder when openedCaoimhe
Prior to this commit, when you double-click a .zip file to open it, it gets opened in Text-Editor as there is no other file association. Now, when FileManager is invoked with a .zip file as the first argument, a temporary directory will be created and the .zip will be extracted into it. Once the FileManager window is closed, Core::TempFile will delete the temporary directory. This adds something like what we see in other operating systems' file explorers, except for the fact that most other operating systems will treat the .zip file as its own independent read-only filesystem. It would be nice to do that in the future, but I feel like this is sufficient for now.
2023-03-19LibCore: Improve the `TempFile` wrapperCaoimhe
- We were using primitive versions of mkstemp and mkdtemp, they have been converted to use LibCore::System. - If an error occurred whilst creating a temporary directory or file, it was thrown and the program would crash. Now, we use ErrorOr<T> so that the caller can handle the error accordingly - The `Type` enumeration has been made private, and `create_temp` has been "split" (although rewritten) into create_temp_directory and create_temp_file. The old pattern of TempFile::create_temp(Type::File) felt a bit awkward, and TempFile::create_temp_file() feels a bit nicer to use! :^) Once the Core::Filesystem PR is merged (#17789), it would be better for this helper to be merged in with that. But until then, this is a nice improvement.
2023-03-19LibCore: Add syscall wrapper for `mkdtemp()`Caoimhe
2023-03-18LibWeb: Add temporary hack for `line-height: calc(...)`Andreas Kling
At the moment, we can't resolve CSS calc() values without having a LayoutNode. The new StyleProperties::line_height() overload was trying to do exactly that, which led to an assertion. This patch makes `line-height: calc(...)` behave the same as `line-height: normal` for now and adds a FIXME.
2023-03-18LibWeb: Don't deref HTMLInputElement parent if its nullMathis Wiehl
Don't crash in case the elements parent is null.
2023-03-18LibWeb: Honor `pointer-events: none` when hitting a PaintableBoxAndreas Kling
If the PaintableBox had children, but we didn't hit any of them, we default to saying that you hit the PaintableBox itself. However, if said PaintableBox has `pointer-events: none`, we should say nothing was hit, so that the hit testing can continue. This fixes an issue where Discord server icons were not clickable.
2023-03-18LibWeb: Traverse shadow boundaries when looking for focus candidatesAndreas Kling
This makes focusing input fields by clicking on them work. Fixes #17801
2023-03-18LibWeb+Browser+Ladybird: Add menu action to dump paint treeAndreas Kling
2023-03-18LibWeb: Specify height as 1lh to fix the size of empty text boxesSimon Wanner
Previously, empty text boxes would fall back to the min-height: 16px set on the <input> element. As soon as there is any content they would usually gain height because the line height of that text is more than 16px (depending on the font/font-size used). Now they use height: 1lh for the inner div (which contains the actual text), which matches the exact height of 1 line of content.
2023-03-18LibWeb+LibWebView: Show shadow roots in the DOM inspectorSimon Wanner
2023-03-18Tests/LibWeb: Add two tests for lh and rlh unitsSimon Wanner
2023-03-18LibWeb: Add support for the lh and rlh length unitsSimon Wanner
Resolving these units is somewhat tricky because of their interaction with both font-size and line-height, but this implementation seems to work as tested in http://wpt.live/css/css-values/lh-unit-001.html and http://wpt.live/css/css-values/lh-unit-002.html
2023-03-18LibWeb: Port MutationRecord types to FlyStringTimothy Flynn
Co-authored-by: Luke Wilde <lukew@serenityos.org>
2023-03-18LibWeb: Initialize static web strings during main-thread VM creationTimothy Flynn
These are currently initialized in a [[gnu::constructor]], which has a weird initialization order. These constructors are invoked before main() and, incidentally, before any user-defined default constructors of the static strings they are initializing. This will become an issue when these strings are ported to FlyString, which has a user-defined default constructor. In that scenario, when the FlyString constructor is executed after the [[gnu::constructor]], the strings will be "reset" to the empty string. Instead of relying on a non-standard compiler extension here, let's just initialize these strings explicitly during main-thread VM creation, as this now happens in WebContent's main().
2023-03-18LibJS: Add a PrimitiveString::create overload for FlyStringTimothy Flynn
This is to disambiguate this type from the StringView overload.
2023-03-18AK: Export FlyString from the forwarding headerTimothy Flynn
2023-03-18LibWeb: Fix bogus callback comparisons in EventTargetAndreas Kling
When CallbackType::callback was converted from Object& to NNGCP<Object>, we started comparing the addresses of NNGCPs instead of the addresses of Objects. That broke the Discord login form, and this patch fixes it. Regression from 7c0c1c8f4969abeec1436346f29081b3afbcdeab.
2023-03-18Meta: Disable the misc-no-recursion check in clang-tidyAndreas Kling
We use recursive algorithms all over the place, and this check makes it hard to read those algorithms in CLion, since it draws squiggles under everything.
2023-03-18LibWeb: Clarify stacking context creation for viewport boxAndreas Kling
Explicitly check is_viewport() instead of looking at the corresponding DOM node. (The viewport has the DOM document as its DOM node, but that's not obvious from context here.)
2023-03-18LibWeb: Invalidate sibling styles on input element checked state changeMathis Wiehl
Checkedness of an input element can influence sibling style, as well as style of their children, when they use the `:checked` pseudo-class in combination with a kind of sibling selector. That means its not sufficient to just invalidate the input elements on style. This is actually more commonly observable than one might expect, because this pattern is often used as a JS-free toggle solution for things like menus.
2023-03-18Fuzzers: Skip trying to parse invalid UTF-8 in LibJS FuzzersAndrew Kaster
Invalid UTF-8 crashes JS::Script::Parse.
2023-03-18LibWeb: Consider deprecated application/font-woff mime typeMathis Wiehl
Though deprecated by IANA, `application/font-woff` is still in active use as a MIME type for WOFF fonts by web servers throughout the wild web.
2023-03-18LibWeb: Load alternative font urls if others failMathis Wiehl
We don't support all parts of the font formats we assume as "supported" in the CSS parser. For example, if an open type font has a CFF table, we reject loading it. This meant that until now, when such an unsupported-supported font url was first in the list of urls, we couldn't load it at all, even when we would support a later url. To resolve that, try loading all font urls one after each other, in case we are not able to load the higher priority one. This also resolves a FIXME related to spec compliant url prioritization. Our CSS parser already filters and prioritizes font src urls in compliance with the spec. However, we still had to resort to brittle file extension matching, because some websites don't set the `format` and if the first url in a src list happened to be one we don't support, the font could not be loaded at all. This now is unnecessary because we can try and discard the urls instead.
2023-03-18LibWeb: Treat flex item's cyclic percentage cross size as autoAndreas Kling
This fixes an issue where e.g `height: 100%` on a flex item whose container has indefinite height was being resolved to 0. It now correctly behaves the same as auto.
2023-03-18LibWeb: Print unimplemented calc() expressions in the debug logAndreas Kling
2023-03-17Userland: Use more common WAV MIME typekleines Filmröllchen
There is no official IANA MIME type for WAV (see https://www.iana.org/assignments/media-types/media-types.xhtml#audio), so this will always be subjective. While https://www.rfc-editor.org/rfc/rfc2361 suggests audio/vnd.wave, we use audio/wav since that seems to be most common across the internet.
2023-03-17LibVT: Fix integer overflow when parsing long OSC sequencesDaniel Bertalan
We were storing indices into OSC escape sequences as `u8`s, which overflow at a length of just 256 characters. This caused a crash when parsing OSC 8 hyperlinks pointing to long filenames.
2023-03-17Meta: Ensure the main thread VM is created before use in the CSS fuzzerTimothy Flynn
2023-03-17LibWeb: Move initialization of the MainThreadVM to WebContent's main()Timothy Flynn
It is a fallible operation, so this lets us abort early if it fails.
2023-03-17LibJS: Propagate errors from VM creationTimothy Flynn
2023-03-17LibJS: Move creation of fallible VM objects to its creation factoryTimothy Flynn
No change of behavior in this patch, but this will allow this factory to propagate any errors from the creation of these objects.
2023-03-17LibWeb: Give generated constructor functions a nameLuke Wilde
Required by code that brand checks native constructors. For example, Wistia brand checks XMLHttpRequest by doing: ``` XMLHttpRequest.prototype.constructor.toString() ``` It then checks if it matches either one of: ``` function XMLHttpRequest() { [native code] } ``` ``` [object XMLHttpRequestConstructor] ``` If neither matches, it disables HLS playback and prints: "The XMLHttpRequest constructor has been tampered with. Because this affects CORS/Range XHR requests, HLS playback has been disabled. To enable HLS playback and other important features, please remove code that changes the definition of window.XMLHttpRequest." We hit this path due to not giving generated constructors a name, as we would provide `function () { [native code] }`.
2023-03-17LibGfx/OpenType: Fix bound-checkgohai
2023-03-17Browser: Have the bookmark button use the editor dialogKemal Zebari
Now when the bookmark button that has not yet bookmarked the current URL is pressed, it will add the bookmark but also prompt the user with the BookmarkEditor dialog in case they wish to make final touches to their bookmark title or URL. If they cancel or escape the dialog, the bookmark will be removed.
2023-03-17Ports/cmake: Update CMake to version 3.26.0EWouters
2023-03-17Toolchain: Update CMake to version 3.26.0 in `BuildCMake.sh`EWouters
2023-03-17LibJS: Fix a bunch of unwind related errors in GenerateCFGHendiadyoin1
We were missing some unwind related control flow paths, and followed some in improper ways, leading us to access a dead unwind frame in some cases, as well as generating a technically wrong CFG. This reorders the ways EnterUnwindContext works and alleviates those errors.
2023-03-17LibGfx/OpenType: Add some initial support for GPOS glyph positioningAndreas Kling
This patch parses enough of GPOS tables to be able to support the kerning information embedded in Inter. Since that specific font only applies positioning offsets to the first glyph in each pair, I was able to get away with not changing our API. Once we start adding support for more sophisticated positioning, we'll need to be able to communicate more than a simple "kerning offset" to the clients of this code.
2023-03-17LibWeb: Fix is<HTML::HTMLProgressElement>() checkMacDue
Previously HTMLProgressElement implemented is_html_input_element() not is_html_progress_element(), so is_html_progress_element() defaulted to always returning false. This broke is<HTML::HTMLProgressElement>().
2023-03-16LibWeb: Remove remaining WebAssemblyObject data to the namespace fileTimothy Flynn
2023-03-16LibWeb: Port the WebAssembly namespace to IDLTimothy Flynn
2023-03-16LibWeb: Add a custom extended attribute for namespace-level GC visitorsTimothy Flynn
Currently, the WebAssemblyObject implements a visitor to keep its static objects alive. This custom attribute will be used to hook the generated namespace object's visitor to one that we define in non-generated code.
2023-03-16LibWeb: More fully implement the LegacyNamespace IDL extended attributeTimothy Flynn
Interfaces with a LegacyNamespace extended attribute should have their constructors defined on the namespace identified by the LegacyNamespace attribute value.
2023-03-16LibWeb: Add LibJS includes to generated IDL namespace filesTimothy Flynn
These will be needed by any namespace having a BufferSource parameter, such as WebAssembly. Similar to 49e6cb7c3d62eeeddf63c5db931038f1aeb58d53.