Element queries: The viewport element

Hi,

I'm investigating element queries for my master's thesis.

It is my understanding that element queries will be restricted to something
like "container queries" so that all queries can only target the nearest
"viewport" ancestor element. This to avoid a lot of problems (such as
decreased parallelism and cyclic rules).

>From what I've read, this viewport element will be a new HTML element very
similar to an iframe, but without the new browsing context. So the viewport
element would have it's own viewport (of course) which the children would
write queries on (much like the window viewport and media queries). For
this to work, the viewport style cannot depend on it's children. This will
make it behave much like an iframe style-wise (no auto-height or similar
content flexibility).

*My question:*
Would it be possible to let the viewport element style properties depend on
it's children for the properties that are not present in any child element
query? Assume that the typical use case for element queries is to write
conditional CSS depending on the width of the viewport element. If no
element queries target the height of the viewport, could the viewport then
be allowed to behave like a normal block-element and have it's height be
computed by it's children?

I think by allowing this, working with viewport elements would be much more
pleasant since they behave as "normal" div elements with the addition that
one can write local element queries inside it.

Of course, for more advanced element queries that targets both the height
and width, the viewport can no longer depend on it's children.

Kind regards
Lucas Wiener

Received on Monday, 23 March 2015 10:39:06 UTC