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

Style PICTURE with 'display: contents' and SOURCE with 'display: none' #45

Open
fantasai opened this issue Jun 7, 2019 · 4 comments
Open

Comments

@fantasai
Copy link
Contributor

fantasai commented Jun 7, 2019

Testcase

The picture element, being treated as an inline wrapper around the actual replaced element, prevents images with aspect ratios in participating properly in the CSS layout algorithms as images with aspect ratios. Also unless one specifically wants a wrapper, having an inline box wrapped around the image isn't really helping anyone. Also having a bunch of empty inlines representing each SOURCE element seems pretty unnecessary. Let's get rid of these boxes.

picture { display: contents; }
source { display: none; }

(Yay, a use case for 'display: contents' that isn't better served by subgrid!)

@tabatkins
Copy link

This should presumably be raised on HTML, no?

@jensimmons
Copy link
Owner

@tabatkins Yes, it should. And here, until they fix it and make this unnecessary... meanwhile, I will remember the cries of "WHAT?!?!?!! IT DOES WHAT?????" from @fantasai @frivoal Amelia, and crew (from CSSWG) for while.

@Sora2455
Copy link

Sora2455 commented Jun 7, 2019

Does this need to be added to <track> elements too?

@frivoal
Copy link
Contributor

frivoal commented Jun 8, 2019

Does this need to be added to elements too?

Doesn't seem so. <video> and <audio> are themselves replaced elements, and their children are not part of the page, so even if you put a border on a <track> element or a <source> element inside a video, it will not show up. It's only inside picture that it is a problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants