summaryrefslogtreecommitdiff
path: root/Tests/LibWeb/Layout/input
AgeCommit message (Collapse)Author
2023-04-02LibWeb: Add borders functionality to CSS Gridmartinfalisse
2023-04-02LibWeb: Fix regression in definite grid row heightsmartinfalisse
Fixes a row height bug when a grid item in a row has a definite height.
2023-04-02LibWeb: Don't apply presentational hints to associated pseudo elementsAndreas Kling
CSS properties generated by presentational hints in content attributes should not leak into pseudo elements.
2023-04-02LibWeb: Don't apply element inline style to associated pseudo elementsAndreas Kling
An element's inline style, if present, should not leak into any pseudo elements generated by that element.
2023-04-02LibWeb: Fix application of intrinsic aspect ratio to flex column itemsAndreas Kling
The intrinsic aspect ratio of a box is a width:height ratio, so if we have the width and need the height, we should divide, not multiply. :^)
2023-04-01LibWeb: Add display grid automated testsmartinfalisse
2023-03-30LibWeb: Actually visit rules and media queries in imported style sheetsAndreas Kling
Due to CSSImportRule::has_import_result() being backwards, we never actually entered imported style sheets when traversing style rules or media queries. With this fixed, we no longer need the "collect style sheets" step in StyleComputer, as normal for_each_effective_style_rule() will now actually find all the rules. :^)
2023-03-29LibWeb: Resolve percentage vertical-align values against line-heightAndreas Kling
...instead of not resolving them at all. :^)
2023-03-28LibWeb: Clamp fit-content widths in flex layout to min/max-widthAndreas Kling
In situations where we need a width to calculate the intrinsic height of a flex item, we use the fit-content width as a stand-in. However, we also need to clamp it to any min-width and max-width properties present.
2023-03-28Tests/LibWeb: Add layout test for layout fix in PR #15780Luke Wilde
Adds a layout test for the fix in 488a979.
2023-03-27LibWeb: Use fit-content width in place of indefinite flex item widthsAndreas Kling
In `flex-direction: column` layouts, a flex item's intrinsic height may depend on its width, but the width is calculated *after* the intrinsic height is required. Unfortunately, the specification doesn't tell us exactly what to do here (missing inputs to intrinsic sizing is a common problem) so we take the solution that flexbox applies in 9.2.3.C and apply it to all intrinsic height calculations within FlexFormattingContext: if the used width of an item is not yet known when its intrinsic height is requested, we substitute the fit-content width instead. Note that while this is technically ad-hoc, it's basically extrapolating the spec's suggestion in one specific case and using it in all cases.
2023-03-27LibWeb: Fix intrinsic sizing early return condition in TFCAliaksandr Kalenik
Early return before running full TFC algorithm is only possible when just table width need to be calculated.
2023-03-26Tests/LibWeb: Test flex column item with auto height and max-widthAndreas Kling
This case is important because we have to clamp the width before using it to determine the auto height.
2023-03-26Tests/LibWeb: Add test for flex item auto height with `flex-wrap: wrap`Andreas Kling
2023-03-25LibWeb: Don't allow resolved height of abspos elements to become negativeAndreas Kling
We have to clamp the resulting height to 0 when solving for it.
2023-03-25LibWeb: Don't allow resolved width of abspos elements to become negativeAndreas Kling
We have to clamp the resulting width to 0 when solving for it.
2023-03-25LibWeb: Add out-of-flow boxes to anonymous wrapper block when possibleAndreas Kling
If the previous sibling of an out-of-flow box has been wrapped in an anonymous block, we now stuff the out-of-flow box into the anonymous block as well. Co-authored-by: Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
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-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-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-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-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-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-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-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-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-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/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: 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-02-11LibWeb: Add tests for flex formatting contextAliaksandr Kalenik
2023-02-10LibWeb: Fix clearance to update y offset within current blockAliaksandr Kalenik
If a box has clearance and margin bottom of preceding box is greater than static y of the box then it should also affect y offset in current block container so subsequent boxes will get correct y position too.
2023-02-07LibWeb: Table wrappers should not be ignored in auto height calculationAliaksandr Kalenik
Though table wrappers are anonymous block containers (because TableWrapper is inherited from BlockContainer) with no lines they should not be skipped in block auto height calculation.
2023-02-06LibWeb: Add layout tests for floats, margins collapsing and positioningAliaksandr Kalenik
Those are copied from 'Base/res/html/misc/'.
2023-01-29Tests: Add LibWeb layout testsAliaksandr Kalenik