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

Extend gentest harness to support image nodes #546

Open
nicoburns opened this issue Oct 2, 2023 · 0 comments
Open

Extend gentest harness to support image nodes #546

nicoburns opened this issue Oct 2, 2023 · 0 comments
Labels
testing Additional tests or improvements to the testing infrastructure

Comments

@nicoburns
Copy link
Collaborator

nicoburns commented Oct 2, 2023

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

Images nodes have an "intrinsic aspect ratio". And this behaves slightly differently to a node with the aspect_ratio style set, so it would be useful to be able to create gentests for it.

What solution would you like?

In Taffy's terms, a intrinsic aspect ratio corresponds to measure function which will determine the other dimension based on an aspect ratio it is asked to measure itself with one dimension set. So I would like to propose that we allow for setting image nodes in gentests, and translate that into such a measure function.

We should have 2-3 standard images to use:

  • One which is square (1:1 aspect ratio)
  • One which is landscape (wider than it is tall)
  • One which is portrait (taller than it wide)

Additional context

The following can be used as an initial test cases:

<div id="test-root" style="display: flex; flex-direction: column; width: 200px;">
     <img src="../../scripts/gentest/3x2.png" />
</div>
<div id="test-root" style="display: flex; flex-direction: row; height: 100px;">
     <img src="../../scripts/gentest/1x1.png" />
</div>
@nicoburns nicoburns added enhancement New feature or request testing Additional tests or improvements to the testing infrastructure and removed enhancement New feature or request labels Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Additional tests or improvements to the testing infrastructure
Projects
None yet
Development

No branches or pull requests

1 participant