summaryrefslogtreecommitdiff
path: root/Tests
AgeCommit message (Collapse)Author
2023-03-25LibRegex: Make ^ and $ accept all `LineTerminator`s instead of just '\n'Ali Mohammad Pur
Also adds a couple tests.
2023-03-24Tests/LibCrypto: Test block splitting logic for SHA1/SHA256Jelle Raaijmakers
We were not testing this logic and I caused a regression while modifying some of the hashing code, so let's add these. Note that I only added two tests to test both 'families' of implementations for the SHA hashes.
2023-03-22LibWeb: Support loading file:// URLs via fetch (through ResourceLoader)Andreas Kling
This builds on the existing ad-hoc ResourceLoader code for HTTP fetches which works for files as well. This also includes a test that checks that stylesheets loaded with the "file" URL scheme actually work.
2023-03-21LibGfx: Move all image loaders and writers to a subdirectoryLucas CHOLLET
2023-03-21Everywhere: Use `LibFileSystem` where trivialCameron Youell
2023-03-21Tests: Add XZ tests from XZ utilsTim Schumacher
2023-03-21Tests: Add tests to verify alpha values are premultiplied when scalingTim Ledbetter
2023-03-20LibWeb: Don't crash on HTML input element with `display: inline`Andreas Kling
This would previously assert in InlineFormattingContext because we had an outwardly inline box that wasn't inwardly flow. Fix this by converting text-based input boxes to inline-blocks. This is an ad-hoc solution, and there might be a much better way to solve it.
2023-03-20Tests: Add LZMA test files from the LZMA specificationTim Schumacher
2023-03-19LibWeb: Apply border-radius clip only if overflow hidden for both axisAliaksandr Kalenik
Before this change `apply_clip_overflow_rect` might crash trying to access `clip_rect` that does not have value because we currently support calculation of visible rectangle when `overflow: hidden` is applied for both axis.
2023-03-19Tests: Correct FLAC spec test pathskleines Filmröllchen
This makes the path consistent with Lagom in the next commit, so that the test binary doesn't need special cases for the two platforms.
2023-03-19Tests: Refactor FLAC spec test to not use a TestCase subclasskleines Filmröllchen
The deallocation of the test cases at the very end happens through a NonnullRefPtr<TestCase>, meaning the deallocation will assume the wrong object size and trip up ASAN. Therefore, we cannot use a TestCase subclass. I also took this opportunity and made use of the new LoaderError formatter.
2023-03-18Tests/LibWeb: Add two tests for lh and rlh unitsSimon Wanner
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-17LibJS: Propagate errors from VM creationTimothy Flynn
2023-03-16Tests: Rework TLS test to use new cacert.pemFabian Dellwing
2023-03-16LibGfx: Add test for serialized bytes of built-in sRGB profileNico Weber
2023-03-16LibWeb: Don't drop single <br/> linesMathis Wiehl
Previously, when having inline contexts consisting of just a `<br/>` tag, we would not create a line box. Ensure that there is always a line box when a line is explicitly being broken and also ensure it won't be trimmed due to being empty. This will a fix a number of sites that use `<br>` tags for layouts between block elements (even though the spec says they shouldn't).
2023-03-15AK: Clear OrderedHashTable previous/next pointers on removalJelle Raaijmakers
With Clang, the previous/next pointers in buckets of an `OrderedHashTable` are not cleared when a bucket is being shifted up as a result of a removed bucket. As a result, an unfortunate pointer mixup could lead to an infinite loop in the `HashTable` iterator, which was exposed in `HashMap::keys()`. Co-authored-by: Luke Wilde <lukew@serenityos.org>
2023-03-15Tests/LibWeb: Add ACID1 as a layout testAndreas Kling
This will help us catch any future regressions immediately.
2023-03-15LibWeb: Make sure `float: left` boxes get pushed down if they can't fitAndreas Kling
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/Tests: Remove image from a testAndreas Kling
The image made the test flaky when running on my machine, so this doesn't seem safe at the moment. We can just hardcode the dimensions. Eventually we should make it possible to use external images in tests, but for now let's not flake up the CI.
2023-03-14LibWeb: Consider margins of atomic inlines in layoutMathis Wiehl
According to CSS Inline Layout Module Level 3 § 2.2 Step 1. atomic inlines should be layed out in a line box based on their margin box. However, up until this patch we were unconditionally considering only the border box during line box height calculation. This made us essentially drop all vertical margins for atomic inlines.
2023-03-13Everywhere: Remove unintentional partial stream reads and writesTim Schumacher
2023-03-13AK: Rename Stream::write_entire_buffer to Stream::write_until_depletedTim Schumacher
No functional changes.
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-13LibWeb: Run LibWeb layout tests using headless-browserTimothy Flynn
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-12LibWeb: Resolve percentage line-height values before CSS inheritanceAndreas Kling
Percentage line-height values are relative to 1em (i.e the font-size of the element). We have to resolve their computed values before proceeding with inheritance.
2023-03-12LibWeb: Actually incorporate style from imported style sheetsAndreas Kling
2023-03-12Tests/LibWeb: Only care about *.html files in layout test runnerAndreas Kling
2023-03-12LibWeb: Consider entire stack of floated boxes when floating new boxAndreas Kling
If normal flow layout has caused us to progress past the current innermost float in the block axis, we still need to consider the floats stacked outside of it. Fix this by always walking the currently stacked floats from innermost to outermost when placing new floats.
2023-03-12LibGfx: Make QOIWriter use ErrorOrNico Weber
In addition to it now handling allocation failures, the encode() API is now consistent with PNGWriter.
2023-03-11LibWeb: Don't touch flex items after they we've been frozenAndreas Kling
When using the flex shrink factor, the flexible length resolution algorithm was incorrectly ignoring the `frozen` flag on items and would update the same items again, causing overconsumption of the remaining free space on the flex line.
2023-03-11LibWeb: Collapse margin-left with space used by left-side floatsAndreas Kling
We had an issue where boxes with margin-left were shifted right by left-side floats twice instead of just once.
2023-03-11LibWeb: Don't overflow flex containers on margin autoMathis Wiehl
In case flex items had `margin: auto` on the primary flex axis, we were still also distributing remaining space according to `justify-content` rules. This lead to duplicated spacing in various places and overflows. It looks like this issue was observed previously but missidentified because there was logic to ignore margins at the start and end which would partially paper over the root cause. However this created other bugs (like for example not having a margin at beginning and end ;-)) and I can find nothing in the spec or other browser behaviour that indicates that this is something that should be done. Now we skip justify-content space distribution alltogether if it has already been distributed to auto margins.
2023-03-10Tests: Add a test for JPEGs with RGB componentsLucas CHOLLET
2023-03-10Tests/LibWeb: Use SerenitySans in new layout testsAndreas Kling
This ensures consistent font metrics no matter which platform fonts are available.
2023-03-10LibWeb: Rewrite FFC "resolve flexible lengths" algorithm from draft specAndreas Kling
The draft CSS-FLEXBOX-1 spec had a more detailed description of this algorithm, so let's use that as our basis for the implementation. Test by Aliaksandr. :^)
2023-03-10LibWeb: Show layout test failure diffs in unified format (diff -u)Andreas Kling
2023-03-10LibWeb: Fix bogus min/max-height for box-sizing:border-box flex itemsAndreas Kling
When resolving these constraints to CSS pixel sizes, we have to resolve padding-top and padding-bottom against the flex container's *width*, not its height.
2023-03-10LibWeb: Fix bogus percentage vertical padding with box-sizing:border-boxAndreas Kling
The padding-top and padding-bottom properties are relative to the *width* of the containing block, not the height. It's funny how we keep making this same mistake again and again. :^)
2023-03-09LibIMAP: Propagate OOM errors from decode_quoted_printable()Linus Groh
2023-03-08AK+LibUnicode: Implement String::equals_ignoring_case without allocatingTimothy Flynn
We currently fully casefold the left- and right-hand sides to compare two strings with case-insensitivity. Now, we casefold one code point at a time, storing the result in a view for comparison, until we exhaust both strings.
2023-03-08AK: Make String::contains(code_point) handle non-ASCIITimothy Flynn
We currently only accept a char, instead of a full code point.
2023-03-08AK: Make String::{starts,ends}_with(code_point) handle non-ASCIITimothy Flynn
We currently pass the code point to StringView::{starts,ends}_with, which actually accepts a single char, thus cannot handle non-ASCII code points.
2023-03-06Everywhere: Remove NonnullOwnPtr.h includesAndreas Kling
2023-03-06Everywhere: Stop using NonnullOwnPtrVectorAndreas Kling
Same as NonnullRefPtrVector: weird semantics, questionable benefits.