summaryrefslogtreecommitdiff
path: root/Tests
AgeCommit message (Collapse)Author
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). :^)
2023-05-17LibWeb: Fix off-by-one in CSS calc() "negate" operationAndreas Kling
When negating a number, we should subtract it from 0, not 1. :^)
2023-05-16LibWeb: Make text justification work between floatsAndreas Kling
While inline content between floating elements was broken correctly, text justification was still using the original amount of available space (without accounting for floats) when justifying fragments.
2023-05-16LibWeb: Rewrite calculation of available space between floatsAndreas Kling
This code now works in terms of *intrusion* by left and right side floats into a given box whose insides we're trying to layout. Previously, it worked in terms of space occupied by floats in the root box of the BFC they participated in. That created a bunch of edge cases since the code asking about the information wasn't operating in root coordinate space, but in the coordinate space of some arbitrarily nested block descendant of the root. This finally allows horizontal margins in the containing block chain to affect floats and nested content correctly, and it also allows us to remove a bogus workaround in InlineFormattingContext.
2023-05-16LibWeb: Fix for absolutely positioned elements with specified heightAndi Gallo
Use inner height since the paintable adds padding back. Fixes #18842.
2023-05-16LibWeb: Reset item_incurred_increase before distributing space in GFCAliaksandr Kalenik
item_incurred_increase should be reset before every next distirbution because otherwise it will accumulate increases from previous distributions which is not supposed to happen.
2023-05-15LibWeb: Basic support for CSS `text-indent: <length-percentage>`Andreas Kling
Note that this simple form of text-indent only affects the first line of formatted content in each block. Percentages are resolved against the width of the block.
2023-05-14Tests: Prefer TRY_OR_FAIL() and MUST() over EXPECT(!.is_error())Ben Wiederhake
Note that in some cases (in particular SQL::Result and PDFErrorOr), there is no Formatter defined for the error type, hence TRY_OR_FAIL cannot work as-is. Furthermore, this commit leaves untouched the places where MUST could be replaced by TRY_OR_FAIL. Inspired by: https://github.com/SerenityOS/serenity/pull/18710#discussion_r1186892445
2023-05-14LibWeb: Start implementing sizing for tracks with span > 1 items in GFCAliaksandr Kalenik
Partially implements: - Increase sizes to accommodate spanning items crossing content-sized tracks - Increase sizes to accommodate spanning items crossing flexible tracks from https://www.w3.org/TR/css-grid-2/#algo-content
2023-05-14LibWeb: Remove dead code in resolve_intrinsic_track_sizes() in GFCAliaksandr Kalenik
Removes partially implemented algorithm for distributing extra space from spanning item: https://www.w3.org/TR/css-grid-2/#extra-space This algorithm should not be part of resolving track sizing on its own but instead be a subfunction of step 3: https://www.w3.org/TR/css-grid-2/#track-size-max-content-min There are changes in layout tests but those are not regressions.
2023-05-13LibWeb: Flesh out basic support of min-width/height for grid itemsAliaksandr Kalenik
This change brings calculate_minimum_contribution() for grid items and supporting functions.
2023-05-13LibWeb: Return grid container width from automatic_content_width in GFCAliaksandr Kalenik
automatic_content_width() should return grid container width that is supposed to be set by determine_intrinsic_size_of_grid_container().
2023-05-13LibWeb: Implement grid container intrinsic sizes calculationAliaksandr Kalenik
When a width/height constraint is applied to GFC it should set its own width/height to the sum of track sizes according to the spec. Changes in layout tests are improvement over what we had before.
2023-05-12LibGfx+Fuzz: Convert ImageDecoder::initialize to ErrorOrBen Wiederhake
This prevents callers from accidentally discarding the result of initialize(), which was the root cause of this OSS Fuzz bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=55896&q=label%3AProj-serenity&sort=summary
2023-05-11LibWeb: Resolve grid items preferred width in GFCAliaksandr Kalenik
Previously, the width and height of grid items were set to match the size of the grid area they belonged to. With this change, if a grid item has preferred width or height specified to not "auto" value it will be resolved using grid area as containing block and used instead.
2023-05-11LibWeb: Parse calc() function in grid sizesAliaksandr Kalenik
Adds missing part of grid size parsing function to handle calc().
2023-05-10LibWeb: Fix percentage min/max sizes on flex items with intrinsic ratioAndreas Kling
We were resolving percentage values against the containing block size in the wrong axis.
2023-05-10LibWeb: Don't resolve CSS property values for unconnected elementsAndreas Kling
While it's possible to getComputedStyle() on an unconnected element, the resulting object is not supposed to have any values, since we can't resolve style without a document root anyway. This fixes a crash on https://bandcamp.com
2023-05-10LibWeb: Adjust flex item main size through aspect ratio if neededAndreas Kling
If there are min or max size constraints in the cross axis for a flex item that has a desired aspect ratio, we may need to adjust the main size *after* applying the cross size constraints. All the steps to achieving this aren't mentioned in the spec, but it seems that all other browsers behave this way, so we should too.
2023-05-10LibWeb: Implement more of "Resolve Intrinsic Track Sizes" in GFCAliaksandr Kalenik
Implements some parts of "Resolve Intrinsic Track Sizes" algorithm from spec to make it more spec compliant.
2023-05-09LibWeb: Improve handling of min/max constraint violations on imagesAndreas Kling
Instead of bailing after resolving one violated constraint, we have to continue down the list of remaining constraints. We now also call the constraint solver for all replaced elements with "auto" for both width and height. Co-authored-by: 0GreenClover0 <clovers02123@gmail.com>
2023-05-09AK: Add the `Input` word to input-only buffered streamsLucas CHOLLET
This concerns both `BufferedSeekable` and `BufferedFile`.
2023-05-09LibWeb: Initial offset in reverse flex layout moved to opposite sideEmil Militzer
This change moves the initial offset for justify-content: center to the opposite side if the flex layout is in the reverse direction.
2023-05-09Tests: Add tests for 12 bits JPEGsLucas CHOLLET
In this commit, two tests are added, one with a `SOF1` image, the other with a `SOF2`.
2023-05-09LibWeb: Align `GridFormattingContext::run_track_sizing()` with the specAliaksandr Kalenik
1. Stop using -1 to indicate infinity value of growth limit. Just use INFINITY for that. 2. More complete implementation of "Expand Flexible Tracks" step. 3. Return AvailableSize from get_free_space: spec says that this function can return indefinite size and it is ok.
2023-05-09Tests/LibWeb: Split input/grid/minmax.html into smaller testsAliaksandr Kalenik
2023-05-09Tests/LibWeb: Split input/grid/gap.html into smaller testsAliaksandr Kalenik
The file gap.html, which previously had multiple grid tests, has now been divided into smaller files, each containing only one grid test. It is going to make it easier to identify what inputs have been affected by changes in layout code.
2023-05-09Tests/LibWeb: Split input/grid/template-areas.html into smaller testsAliaksandr Kalenik
The file template-areas.html, which previously had multiple grid tests, has now been divided into smaller files, each containing only one grid test. It is going to make it easier to identify what inputs have been affected by changes in layout code. Also this change removes parts of template-areas.html that we can't layout correctly yet.
2023-05-08LibWeb: Stop changing width of block-level flex containers during layoutAndreas Kling
If the parent BFC can come up with a nice stretch-fit width for the flex container, it will have already done so *before* even entering flex layout. There's no need to do it again, midway through the flex layout algorithm. This wasn't just unnecessary, but we were also doing it incorrectly and not taking margins into account when calculating the amount of available space for stretch-fit. This led to oversized flex containers in the presence of negative margins. Fixes #18614
2023-05-08LibWeb: Use layout-test-mode for layout testsmartinfalisse
Also do some test changes to test it out :^)
2023-05-08Tests: Add more tests for `JsonArray`Kemal Zebari
At an attempt to detect future regressions in AK/JsonArray, this snapshot adds additional tests for it to TestJSON.cpp.
2023-05-07Tests/LibGfx: Add some test coverage for animated webp decodingNico Weber
Also add two FIXME comments for lossy decoding.
2023-05-07LibWeb: Set width in `compute_width_for_table_wrapper()`Aliaksandr Kalenik
Width of table wrapper need to be set to to calculate width of table box inside. Otherwise TFC will set wrong width assuming width of containing block is 0.
2023-05-07LibWeb: Enforce min/max height constraints on abspos replaced boxesAndreas Kling
Fixes #18658
2023-05-07Everywhere: Change spelling of 'behaviour' to 'behavior'Ben Wiederhake
"The official project language is American English […]." https://github.com/SerenityOS/serenity/blob/5d2e9156239cd707a22ecea6c87d48e5fc1cbe84/CONTRIBUTING.md?plain=1#L30 Here's a short statistic of the occurrences of the word "behavio(u)r": $ git grep -IPioh 'behaviou?r' | sort | uniq -c | sort -n 2 BEHAVIOR 24 Behaviour 32 behaviour 407 Behavior 992 behavior Therefore, it is clear that "behaviour" (56 occurrences) should be regarded a typo, and "behavior" (1401 occurrences) should be preferred. Note that The occurrences in LibJS are intentionally NOT changed, because there are taken verbatim from the specification. Hence: $ git grep -IPioh 'behaviou?r' | sort | uniq -c | sort -n 2 BEHAVIOR 10 behaviour 24 Behaviour 407 Behavior 1014 behavior
2023-05-07Everywhere: Run spellcheck on all documentationBen Wiederhake
2023-05-06LibWeb: Consolidate track sizing code for rows and columns in GFCAliaksandr Kalenik
Although the algorithm for sizing tracks (rows or columns) is defined once for both dimensions in the specification (https://www.w3.org/TR/css-grid-2/#algo-track-sizing), we have implemented it twice separately for sizing rows and columns. In addition to code duplication, another issue is that these implementations of the same algorithm have already diverged in some places, and this divergence is likely to become even worse as our implementation evolves. This change unifies code for both dimension into one method that runs track sizing. While this change brings a bit of collateral damange (border.html and minmax.html got changes in layout snaphots) it ultimately brings more benefits because now we can evolve layout for both rows and colums without duplicating the code :)
2023-05-05LibWeb: Zero out margins if width is not 'auto' in BFC's compute_width0GreenClover0
Reverse the condition to satisfy the spec comment. Probably a typo. A 3 year old typo! :^)
2023-05-05LibWeb: Remove early resolve to auto while calculating border-box widthAliaksandr Kalenik
`Length::resolved(Node&)` transforms infinite values to "auto". Following transformations: Infinite (Length) -> "auto" -> 0 (px) cause border-box width to be resolved in zero when it should be inf px. Removing `Length::resolved(Node&)` makes it work right: Infinite (Length) -> Infinite (px) Fixes #18649