aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020
Commit message (Collapse)AuthorAgeFilesLines
* layout: grid template getComputedStyle resolved value (#34885)Steven Novaryo2025-01-099-10/+188
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Store taffy detailed info into fragment Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Fix info propagation and resolved grid track query Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Fix import Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Fix tracklist matching logic and type optimization Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Run fmt Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Update wpt expectations Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Optimizing info propagation and minor qol Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Run fmt Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> --------- Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>
* layout: Defer some table sizing logic to the parent formatting context (#34889)Oriol Brufau2025-01-094-40/+43
| | | | | | | | | | | | | A box is usually sized by the formatting context in which it participates. However, tables have some special sizing behaviors, and these were in conflict. Instead of letting tables attempting to re-resolve their inline table, which failed to e.g. take flex properties into account or resolve sizing keywords correctly, now tables will trust the inline size determined by the parent. They will only floor it by the min-content size, and maybe shrink the final size due to collapsed columns. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* layout: Refine the check for dependending on available space (#34907)Oriol Brufau2025-01-082-16/+11
| | | | | | | | | | | | | | When laying out a block-level box that avoids floats, if we know that its size doesn't depend on the available space, we can take a fast path and only lay it out once. If its size depends on the available space, we may have to lay it out multiple times, which can be slower. This patch improves the check for this dependency on the available space. For example, `min-width: 200px; width: 100px; max-width: stretch` was previously considered to depend on the available space because of `max-width`. However, `max-width` is irrelevant when the min size is greater than the preferred size. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* layout: Remove wrong FIXME (#34895)Oriol Brufau2025-01-081-1/+0
| | | | | | There is an early return for independent formatting contexts, so at this point we don't need to handle them. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* layout: Don't use `content_inline_size_for_table` in taffy (#34891)Oriol Brufau2025-01-081-3/+1
| | | | | | `content_inline_size_for_table` is an override for table layout. We only use taffy for grid layout, not for table layout. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* layout: Assert that GRIDMIN <= GRIDMAX (#34892)Oriol Brufau2025-01-081-5/+5
| | | | | | In the past this didn't hold, so we had to floor GRIDMAX by GRIDMIN. We must have fixed some bugs because now it's fine to just assert it. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Treat % as 0 for the min-content contribution of replaced elements (#32103)Oriol Brufau2025-01-063-2/+30
| | | | | | | | | `width` and `max-width` typically treat expressions with percentages as their initial value, but for the min-content contribution of replaced elements, they should instead be treated as zero. https://drafts.csswg.org/css-sizing-3/#replaced-percentage-min-contribution Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Elide lifetimes where possible after rustup (#34824)Martin Robinson2025-01-0311-17/+14
| | | | | | | | | The new version of rust allows us to elide some lifetimes and clippy is now complaining about this. This change elides them where possible and removes the clippy exceptions. Fixes #34804. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Upgrade rustc to 1.83 (#34793)Nico Burns2025-01-014-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Upgrade rustc to 1.83 Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix crown (change copied from linked clippy function) Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix named lifetime lint Signed-off-by: Nico Burns <nico@nicoburns.com> * Bump shell.nix Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix non-local impl warnings Signed-off-by: Nico Burns <nico@nicoburns.com> * Format with 1.83 formatting changes Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix manual non-local impl Signed-off-by: Nico Burns <nico@nicoburns.com> * More fixes for crown Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix tidy Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix needless_return lints Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix doc comment lint Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix missing wait lint Signed-off-by: Nico Burns <nico@nicoburns.com> * Allow needless_lifetimes lint Signed-off-by: Nico Burns <nico@nicoburns.com> * more doc comments Signed-off-by: Nico Burns <nico@nicoburns.com> * More needless_returns Signed-off-by: Nico Burns <nico@nicoburns.com> * is_empty lint Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix needless_lifetime lints Signed-off-by: Nico Burns <nico@nicoburns.com> * fix div_ceil lint Signed-off-by: Nico Burns <nico@nicoburns.com> * Allow non-minimal bool Signed-off-by: Nico Burns <nico@nicoburns.com> * Non-local impl in constellation Signed-off-by: Nico Burns <nico@nicoburns.com> * Missing wait in constellation Signed-off-by: Nico Burns <nico@nicoburns.com> * fmt Signed-off-by: Nico Burns <nico@nicoburns.com> * remove useless lints table Signed-off-by: Nico Burns <nico@nicoburns.com> * Fixup comments Signed-off-by: Nico Burns <nico@nicoburns.com> * Allow non-local definition in sandboxing code to simplify feature flagging Signed-off-by: Nico Burns <nico@nicoburns.com> * Remove wait calls and allow zombie_processes lint Signed-off-by: Nico Burns <nico@nicoburns.com> --------- Signed-off-by: Nico Burns <nico@nicoburns.com>
* Correct a variety of documentation issues (#34786)Martin Robinson2024-12-292-2/+2
| | | | | | Fix some warnings in documentation as well as some faulty documentation introduced in #34776. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* layout: Pass the right containing block to ↵Oriol Brufau2024-12-231-1/+1
| | | | | `find_block_margin_collapsing_with_parent_from_slice()` (#34725) Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* layout: Implement keyword sizes for block layout heuristics (#34695)Oriol Brufau2024-12-232-63/+72
| | | | | | | | Block layout uses some heuristics to guess whether margins are separated by clearance and then don't collapse. These heuristics now take the min-content, max-content, fit-content and stretch sizing keywords into account. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* layout: Fix intrinsic contributions of anonymous blocks (#34719)Oriol Brufau2024-12-224-22/+46
| | | | | | | | | | | In order to compute the inline min-content and max-content contributions of an anonymous block, we were finding its min-content and max-content inline size with a SizeConstraint coming from the block size of the box. However, anonymous blocks do not establish a containing block for their contents, so this patch uses a SizeConstraint from the block size of the containing block. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* layout: Fix intrinsic contributions of tables (#34696)Oriol Brufau2024-12-203-4/+24
| | | | | | | | | If a table element had e.g. `width: 0px`, we were assuming that this was its intrinsic min-content and max-content contributions. However, tables are always at least as big as its min-content size, so this patch floors the intrinsic contributions by that amount. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* layout: Lay out Shadow DOM elements (#34701)Martin Robinson2024-12-191-0/+5
| | | | | | | | | | | When an element is a shadow root, lay out the shadow root elements instead of the non-shadow children. This fixes some tests and introduces some failures, due to bugs in the Shadow DOM implementation. In general, this is very low impact as the Shadow DOM is still disabled by default. At least this gets elements rendering when the preference is turned on though. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Refactor box size computation (#34671)Oriol Brufau2024-12-198-343/+311
| | | | | | | | | in each layout logic, in order to correctly resolve sizing keywords. This patch adds a new `Sizes` struct which holds the preferred, min and max sizing values for one axis, and unifies the logic to resolve the final size into there. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* layout: Never stretch indefinite intrinsic keywords other than `auto` (#34672)Oriol Brufau2024-12-182-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Consider: ```html <div style="position: relative; width: 50px; height: 50px; border: solid; margin: 5px"> <div style="position: absolute; top: 0; bottom: 0; height: max-content"> <canvas width="25" height="25" style="background: cyan; height: 100%"></canvas> </div> </div> ``` In order to determine the inline min/max-content sizes, we need a tentative block size as the input, which only takes extrinsic values into account. In this case `height: max-content` is intrinsic, so we were treating it as `height: initial`, which would behave as a definite `height: stretch`. Therefore, the canvas was able to resolve its percentage. However, it seems weird to treat an explicitly intrinsic keyword in an extrinsic way, and Blink doesn't do it. So now we treat the tentative block size as indefinite, therefore the percentage behaves as auto. This adds a new test, we were previously failing 6 subtests, now only 3. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Shrink ContainingBlockPaddingAndBorder (#34666)Oriol Brufau2024-12-171-29/+23
| | | | | | It only needs to store the block sizes, not the inline ones which have already been resolved. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Update deprecated use of PanicInfo to PanicHookInfo (#34659)Narfinger2024-12-171-2/+2
| | | Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
* Complete implementation of keyword sizes for block layout (#34641)Oriol Brufau2024-12-161-42/+111
| | | | | | | Adds support for min-content, max-content, fit-content and stretch, for the case that was missing from #34568: block-level elements that establish an independent formatting context, when there are floats. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* script: Manage `<iframe>` sizes in `Window` (#34643)Martin Robinson2024-12-167-25/+39
| | | | | | | | Manage `<iframe>` size updates in `Window`. In addition to removing duplicated code, this will allow setting `<iframe>` sizes synchronously on child `Pipeline`s of the same origin in the script process in a followup change. The goal is remove flakiness from `<iframe>` sizing. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Partial implementation of keyword sizes for block layout (#34568)Oriol Brufau2024-12-161-46/+113
| | | | | | | Adds support for min-content, max-content, fit-content and stretch, for block-level elements that don't establish an independent formatting context, and for block-level elements when there is no float. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* layout: Fix CSS `attr()` function case sensitivity matching (#34574)Steven Novaryo2024-12-132-2/+24
| | | Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>
* Use inline-start/inline-end instead of left/right terminology for floats ↵Oriol Brufau2024-12-132-67/+70
| | | | | | | | | | (#34608) It was a bit confusing that e.g. a float with `FloatSide::InlineStart` would set `FloatBand::left`, or that `PlacementAmongFloats` would compute `max_inline_start` from the various `FloatBand::left`. So now all the float logic will consistently use logical terminoligy. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Distinguish cached `inline_content_sizes()` from uncached ones (#34595)Oriol Brufau2024-12-129-125/+152
| | | | | | | | | | | | | | Several structs and enums had a `inline_content_sizes()` method, but it wasn't clear which ones would try to cache the result, and which ones would always compute it. Therefore, this performs some clarifying renaming: - Cached ones stay as `inline_content_sizes()` - Uncached ones become `compute_inline_content_sizes()` Also, to simplify calls to `LayoutBoxBase::inline_content_sizes()`, `compute_inline_content_sizes()` is moved into a new trait. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Fix block size of containing block established by table rows (#34596)Oriol Brufau2024-12-121-1/+1
| | | | | | | Due to a typo, the containing block established by a table row for the table cells had its block size set to the its inline size. However, this block size is currently unused, so no change in behavior. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* layout: Fix ordering of padding, border, and margin in inline BiDi (#34572)Dmitrii Desiatkin2024-12-122-34/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * [fix](inline flow): Create PBM items in inline context in propper visual order Signed-off-by: Desiatkin Dmitrii <d.desyatkin@innopolis.university> * Rename left/right pbm terms in inline layout to logical nomenclature - LineItem::LeftInlineBoxPaddingBorderMargin(_) is renamed to LineItem::InlineStartBoxPaddingBorderMargin(_) - LineItem::RightInlineBoxPaddingBorderMargin(_) is renamed to LineItem::InlineEndBoxPaddingBorderMargin(_) - LineLayoutInlineContainerFlags::HAD_LEFT_PBM is renamed to LineLayoutInlineContainerFlags::HAD_INLINE_START_PBM - LineLayoutInlineContainerFlags::HAD_RIGHT_PBM is renamed to LineLayoutInlineContainerFlags::HAD_INLINE_END_PBM Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Update test expectations Signed-off-by: Oriol Brufau <obrufau@igalia.com> --------- Signed-off-by: Desiatkin Dmitrii <d.desyatkin@innopolis.university> Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Share more code for non-replaced float-avoiding blocks (#34585)Oriol Brufau2024-12-122-86/+46
| | | | | | | | | | | | | Block-level elements that establish an independent formatting context (or are replaced) need to avoid overlapping floats. In the non-replaced case, we have two different subcases, depending on whether the inline size of the element is known. This patch makes them share more logic. Then `solve_clearance_and_inline_margins_avoiding_floats()` would only be used in the replaced case, so it's removed, inlining its logic. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Remove taffy-specific layout caching (#34589)Nico Burns2024-12-122-11/+1
| | | Signed-off-by: Nico Burns <nico@nicoburns.com>
* build: upgrade rustc to 1.81.0 (#34270)Mukilan Thiyagarajan2024-12-122-4/+2
| | | Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* Deduplicate taffy layout pbm computation (#34587)Nico Burns2024-12-121-42/+24
| | | Signed-off-by: Nico Burns <nico@nicoburns.com>
* Make sure to cache `inline_content_sizes()` (#34586)Oriol Brufau2024-12-124-11/+16
| | | | | | | | | | | | | | | | The refactoring in 264c0f972fd1a732ee1d1490d78a1d26a65c6f5f stopped caching the `inline_content_sizes()` calls from: - `FlexItemBox::layout_for_block_content_size()` - `IndependentFormattingContext::layout_float_or_atomic_inline()` - `TaffyContainerContext::compute_child_layout()` Also, the call from `OutsideMarker::layout()` was never cached. This patch caches all of them. It's not clear at all which `inline_content_sizes()` are cached and which aren't, so I plan to improve the situation in a follow-up. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* layout: Clean up inline layout data types a bit (#34563)Martin Robinson2024-12-116-35/+35
| | | | | | | | | | | - Remove the `LayoutBox::InlineBox` variant that was only used for inline level boxes. Now they are stored in `LayoutBox::InlineLevel` along with other kinds of out-of-flow and atomic inline items. - Reduce the size of `InlineItem` by 260 bytes per item by using atomic indirection / pointers. This adds a bit of overhead to access items in exchange for a lot of memory saved. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* layout: Make a new `ContainingBlockSize` type (#34565)Martin Robinson2024-12-1113-158/+192
| | | | | | | | This might make caching these values a bit easier in the future. Correcting the visibility of `ContainingBlock` also exposed some new rustc and clippy warnings that are fixed here. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Don't transfer indefinite `height: stretch` to inline axis (#34557)Oriol Brufau2024-12-101-6/+3
| | | | | | | | | | | | | | | | | | Consider this testcase: ```html <canvas style="aspect-ratio: 1; height: stretch; background: cyan" width="200" height="100"></canvas> ``` To compute the intrinsic inline sizes we were treating `height: stretch` as the natural height (100px) and then transferring that to the inline axis through the preferred aspect ratio. So the element was 100px wide. However, an indefinite `stretch` should be treated as an automatic size, which wouldn't be transferred to the inline axis. The fix actually makes the code slightly simpler. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* layout: Have `SameFormattingContextBlock` be a `LayoutBoxBase` (#34530)Martin Robinson2024-12-092-33/+28
| | | | | | This allows `SameFormattingContextBlock` to cache inline content sizes and will eventually allow it to participate in incremental layout. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* layout: Add `LayoutBox` to `TableSlotCell` (#34513)Martin Robinson2024-12-083-37/+48
| | | | | | This allows cells to cache their inline content size and will eventually allow them to participate in incremental layout. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* layout: Add `LayoutBoxBase` and use it for `IndependentFormattingContext` ↵Martin Robinson2024-12-0716-439/+423
| | | | | | | | | | | | | | | | | | (#34507) Add a new struct `LayoutBoxBase`, that will be used throughout the box tree. The idea of this struct is that we have a place to consistently store common layout information (style and node information) and also to cache layout results such as content sizes (inline and maybe later box sizes) and eventually layout results. In addition to the addition of this struct, `IndependentFormattingContext` is flattened slightly so that it directly holds the contents of both replaced and non-replaced elements. This is only added to independent formatting contexts, but will later be added to all block containers as well. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Upgrade Stylo to 2024-12-04 (#34501)Oriol Brufau2024-12-064-75/+122
| | | | | | | | | | | | | | | | | * Upgrade Stylo to 2024-12-04 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Fixup for https://phabricator.services.mozilla.com/D229998 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Update test expectations Signed-off-by: Oriol Brufau <obrufau@igalia.com> --------- Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Fix `stretch` sizes on replaced abspos (#34430)Oriol Brufau2024-12-051-118/+128
| | | | | | | We were sizing absolutely positioned replaced elements within their actual containing block instead of the inset-modified containing block. Then the `stretch` keyword would result in a wrong size. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* layout: Add missing support for some alignment keywords on absolutely ↵tanishka2024-12-051-10/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | positioned elements (#34365) * Add missing support for some alignment keywords on absolutely positioned elements Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com> * Check the direction of the alignment container, nits, test expectations In this case we need to check the direction of the static position containing block, not the actual containing block: ```html <!DOCTYPE html> <div style="position: relative"> <div style="display: flex; flex-direction: column; width: 100px; height: 100px; border: solid; direction: rtl"> <div style="position: absolute; width: 20px; height: 20px; background: cyan; top: 20px; align-self: self-start"></div> <div style="position: absolute; width: 20px; height: 20px; background: magenta; bottom: 20px; align-self: self-end"></div> </div> </div> ``` Signed-off-by: Oriol Brufau <obrufau@igalia.com> --------- Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com> Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Improve performance of flex column layouts by caching (#34461)Oriol Brufau2024-12-032-17/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Obey min and max properties when computing main size of column flex When laying out a column flex container with an auto preferred main size, we were resolving the used main size to the intrinsic max-content size. However, we weren't clamping this amount between the min and max sizes. Co-authored-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Improve performance of flex column layouts by caching We were already using a cache for layout_for_block_content_size(), but we were only storing the intrinsic block size. Thus when laying out the flex items for real, we would perform new layouts, triggering an exponential complexity in case of nested flexboxes. Now we cache the entire layout result so that we can avoid doing the work again. This improves the results of flexbox-deeply-nested-column-flow.html (a Blink perf test) from ~40 runs/second to ~500 runs/second on my PC. Co-authored-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Oriol Brufau <obrufau@igalia.com> --------- Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Obey min and max properties when computing main size of column flex (#34450)Oriol Brufau2024-12-021-8/+9
| | | | | | | | When laying out a column flex container with an auto preferred main size, we were resolving the used main size to the intrinsic max-content size. However, we weren't clamping this amount between the min and max sizes. Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Refactor AbsoluteAxisSolver (#34443)Oriol Brufau2024-12-021-99/+38
| | | | | | | | | | | | | | | | | `AbsoluteAxisSolver::solve()` would compute, among other things, the position of the absolute positioned element if it had start alignment. Then, `AbsoluteAxisSolver::origin_for_alignment_or_justification()` could optionally opt into modifying that alignment if needed. This was quite convoluted and not easy to follow. It's simpler to not compute the position in `AbsoluteAxisSolver::solve()`, and instead do it always in `AbsoluteAxisSolver::origin_for_alignment_or_justification()`, which I'm renaming to `AbsoluteAxisSolver::origin_for_margin_box()` because it aligns the margin box of the abspos within its alignment container. Then the `Anchor` struct becomes useless and can be removed. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Fix alignment of abspos child of flexbox with flipped direction (#34426)testOriol Brufau2024-11-301-20/+42
| | | | | | | | | | | | | The containing block for the static position of an absolutely positioned element in flex layout is established by the flex container. However, if the flex container has static position, the actual containing block will be established by another ancestor. If the flex container and the containing block have different directions, the static position needs especial handling when aligning the abspos. We were already trying to do so with the `flip_anchor` flag, but there were bugs. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Refactor computation of preferred aspect ratios (#34416)Oriol Brufau2024-11-2911-113/+133
| | | | | | | | | | | | | | | | | | | * Refactor computation of preferred aspect ratios Computing min/max-content sizes required a ContainingBlock in order to resolve the padding and border when determining the preferred aspect ratio. However, all callers already knew the padding and border, so they can compute the ratio themselves, and pass it directly instead of the ContainingBlock. Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Put preferred aspect ratio into ConstraintSpace Signed-off-by: Oriol Brufau <obrufau@igalia.com> --------- Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Ensure taffy uses margin when calling ↵tanishka2024-11-281-1/+1
| | | | | used_size_as_if_inline_element_from_content_box_sizes() (#34421) Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
* Use natural ratio for `object-fit` (#34413)Oriol Brufau2024-11-285-26/+10
| | | | | | | | We were using the preferred aspect ratio provided by the `aspect-ratio` property instead of the natural aspect ratio. However, the preferred aspect ratio should only be used to size the replaced element. To paint the replaced contents into that element we need the natural ratio. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Additional tracing for flex layout, inline layout, and fonts (#34392)Delan Azabani2024-11-272-6/+53
| | | Signed-off-by: Delan Azabani <dazabani@igalia.com>
* Use an AtomicRefCell instead of a RwLock for caching intrinsic sizes (#34384)Oriol Brufau2024-11-261-13/+9
| | | | | | It panics if the value is mutably borrowed concurrently, but this allows it to perform better. Signed-off-by: Oriol Brufau <obrufau@igalia.com>