Repository navigation
Conversation
|
I'll fix CI failures and address comments from users with write access that start with 'Devin'.
|
staging-devin-ai-integration
Bot
changed the base branch from
devin/1792591613-aspect-ratio-auto-min
to
main
October 21, 2026 16:58
staging-devin-ai-integration
Bot
force-pushed
the
devin/1792599215-aspect-ratio-auto
branch
from
October 21, 2026 16:58
20dcc8c to
5fcf920
Compare
staging-devin-ai-integration
Bot
force-pushed
the
devin/1792599215-aspect-ratio-auto
branch
2 times, most recently
from
October 26, 2026 07:17
01bd63b to
76aea57
Compare
staging-devin-ai-integration
Bot
force-pushed
the
devin/1792599215-aspect-ratio-auto
branch
from
October 26, 2026 21:43
76aea57 to
d880567
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Support
aspect-ratio: auto && <ratio>. For a non-replaced box, the ratio then applies to the content box regardless ofbox-sizing(https://drafts.csswg.org/css-sizing-4/#aspect-ratio). Previously embedders could only pass anOption<f32>, soautowas lost.This is the bottom of the stack, based on
main. #1346 (aspect-ratio automatic minimum and min/max transfer) builds on it.Changes
AspectRatiostyle type, a 4-byte newtype overf32. The ratio is negated forauto && <ratio>, andAspectRatio::NONEis NaN. Constructors:new,auto_and. Accessors:ratio() -> Option<f32>,is_auto(). Degenerate ratios (not finite and positive) becomeNONE.PartialEqcompares bits, soNONE == NONE. Serde uses a{ ratio, auto }repr.From<f32>andFrom<Option<f32>>are provided.parsefeature,AspectRatio: FromStrparsesauto || <ratio>, where<ratio>is<number [0,∞]> [ / <number [0,∞]> ]?.0,1 / 0and0 / 0parse toNONE; negative numbers are rejected. The XML test loader uses it.Style::aspect_ratioandCoreStyle::aspect_ratio()now useAspectRatio.Styleshrinks by 8 bytes (552/520 bytes).compute/common/aspect_ratio.rshasResolvedAspectRatio, which holds the ratio plus aninset. The inset is the padding+border forautoon aborder-boxbox, and zero otherwise. Every ratio transfer goes throughApplyAspectRatio::apply_aspect_ratio/width_from_height/height_from_widthinstead ofSize::maybe_apply_aspect_ratio, so behaviour withoutautois unchanged.ResolvedAspectRatio::newchecks forNONEinline and builds the ratio out of line (new_unchecked), and flex items compute padding+border only for that call, so boxes without a ratio do less work (commit42bc3dc9).auto <ratio>. There are 6 new fixtures: block width/height/content-box, abspos, flex and grid.Context
Performance vs
main. Ir is layout-only callgrind (--toggle-collect=*Bencher*iter*). Wall time is the min of per-round Criterion medians over 7 interleaved rounds, pinned to one core on an otherwise idle VM; treat about ±2% wall as noise (grid wide 316²switches between two speeds on this VM in every version, so its wall figure is unreliable). Measured on the pre-rebase base (Taffy4e59968e); later rebases (now ontoc2560562) don't change this PR's diff.Boxes without a ratio check for
AspectRatio::NONEinline; building aResolvedAspectRatiois out of line and#[cold]. The remaining cost has no single hotspot.Feedback wanted
autothere still uses the style ratio. Blitz handles replaced elements itself.Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/0236734c2d3c402e860b874de0a2b8cb
Open in Devin Desktop: https://dioxus.staging.devinenterprise.com/desktop/session/0236734c2d3c402e860b874de0a2b8cb?variant=devin-insiders
Requested by: @nicoburns