W3C home > Mailing lists > Public > public-css-archive@w3.org > April 2019

[csswg-drafts] Unexpected behaviour selecting <picture> element (#3818)

From: Melvin Idema via GitHub <sysbot+gh@w3.org>
Date: Wed, 10 Apr 2019 21:10:03 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-431717634-1554930601-sysbot+gh@w3.org>
MelvinIdema has just created a new issue for https://github.com/w3c/csswg-drafts:

== Unexpected behaviour selecting <picture> element ==
### Issue
The `<picture>` element is doing nothing, only providing context for the browser. So the expected behaviour should be that it's being treated as an img element. This is the case using the Descendant Selector. But as soon as a selector other than the Descendant Selector is introduced this is no longer the case and CSS won't select the picture anymore.

### Examples
A `<picture>` with a `<div>` as parent and a Descendant Selector:
https://codepen.io/melvinidema/pen/WWpBjp 

A `<picture>` with a `<div>` as parent and a selector other Descendant Selector:
https://codepen.io/melvinidema/pen/zXZdKw

### Expected Behaviour
The expected behaviour would be to have CSS treating the `<picture>` as a whole as if it was an `<img>`. As the `<picture>` and the `<source>` are only providing context and not actually rendered as elements. 

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3818 using your GitHub account
Received on Wednesday, 10 April 2019 21:10:09 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 19 October 2021 01:31:07 UTC