summaryrefslogtreecommitdiff
path: root/Tests
AgeCommit message (Collapse)Author
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.
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-05Tests: Migrate to Directory::for_each_entry()Sam Atkins
2023-03-05LibUnicode: Detect ZWJ sequences when filtering by emoji presentationTimothy Flynn
This was preventing some unqualified emoji sequences from rendering properly, such as the custom SerenityOS flag. We rendered the flag correctly when given the fully qualified sequence: U+1F3F3 U+FEOF U+200D U+1F41E But were not detecting the unqualified sequence as an emoji when also filtering for emoji-presentation sequences: U+1F3F3 U+200D U+1F41E
2023-03-04AK: Implement Knuth's algorithm D for dividing UFixedBigInt'sDan Klishch
2023-03-04AK: Delete unused and untested sqrt, pow and pow_mod from UFixedBigIntDan Klishch
2023-03-04Tests: Replace test image with my own creationLucas CHOLLET
2023-03-04Tests: Add a test for SOF2 images with only spectral selectionLucas CHOLLET
You can generate one by using `cjpeg` with the -scan argument. This image has been generated with the following scan file: 0 1 2: 0 0 0 0; 0: 1 9 0 0; 2: 1 63 0 0 ; 1: 1 63 0 0 ; 0: 10 63 0 0;
2023-03-03AK: Ensure short String instances are valid UTF-8Timothy Flynn
We are currently only validating long strings.
2023-03-03AK: Invalidate overlong UTF-8 code point encodingsTimothy Flynn
For example, the code point U+002F could be encoded as UTF-8 with the bytes 0x80 0xAF. This trick has historically been used to bypass security checks.
2023-03-03AK: Make FixedPoint(FloatingPoint) ctor round instead of truncatingNico Weber
This is needed to have code for creating an in-memory sRGB profile using the (floating-ppoint) numbers from the sRGB spec and having the fixed-point values in the profile match what they are in other software (such as GIMP). It has the side effect of making the FixedPoint ctor no longer constexpr (which seems fine; nothing was currently relying on that). Some of FixedPoint's member functions don't round yet, which requires tweaking a test.
2023-03-01LibCore+Everywhere: Remove ArgsParser::add*(char const*&)Ali Mohammad Pur
This is not guaranteed to always work correctly as ArgsParser deals in StringViews and might have a non-properly-null-terminated string as a value. As a bonus, using StringView (and DeprecatedString where necessary) leads to nicer looking code too :^)
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-28LibWeb: Rename Layout::InitialContainingBlock to Layout::ViewportAndreas Kling
The name "initial containing block" was wrong for this, as it doesn't correspond to the HTML element, and that's specifically what it's supposed to do! :^)
2023-02-27Tests: Add a test for SOF0 images with several scansLucas CHOLLET
This type of image isn't common, and you can probably only find one by generating it yourself. It can be done using `cjpeg` with the -scan argument. This image has been generated with the following scan file: 0: 0 63 0 0; 1: 0 63 0 0; 2: 0 63 0 0;
2023-02-27Tests: Rename "test_jpg" to "test_jpeg_sof0_one_scan"Lucas CHOLLET
2023-02-26LibGfx: Return bool not ErrorOr<bool> from ImageDecoderPlugin::sniff()MacDue
Nobody made use of the ErrorOr return value and it just added more chance of confusion, since it was not clear if failing to sniff an image should return an error or false. The answer was false, if you returned Error you'd crash the ImageDecoder.
2023-02-26AK: Fix DeprecatedString::bijective_base_from for large numbersTim Ledbetter
The output of the DeprecatedString::bijective_base_from() is now correct for numbers larger than base^2. This makes column names display correctly in Spreadsheet.
2023-02-26LibGfx: Implement WebPImageDecoderPlugin::loop_count()Nico Weber
Turns out extended-lossless-animated.webp did have a loop count of 0. So I opened it in Hex Fiend and changed the byte at position 42 (which is the first byte of the little-endian u16 storing the loop count) to 0x2A, so that the test can compare the loop count to something not 0.