Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support "replaced" layout #679

Open
nicoburns opened this issue Jul 9, 2024 · 0 comments
Open

Support "replaced" layout #679

nicoburns opened this issue Jul 9, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@nicoburns
Copy link
Collaborator

What problem does this solve or what need does it fill?

"replaced" layout is the layout mode for "foreign" content like images, videos, form fields, iframes, etc. These elements act a little differently to regular elements, but have standard (or at least interoperable) algorithms for computing their size.

What solution would you like?

  • A new display mode Display::Replaced
  • 2 new style properties
    • intrinsic_aspect_ratio: Option<f32>
    • intrinsic_size: Size<Option<f32>>
  • A new compute_replaced_layout function that computes that size of Display::Replaced nodes.
  • Teach the test generator about replaced nodes (probably starting with images)

What alternative(s) have you considered?

  • Making the replaced "styles" part of the NodeContext instead. I'm not sure if this would be a better design, but I think it would be more complicated to design.

Additional context

A significant amount of bugs in the Taffy integration with Servo are down to the interaction between Taffy algorithms and replaced nodes. I'm currently thinking that making replaced nodes a first-class concept in Taffy would be the best way to fix that.

@nicoburns nicoburns added the enhancement New feature or request label Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant