aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/flow
Commit message (Collapse)AuthorAgeFilesLines
...
* 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-231-32/+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-221-2/+3
| | | | | | | | | | | 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-201-0/+1
| | | | | | | | | 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>
* Refactor box size computation (#34671)Oriol Brufau2024-12-191-186/+73
| | | | | | | | | 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>
* 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>
* 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-161-3/+9
| | | | | | | | 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>
* Use inline-start/inline-end instead of left/right terminology for floats ↵Oriol Brufau2024-12-131-49/+52
| | | | | | | | | | (#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-122-24/+27
| | | | | | | | | | | | | | 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>
* 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>
* build: upgrade rustc to 1.81.0 (#34270)Mukilan Thiyagarajan2024-12-121-2/+1
| | | Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* Make sure to cache `inline_content_sizes()` (#34586)Oriol Brufau2024-12-122-9/+14
| | | | | | | | | | | | | | | | 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-115-32/+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-114-48/+68
| | | | | | | | 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>
* 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 `LayoutBoxBase` and use it for `IndependentFormattingContext` ↵Martin Robinson2024-12-073-175/+181
| | | | | | | | | | | | | | | | | | (#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-063-68/+116
| | | | | | | | | | | | | | | | | * 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>
* Refactor computation of preferred aspect ratios (#34416)Oriol Brufau2024-11-292-6/+14
| | | | | | | | | | | | | | | | | | | * 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>
* Use natural ratio for `object-fit` (#34413)Oriol Brufau2024-11-281-6/+4
| | | | | | | | 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-271-0/+9
| | | Signed-off-by: Delan Azabani <dazabani@igalia.com>
* Layout: Implement CSS Grid using `taffy` (#32619)Nico Burns2024-11-211-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add layout.grid.enabled pref Signed-off-by: Nico Burns <nico@nicoburns.com> * Add taffy dependency Signed-off-by: Nico Burns <nico@nicoburns.com> * Import taffy <-> stylo conversion code from taffy_stylo crate Signed-off-by: Nico Burns <nico@nicoburns.com> * Add `Grid` variant to DisplayInside Signed-off-by: Nico Burns <nico@nicoburns.com> * Implement CSS Grid using Taffy Signed-off-by: Nico Burns <nico@nicoburns.com> Import full stylo_taffy crate Signed-off-by: Nico Burns <nico@nicoburns.com> Squashed PR feedback changes Deduplicate is_document_only_whitespace Signed-off-by: Nico Burns <nico@nicoburns.com> Import taffy::AvailableSpace Signed-off-by: Nico Burns <nico@nicoburns.com> Rename FlexContext to TaffyContainerContext Signed-off-by: Nico Burns <nico@nicoburns.com> Eliminate references to flexbox in taffy/layout module Signed-off-by: Nico Burns <nico@nicoburns.com> Use constructors for geom types Signed-off-by: Nico Burns <nico@nicoburns.com> Remove comment about abspos elements splitting contiguous text runs Signed-off-by: Nico Burns <nico@nicoburns.com> Remove reference to flexbox in taffy/construct Signed-off-by: Nico Burns <nico@nicoburns.com> Deduplicate construction of flexbox/grid containers Signed-off-by: Nico Burns <nico@nicoburns.com> Make anonymous text runs InFlow Signed-off-by: Nico Burns <nico@nicoburns.com> Remove commented code Signed-off-by: Nico Burns <nico@nicoburns.com> Update comments Signed-off-by: Nico Burns <nico@nicoburns.com> Inline/vendor the stylo/taffy interop code Signed-off-by: Nico Burns <nico@nicoburns.com> * Update test expectations Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix nits from PR review Signed-off-by: Nico Burns <nico@nicoburns.com> --------- Signed-off-by: Nico Burns <nico@nicoburns.com>
* Upgrade Stylo to 2024-11-01 (#34322)Oriol Brufau2024-11-211-2/+6
| | | | | | | | | | | | | | | | | * Upgrade Stylo to 2024-11-01 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Fixup for https://phabricator.services.mozilla.com/D224747 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>
* Use a RwLock to cache inline_content_sizes() (#34232)Oriol Brufau2024-11-133-14/+14
| | | | | | | | | | | In order to support size keywords in block layout, we may need to call `inline_content_sizes()` in order to compute the min/max-content sizes. But this required a mutable reference in order the update the cache, and in various places we already had mutable references. So this switches the cache into a RwLock to avoid needing mutable refs. Note OnceCell wouldn't work because it's not thread-safe. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Use LazyCells instead of callbacks when resolving size keywords (#34211)Oriol Brufau2024-11-111-35/+35
| | | | | | | | | | In most cases we already had a LazyCell anyways, since we could need the value for multiple properties. Instead of passing a callback that forces the evaluation of the LazyCell, it's simpler to just pass the LazyCell directly. Also, this way we no longer need mutable references. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Fix inline content sizes of intrinsic element with indefinite block size ↵Oriol Brufau2024-11-112-44/+38
| | | | | | | | | | | | | | | | | (#34152) To compute the min-content and max-content inline sizes of a replaced element, we were only using the aspect ratio to transfer definite block sizes resulting from clamping the preferred block size between the min and max block sizes. However, if the preferred block size is indefinite, then we weren't transfering the min and max through the aspect ratio. This patch adds a `SizeConstraint` enum that can represent these cases, and a `ConstraintSpace` struct analogous to `IndefiniteContainingBlock` but with no inline size, and a `SizeConstraint` block size. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Implement keyword sizes for replaced elements (#34091)Oriol Brufau2024-11-051-4/+3
| | | Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Replace ComputedValues with WritingMode on IndefiniteContainingBlock (#34090)Oriol Brufau2024-11-042-7/+7
| | | | | We only need the writing mode, not the entire computed style. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* layout: Avoid layout sometimes when stretching (#33967)Martin Robinson2024-10-242-70/+166
| | | | | | | | | | | | | | | | | | | | This is the second flexbox caching change. It seeks to detect when a relayout can be avoided in the case of a stretching flex item. This heuristic can be combined, because currently we still do relayout sometimes when we do not need to. For instance currently we always relayout when a flex child is itself a column flex. This only needs to happen when the grandchildren themselves grow or shrink. That optimization is perhaps a lower priority as `flex-grow: 0 / flex-shrink: 1` is the default behavior for flex. Since this change means we more consistenly zero out the percentage part of `calc` expressions when they have circular dependencies, this causes one test to start failing (`/css/css-values/calc-min-height-block-1.html`). This is related to w3c/csswg-drafts#10969, which is pending on further discussion in the working group. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Prevent `stretch` from producing a negative size (#33951)Oriol Brufau2024-10-221-2/+3
| | | Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Upgrade Stylo to 2024-10-04 (#33767)Oriol Brufau2024-10-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Upgrade Stylo to 2024-10-04 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Fixup for https://phabricator.services.mozilla.com/D220285 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Fixup for https://bugzilla.mozilla.org/show_bug.cgi?id=1918093 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Fixup for https://phabricator.services.mozilla.com/D222817 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Fixup for https://phabricator.services.mozilla.com/D222856 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Fixup for https://phabricator.services.mozilla.com/D222532 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Fixup for https://phabricator.services.mozilla.com/D222533 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Fixup for https://phabricator.services.mozilla.com/D222534 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Fixup for https://phabricator.services.mozilla.com/D223878 Signed-off-by: Oriol Brufau <obrufau@igalia.com> --------- Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Minor cleanup for `Size` after #33844 (#33861)Oriol Brufau2024-10-161-1/+1
| | | Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Avoid wrapping line at the start of text run with `text-wrap-mode: nowrap` ↵Oriol Brufau2024-10-161-4/+4
| | | | | | | | | (#33848) When computing the min-content size of an inline formatting context, we could allow a soft wrap opportunity at the start of a text run. This shouldn't happen with `text-wrap-mode: nowrap`. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Avoid recomputing inline_content_sizes() when not needed (#33806)Oriol Brufau2024-10-142-56/+81
| | | | | | | | | | | The result of `inline_content_sizes()` may depend on the block size of the containing block, so we were always recomputing in case we got a different block size. However, if no content has a vertical percentage or stretches vertically, then we don't need to recompute: the result will be the same anyways. Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Unify logic for laying out floats and atomic inlines (#33802)Oriol Brufau2024-10-113-319/+216
| | | Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Implement keyword sizes on atomic inlines (#33737)Oriol Brufau2024-10-101-39/+73
| | | | | | | | | Adds support for min-content, max-content, fit-content and stretch, for atomic inlines. There are some new test failures because we don't support vertical writing modes nor `transition-behavior:allow-discrete`. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Implement keyword sizes on floats (#33666)Oriol Brufau2024-10-081-40/+64
| | | | | | Adds support for min-content, max-content, fit-content and stretch, for floated elements. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Skip anonymous blocks for percentage resolution (#33658)Oriol Brufau2024-10-051-8/+36
| | | | | | | | | Anonymous blocks have `height: auto`, so children with a percentage `height` were considered to have an indefinite height. However, anonymous blocks need to be skipped for percentage resolution, so the percentages may actually be definite. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* fonts: Make `FontKey` and `FontInstanceKey` generation asynchronous (#33600)Martin Robinson2024-10-012-12/+26
| | | | | | | | | | | | | | | | | | | | | | | | Instead of a blocking a layout thread on the generation of WebRender `FontKey`s and `FontInstanceKey`s, generate the keys ahead of time and send the font data to WebRender asynchronously. This has the benefit of allowing use of the font much more quickly in layout, though blocking display list sending itself on the font data upload. In order to make this work for web fonts, `FontContext` now asks the `SystemFontService` for a `FontKey`s and `FontInstanceKey`s for new web fonts. This should happen much more quickly as the `SystemFontService` is only blocking in order to load system fonts into memory now. In practice this still drops layout thread blocking to fractions of a millisecond instead of multiple milliseconds as before. In addition, ensure that we don't send font data or generate keys for fonts that are used in layout but never added to display lists. This should help to reduce memory usage and increase performance. Performance of this change was verified by putting a microbenchmark around `FontContext::create_font` which is what triggered font key generation. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Make ComputedValuesExt expose keywords for the sizing properties (#33558)Oriol Brufau2024-09-273-15/+19
| | | | | | | | | | | | | | | | This will allow callers to start obeying `min-content`, `max-content`, `fit-content` and `stretch` in follow-up patches. The old functionality is kept as deprecated methods that we should eventually remove. This patch has very little impact on the existing behavior, just some very minimal implementation of the keywords for css tables. This also overhauls fixed-layout-2.html since: - It had code that wasn't doing anything - It had wrong expecations in prose - The logic seemed broken in general - All browsers were failing one testcase Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* fonts: Simplify `FontContext` in two ways that affect the unit test (#33541)Martin Robinson2024-09-251-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | This is done by no longer forwarding compositor-bound messages through SystemFontService and making `FontContext` non-generic: - Messages from the `FontContext` to the `Compositor` no longer need to be forwarded through the `SystemFontService`. Instead send these messages directly through the script IPC channel to the `Compositor`. - Instead of adding a mock `SystemFontServiceProxy`, simply implement a mock `SystemFontService` on the other side of an IPC channel in the `font_context` unit test. This allows making `FontContext` non-generic, greatly simplifying the code. The extra complexity moves into the unit test. These changes necessitate adding a new kind of `FontIdentifier`, `FontIdentifier::Mock` due to the fact that local fonts have platform-specific identifiers. This avoids having to pretend like the system font service can have web fonts -- which was always a bit of a hack. These two changes are combined into one PR because they both require extensive and similar chages in the font_context unit test which dependended on the details of both of them. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* fonts: Use `IpcSharedMemory` to send font data (#33530)Martin Robinson2024-09-251-4/+4
| | | | | | | | | | | | | | | | | | | | | This changes modifes the way that font data is sent over IPC channels. Instead of serializing the data or sending it via IPC byte senders, font data is copied into shared memory and a copy of the handle is sent over the channel. There is also the idea of sending the file handle of the on disk data of system fonts. This could be implemented as a further followup once there is an abstraction in `ipc-channel` over file handles. To accomplish this, a `FontData` abstraction is added, which also allows caching an in-memory shared `Arc<Vec<u8>>` version of the data (neeeded by some APIs). This could also be a place for caching font tables in the future. Finally, the `FontCacheThread` is renamed to the `SystemFontService` while the proxy for this is now named `SystemFontServiceProxy`. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* fix many clippy warnings (#33510)Gae242024-09-211-1/+1
| | | Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* Enable min-content, max-content, fit-content and stretch (#33492)Oriol Brufau2024-09-201-6/+6
| | | | | | | | | For the sizing properties. We don't actually support them yet, just treating them as the initial value. Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* layout: Add support for `object-fit` and `object-position` (#33479)Martin Robinson2024-09-183-2/+7
| | | | | | | | | | This also makes a couple small improvements: - Rename `IntrinsicSizes` to `NaturalSizes` which reflects more modern spec language. - Move the conversion of Stylo's `ImageRendering` to WebRender's version to a `ToWebRender` trait implementation. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Clear `self.pending_whitespace.max_content` in `forced_line_break()` (#33469)Oriol Brufau2024-09-161-8/+8
| | | | | | | | | | | | If we encountered a preserved line break after some whitespace, we were including the space in the max-content size of the following line. So just like `line_break_opportunity()` was already clearing `self.pending_whitespace.min_content`, `forced_line_break()` needs to clear `self.pending_whitespace.max_content` too. Also some cosmetic refactoring. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Replace .map_or(false with Option::is_some_and (#33468)Simon Wülker2024-09-162-4/+6
| | | Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Fix rustdoc problems (#33458)Oriol Brufau2024-09-141-2/+2
| | | Signed-off-by: Oriol Brufau <obrufau@igalia.com>