summaryrefslogtreecommitdiff
path: root/Tests
AgeCommit message (Collapse)Author
2023-05-27LibWeb: Support grid items with fit-content width :^)Andreas Kling
2023-05-27LibWeb: Add basic parsing of grid shorthand CSS propertyAliaksandr Kalenik
Introduces incomplete parsing of grid shorthand property. Only <grid-template> part of syntax is supported for now but it is enough to significantly improve rendering of websites that use this shorthand to define grid :)
2023-05-26LibWeb: Fix width calculation for floating replaced elementsAndi Gallo
The path for floating, replaced elements must not fall through to the path taken for floating, non-replaced elements. The former works like inline replaced elements, while the latter uses a completely different algorithm which doesn't account for intrinsic ratio. Falling through overrides the correct value computed by the former. Fixes #19061.
2023-05-26LibWeb: Reset margin collapsing state only if box indeed add clearanceAliaksandr Kalenik
This fixes the issue when margin collapsing state was always reset if a box has clear property not equal to none even if it does not actually introduce clearance.
2023-05-26LibWeb: Consume sign in `SVG::parse_elliptical_arg_argument`Cameron Youell
This was crashing on google.com with the linux chrome user agent, interestingly it seems like this behavior may have been accidental as only two of the three `parse_number()` were changed in f7dbcb6
2023-05-26LibWeb: Get reference height from closest non-anonymous ancestorAndi Gallo
Ignore anonymous block boxes when resolving percentage weights that would refer to them, per the CSS 2 visual formatting model specification. This fixes the case when we create an anonymous block between an image which uses a percentage height relative to a parent which specifies a definite height. Fixes #19052.
2023-05-25LibSQL: Free heap storage when deleting rowsJelle Raaijmakers
2023-05-25LibSQL: Implement freeing heap storageJelle Raaijmakers
This allows us to free entire chains of blocks in one go.
2023-05-25LibSQL: Find free blocks when opening a database fileJelle Raaijmakers
The free block list now gets populated on opening a database file. Ideally we persist this list inside the heap itself, but for now this prevents excessive heap growth.
2023-05-25LibSQL: Keep track of free heap blocks when trimming storageJelle Raaijmakers
When overwriting existing heap storage that requires fewer blocks, make sure to free all remaining blocks so they can be reused in the future.
2023-05-25LibSQL: Reuse heap blocks when overwriting storageJelle Raaijmakers
Previously, only the first block in a chain of blocks would be overwritten while all subsequent blocks would be appended to the heap. Now we make sure to reuse all existing blocks in the chain.
2023-05-25LibSQL: Test `SQL::Heap` separatelyJelle Raaijmakers
Move the long storage test from TestSqlStatementExecution into a new test unit called TestSqlHeap. Split it up into a flushed and non-flushed variant so we test the write-ahead log as well.
2023-05-25LibSQL: Clean up TestSqlDatabaseJelle Raaijmakers
Missing imports, make methods static. No functional changes.
2023-05-25LibWeb: Make input element placeholders look betterAndreas Kling
We now create a flex container inside the input element's UA shadow tree and add the placeholder and non-placeholder text as flex items (wrapped in elements whose style we can manipulate). This fixes the visual glitch where the placeholder would appear below the bounding box of the input element. It also allows us to align the text vertically inside the input element (like we're supposed to). In order to achieve this, I had to make two small architectural changes to layout tree building: - Elements can now report that they represent a given pseudo element. This allows us to instantiate the ::placeholder pseudo element as an actual DOM element inside the input element's UA shadow tree. - We no longer create a separate layout node for the shadow root itself. Instead, children of the shadow root are treated as if they were children of the DOM element itself for the purpose of layout tree building.
2023-05-25LibWeb: Make `value_id_from_string()` return OptionalSam Atkins
2023-05-24LibTimeZone+Userland: Change timezone functions to use UnixDateTimekleines Filmröllchen
This incurs a whole host of changes in, among others, JavaScript Intl and Date.
2023-05-24AK: Rename Time to Durationkleines Filmröllchen
That's what this class really is; in fact that's what the first line of the comment says it is. This commit does not rename the main files, since those will contain other time-related classes in a little bit.
2023-05-24LibWeb: Sum horizontal margins to calculate space used by floatsAliaksandr Kalenik
This fixes the issue where max margin is used to find offset of floating box although horizonal margins do not collapse so they need to be summed instead.
2023-05-24LibWeb: Remove `Gfx::Rect<float>` workarounds from BFCJelle Raaijmakers
No longer is the last horizontal line of pixels ignored during layout. This used to be a bug in `Gfx::Rect<float>` that was fixed in f391ccfe53e18395842d0d6b743d08d23b9108e5.
2023-05-24LibWeb: Make CSSPixels and Length use 64-bit (double) floating pointAndreas Kling
This fixes a plethora of rounding problems on many websites. In the future, we may want to replace this with fixed-point arithmetic (bug #18566) for performance (and consistency with other engines), but in the meantime this makes the web look a bit better. :^) There's a lot more things that could be converted to doubles, which would reduce the amount of casting necessary in this patch. We can do that incrementally, however.
2023-05-24LibWeb: Rebaseline a layout test after 10ceacf5fb6ef8cea7c90958470515d5b386c50bAndreas Kling
2023-05-24LibGfx: Prevent out of bounds access when scaling small BitmapsDarius Arnold
Since the color interpolation requires two pixels in the horizontal and vertical direction to work, 1 pixel wide or high bitmaps would cause a crash when scaling. Fix this by clamping the index into the valid range. Fixes #16047.
2023-05-24LibWeb: Resolve CSS variables if present in SVG presentation attributesAndreas Kling
SVG presentation attributes are parsed as CSS values, so we also need to handle CSS variable expansion when handling them. This (roughly) matches the behavior of other engines. It's also used on the web, for example on https://stripe.com/ :^)
2023-05-24LibThreading: Improve resiliancy of timed threading testsTimothy Flynn
The threading tests currently wait for a very small amount of time for the expected test condition to be reached, e.g. 20ms. This changes the tests to *check* the condition every 20ms, but allow the test to run for up to 2s until the condition is reached. This should hopefully resolve the failures seen on CI. This also renames one of the tests to match what it actually does. The test itself was changed in commit 5b335e7, but the name was not updated to reflect that change.
2023-05-23LibGfx+Everywhere: Change `Gfx::Rect` to be endpoint exclusiveJelle Raaijmakers
Previously, calling `.right()` on a `Gfx::Rect` would return the last column's coordinate still inside the rectangle, or `left + width - 1`. This is called 'endpoint inclusive' and does not make a lot of sense for `Gfx::Rect<float>` where a rectangle of width 5 at position (0, 0) would return 4 as its right side. This same problem exists for `.bottom()`. This changes `Gfx::Rect` to be endpoint exclusive, which gives us the nice property that `width = right - left` and `height = bottom - top`. It enables us to treat `Gfx::Rect<int>` and `Gfx::Rect<float>` exactly the same. All users of `Gfx::Rect` have been updated accordingly.
2023-05-22LibWeb: Make sure collapsed margins are not ignored if box creates FCAliaksandr Kalenik
Fixes a bug that if box creates new formatting context then all already collapsed margins are ignored and only margin_top is used.
2023-05-22LibWeb: Propagate children_are_inline in wrap_in_anonymousAndi Gallo
This fixes a crash in box_baseline, due to cells created for display: table expecting a box child and getting the inline node wrapper instead. Fixes #18972.
2023-05-22LibWeb: Support grid-auto-columns and grid-auto-rows properties in GFCAliaksandr Kalenik
Implements assignment of sizes specified in grid-auto-columns/rows for implicitly created tracks.
2023-05-21LibWeb: Implement table rowspanAndi Gallo
Adjust computing the table height and positioning of cells to account for the rowspan property. Fixes #18952.
2023-05-21LibWeb: Don't crash on percentage values for CSS stroke-widthAndreas Kling
Fixes a crash when loading https://vercel.com/
2023-05-21LibWeb: Implement more of spanning tracks sizing in GFCAliaksandr Kalenik
Implements more parts of sizing algorithm for tracks with spanning items to archive parity with implementation for sizing of tracks with non-spanning items.
2023-05-21LibWeb: Include SVG-as-image isolated contexts in layout/DOM tree dumpsAndreas Kling
This allows us to see the inside of SVG-as-image in layout tests. :^)
2023-05-21LibWeb: Add a very basic test for SVG-as-imageAndreas Kling
This mainly just checks that we load the file and learn the correct intrinsic aspect ratio from the external SVG.
2023-05-20LibWeb: Support <svg> elements with `display: block`Andreas Kling
There are a couple of things that went into this: - We now calculate the intrinsic width/height and aspect ratio of <svg> elements based on the spec algorithm instead of our previous ad-hoc guesswork solution. - Replaced elements with automatic size and intrinsic aspect ratio but no intrinsic dimensions are now sized with the stretch-fit width formula. - We take care to assign both used width and used height to <svg> elements before running their SVG formatting contexts. This ensures that the inside SVG content is laid out with knowledge of its viewport geometry. - We avoid infinite recursion in tentative_height_for_replaced_element() by using the already-calculated used width instead of calling the function that calculates the used width (since that may call us right back again).
2023-05-19LibCompress: Handle arbitrarily long FF-chains in the LZMA encoderTim Schumacher
2023-05-19AK: Rewrite HashMap::clone signature with template-args and constBen Wiederhake
2023-05-19LibWeb: Fix null dereference on SVG element with bogus fill URLAndreas Kling
Fixes a crash seen on YouTube channel pages.
2023-05-19LibWeb: Make sure that margins don't collapse across a nested BFCAndreas Kling
In order to fix this, I also had to reorganize the code so that we create an independent formatting context even for block-level boxes that don't have any children. This accidentally improves a table layout test as well (for empty tables).
2023-05-19LibWeb: Resolve grid item fixed size paddings in GFCAliaksandr Kalenik
Adds support for grid items with fixed size paddings. Supporting percentage paddings will probably require to do second pass of tracks layout: second pass is needed to recalculate tracks sizes when final items sizes are known when percentage paddings are already resolved.
2023-05-18LibWeb: Use grid item used width as available width during track sizingAliaksandr Kalenik
This change addresses the incorrect assumption that the available width inside a grid item is equal to the width of the track it belongs to. For instance, if a grid item has a width of 200px, the available width inside that item is also 200px regardless of its column(s) base size. To solve this issue, it was necessary to move the final resolution of grid items to occur immediately after the final column track sizes are determined. By doing so, it becomes possible to obtain correct available width inside grid items while resolving the row track sizes.
2023-05-17LibWeb: Resolve CSS custom properties on pseudo elementsAndreas Kling
The resolved property sets are stored with the element in a per-pseudo-element array (same as for pseudo element layout nodes). Longer term, we should stop storing this with elements entirely and make it temporary state in StyleComputer somehow, so we don't waste memory keeping all the resolved properties around. This makes various gradients show up on https://shopify.com/ :^)
2023-05-17LibWeb: Consider span > 1 while getting available space for items in GFCAliaksandr Kalenik
2023-05-17LibWeb: Remove borders from TemporaryTrack in GFCAliaksandr Kalenik
This change makes grid items be responsible for their borders instead of grid tracks which can not have borders itself. There are changes in layout tests but those are improvements :)
2023-05-17Tests: Add an LZMA roundtrip compression testTim Schumacher
2023-05-17AK: Add `CircularBuffer::find_copy_in_seekback()`Tim Schumacher
This is useful for compressors, which quite frequently need to find a matching span of data within the seekback.
2023-05-17AK: Add `count_required_bits`Tim Schumacher
2023-05-17LibWeb: Use auto minimimum size while resolving flexible tracks in GFCAliaksandr Kalenik
2023-05-17LibWeb: Skip non-spanning items sizing if there are no such itemsAliaksandr Kalenik
Otherwise base_size and growth_limit for tracks that do not have any spanning items will be overriden with wrong values.
2023-05-17LibWeb: Implement more of "Expand Flexible Tracks" in GFCAliaksandr Kalenik
Implements "Otherwise, if the free space is an indefinite length:" from the spec.
2023-05-17LibWeb: Support flex-basis: calc(...)Andreas Kling
1. Propagate calc() values from StyleProperties to ComputedValues. 2. Actually resolve calc() values when determining the used flex basis. This makes the "support" section on https://shopify.com/ show up correctly as a 2x2 grid (instead of 1x4). :^)