summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-09-16LibWeb: Improve inline flow around floating boxesAndreas Kling
This patch combines a number of techniques to make inline content flow more correctly around floats: - During inline layout, BFC now lets LineBuilder decide the Y coordinate when inserting a new float. LineBuilder has more information about the currently accumulated line, and can make better breaking decisions. - When inserting a float on one side, and the top of the newly inserted float is below the bottommost float on the opposite side, we now reset the opposite side back to the start of that edge. This improves breaking behavior between opposite-side floats. - After inserting a float during inline layout, we now recalculate the available space on the line, but don't adjust X offsets of already existing fragments. This is handled by update_last_line() anyway, so it was pointless busywork. - When measuring whether a line can fit at a given Y coordinate, we now consider both the top and bottom Y values of the line. This fixes an issue where the bottom part of a line would bleed over other content (since we had only checked that the top Y coordinate of that line would fit.) There are some pretty brain-dead algorithms in here that we need to make smarter, but I didn't want to complicate this any further so I've left FIXMEs about them instead.
2022-09-16LibWeb: Repaint the page immediately when using the mouse to selectAndreas Kling
Otherwise we'd repaint the next time our "caret blink" timer would fire (or something else caused a repaint). This made selection feel sluggish.
2022-09-16LibGfx: Recurse TrueType composite glyphs until a simple glyph is foundEnver Balalic
This fixes a bug in ladybird where it was crashing while rendering characters like őčćž in the Noto Sans Regular font. That font renders those characters as a composite where the caret has numberOfContours = -1. When using the rasterize_impl simple path for that, it would negatively overflow the offsets.
2022-09-16Tests/Kernel: Add tests to ensure we don't regress InodeVMObjectsLiav A
2022-09-16Kernel: Send SIGBUS to threads that use after valid Inode mmaped rangeLiav A
According to Dr. POSIX, we should allow to call mmap on inodes even on ranges that currently don't map to any actual data. Trying to read or write to those ranges should result in SIGBUS being sent to the thread that did violating memory access.
2022-09-16Kernel: Handle mmap requests on zero-length data file inodes safelyLiav A
2022-09-16Kernel/FileSystem: Make Inode::{write,read}_bytes methods non-virtualLiav A
We make these methods non-virtual because we want to ensure we properly enforce locking of the m_inode_lock mutex. Also, for write operations, we want to call prepare_to_write_data before the actual write. The previous design required us to ensure the callers do that at various places which lead to hard-to-find bugs. By moving everything to a place where we call prepare_to_write_data only once, we eliminate a possibilty of forgeting to call it on some code path in the kernel.
2022-09-16Kernel/FileSystem: Mark ext2 inode block list non-constLiav A
The block list required a bit of work, and now the only method being declared const to bypass its const-iness is the read_bytes method that calls a new method called compute_block_list_with_exclusive_locking that takes care of proper locking before trying to update the block list data of the ext2 inode.
2022-09-16Kernel/FileSystem: Mark ext2 inode lookup cache non-constLiav A
For the lookup cache, no method being declared const tried to modify it, so it was easy to drop the mutable declaration on the HashMap member.
2022-09-16Lagom: Skip IMPORTED targets in get_linked_lagom_librariesAndrew Kaster
This script is useful when wanting to install lagom libraries for projects using Lagom via FetchContent, but trips over itself if the project links other non-Lagom imported targets to itself. So, let's just skip them.
2022-09-16Base: Add a `backdrop-filter` demo web pageMacDue
2022-09-16LibWeb: Paint `backdrop-filter` effects!MacDue
This implements all the filters other than `saturate()`, `hue-rotate()`, and `drop-shadow()`. There are still a lot of FIXMEs to handle in the actual implementation though, particularly around supporting transforms, but this handles the most common use cases :^)
2022-09-16LibGfx: Support getting a bitmap for a region of painterMacDue
This will be needed so we can apply filter effects to the backdrop of an element in LibWeb. This now also allows getting a crop of a bitmap in a different format than the source bitmap. This is for if the painter's bitmap does not have an alpha channel, but you want to ensure the cropped bitmap does.
2022-09-16LibGfx: Add `BrightnessFilter`, `ContrastFilter`, and `OpacityFilter`MacDue
These filters are based off the ones defined in: https://drafts.fxtf.org/filter-effects-1/#supported-filter-functions
2022-09-16LibGfx: Allow applying all color filters with an amountMacDue
This amount can be handled in the filter's implementation or if not it will default to mixing between the new and previous pixel. This behaviour is used for implementing CSS filters that allow stuff like grayscale(70%).
2022-09-16LibWeb+LibGfx: Move premultiplied alpha mixing to color.mixed_with()MacDue
This will be needed for mixing filters in LibGfx (and may be generally useful elsewhere).
2022-09-16LibWeb: Plumb style/computed values for `backdrop-filter`MacDue
2022-09-16LibWeb+Meta: Parse the `backdrop-filter` CSS propertyMacDue
Note: The parsing and style value completely ignores the SVG filters part of the spec for now... That's a yak for another day :^)
2022-09-16LibWeb: Add FilterValueListStyleValueMacDue
This style value holds a list of CSS filter function calls e.g. blur(10px) invert() grayscale() It will be used to implement backdrop-filter, but the same style value can be used for the image filter property. (The name is a little awkward but it's referenced to as filter-value-list in the spec too).
2022-09-16LibWeb: Add operator== to CSS::NumberMacDue
This will be needed for the .equals() function of the backdrop-filter style value.
2022-09-16LibWeb: Add NumberPercentage CSS typeMacDue
This type is used quite a bit in CSS filters.
2022-09-16Meta: Use is_abstract_image() for the "image" CSS typeMacDue
2022-09-16LibWeb: Pass values by reference in style value operator== functionsMacDue
2022-09-16CMake: Use `-static-libstdc++` on Clang as wellTim Schumacher
This resolves an old FIXME that we added ages ago, and our LLVM driver apparently gained support for `-static-libstdc++` somewhere along the way.
2022-09-16LibC: Remove `_aligned_malloc` and `_aligned_free`Tim Schumacher
We now have a proper aligned allocation implementation, and the toolchain patch to make Clang use the intermediary implementation has already been removed in an earlier iteration.
2022-09-16Ports: Remove the duplicated Clang compiler symlinksTim Schumacher
Those have been added to the Clang build script in d4d6f2d945153e9f77c4cfeee12cd0fcc6b72b68, and now that the Clang version has been updated, everyone should have those symlinks already anyways.
2022-09-16Toolchain: Update to LLVM 15.0.0Tim Schumacher
2022-09-16LibJS: Supress an unused bind when wrapping float atomic operationsTim Schumacher
2022-09-16Everywhere: Remove a bunch of dead write-only variablesTim Schumacher
LLVM 15 now warns (and thus errors) about this, and there is really no point in keeping them.
2022-09-16AK: Define both `::nullptr_t` and `std::nullptr_t`Tim Schumacher
LLVM 15 switched around what it's basing its `nullptr_t` definitions on, it's now defining `std::nullptr_t` using `::nullptr_t` instead of the other way around. Work around any errors that result from that by just defining it both in the global namespace as well as in `std` ourselves.
2022-09-16Shell: Fix 'Command:' output for built-in 'time' commandBen Wiederhake
2022-09-15AK+Tests: Don't double-destroy NoAllocationGuard in TestFixedArrayHendiadyoin1
This caused the m_allocation_enabled_previously member to be technically uninitialized when the compiler emits the implicit destructor call for stack allocated classes. This was pointed out by gcc on lagom builds, no clue how this was flying under the radar for so long and is not triggering CI.
2022-09-15Base: Add 13 emojiJoel Hansen
U+1F3A4 - Microphone U+1F3D7 - Crane U+1F4BC - Briefcase U+1F4BD - Computer Disk U+1F4DC - Scroll U+1F6CF - Bed U+1F6D1 - Stop Sign U+1F9A2 - Swan U+1F37D - Plate with knife and fork U+1F96A - Sandwich U+1F438 - Frog U+1F441 - Eye U+1F489 - Syringe
2022-09-15Base: Add new emojiMykola
Added the :rice_scene: emoji, also known as "Moon Viewing Ceremony". Additionally added the :ocean: emoji, the :thread: emoji, and the :bridge_at_night: emoji.
2022-09-15LibWeb: Don't set initial font+color on both HTML and BODY elementsAndreas Kling
It's enough to set it on the HTML element. That way, it doesn't get reset in content that sets its own font on HTML but not on BODY.
2022-09-15LibWeb: Cache lowercased names in SimpleSelectorAndreas Kling
When matching selectors in HTML documents, we know that all the elements have lowercase local names already (the parser makes sure of this.) Style sheets still need to remember the original name strings, in case we want to match against non-HTML content like XML/SVG. To make the common HTML case faster, we now cache a lowercase version of the name with each type/class/id SimpleSelector. This makes tag type checks O(1) instead of O(n).
2022-09-15LibWeb: Hoist case sensitivity check out of loop in Element::has_class()Andreas Kling
2022-09-15LibWeb: Resolve cyclic declaration/definitions involving LengthBen Wiederhake
This remained undetected for a long time as HeaderCheck is disabled by default. This commit makes the following file compile again: // file: compile_me.cpp #include <LibWeb/CSS/GridTrackSize.h> // That's it, this was enough to cause a compilation error.
2022-09-15Calculator: Change internal representation to support perfect divisionLucas CHOLLET
The purpose of this patch is to support addition, subtraction, multiplication and division without using conversion to double. To this end, we use the BigFraction class of LibCrypto. With this solution, we can store values without any losses and forward rounding as the last step before displaying.
2022-09-15LibCrypto: Fix -0 and 0 non-equalityLucas CHOLLET
SignedBigInteger::operator==(const UnsignedBigInteger&) was rejecting all negative value before testing for equality. It now accepts negative zero and test for a value equality with the UnsignedBigInteger.
2022-09-15LibCrypto: Add BigFractionLucas CHOLLET
This new abstraction allows the user to store rational numbers with infinite precision.
2022-09-15StringBuilder: Add try_append_repeated() and append_repeated()Lucas CHOLLET
This two methods add the character as many times as specified by the second parameter.
2022-09-15LibCrypto: Add SignedBigInteger::negated_value()Lucas CHOLLET
Return the negated value of the current number.
2022-09-15Meta: Revise lint-commit.sh regex for the titleBen Wiederhake
This mainly changes two aspects: - The category can now be a single letter, such as 'w' to indicate the file Utilities/w.cpp - Spaces in the category (or list) are no longer allowed. This follows the lived practice of writing category lists as "Foo+Bar: Quux" Closes #15243.
2022-09-15LibWeb: Don't ignore data: URLs in @font-face srcAndreas Kling
Since data: URLs don't have a path, we shouldn't be checking for a TTF or WOFF extension. Thanks Timon for pointing this out! :^)
2022-09-15LibGfx: Cache vector fonts by family nameAndreas Kling
Instead of just keeping them in an unsorted Vector, which led to increasingly noticeable O(n) lookups, we now cache a list of Typefaces per family name.
2022-09-15LibCore: Rewrite Core::Stream::read_all_implsin-ack
The previous version relied on manually setting the amount of data to read for the next chunk and was overall unclear. The new version uses the Bytes API to vastly improve readability, and fixes a bug where reading from files where a single read that wasn't of equal size to the block size would cause the byte buffer to be incorrectly resized causing corrupted output.
2022-09-15LibCore: Add documentation to Stream functions + make parameter clearersin-ack
file_size was not very clear about what it was being used for, so I switched it to say expected_file_size to make it clear that it's just a heuristic.
2022-09-15LibWeb: Implement document.domain getterLuke Wilde
The document.domain setter is currently stubbed as that is a doozy to implement, given how much restrictions there are in place to try and prevent use of it and potential multi-process implications. This was the only thing preventing us from being able to start displaying ads delivered via Google Syndication.
2022-09-15Meta: Enable vptr sanitation by default for Lagom UBSAN buildsTimothy Flynn