-
Notifications
You must be signed in to change notification settings - Fork 661
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
[cssom-1][mediaqueries-5][css-color] Dealing with bi-plane (video/graphics) when reporting values #4471
Comments
My first instinct is that the most-CSS-y way to handle this would be through new video-* prefixed media features, although I don't know if there need to be as many new features as suggested. It sounds like most of the use cases would be covered by For rendering within a browser window, the width and height of the screen in CSS px would remain the same, only the dppx resolution would be different, so they wouldn't need separate queries. But for full screen video, the dimensions would be different. So maybe there would need to be |
Note that the big game changer here is the I like the "verbose but functional" suggestion to add that to both Screen and Video. I don't want TV-oriented content to be erroneously deciding that HDR is not supported because "there is no separate video plane and everyone knows the graphics plane is SDR only", for example. I'm going to head over to the original issue to explain why we like media features rather than media types. @frivoal please feel free to help out/correct me if wrong. |
I don't like the idea of using a Boolean for this. What happens when a new "super-high dynamic range" tech comes out? Or a "HDR lite" tech (higher than standard but not as high as other HDR devices)? The benefit of using an enumeration like |
Enumerating HDR (video) display capabilities would require two (2) new properties --
We have kind of kicked this concern around, but I do not recall a clear resolution. For the sake of my own understanding, I welcome feedback. Please let me know if this discussion should be separated into a new issue as to not derail the bi-plane discussion. |
CSS doesn't do booleans, because they're often a bad design for the reasons Amelia brought up, but it's easy to assuage that with an enum that currently just has two values, but can be extended in the future. And Chris is right; media types other than screen/print are deprecated and we don't plan to do any further work in that space. Overall they were a failure for what they intended (implying a number of MQ features as a bundle, before we invented the rest of MediaQueries), and we instead just handle their use-cases with more MQs when necessary. They were never useful for y'all's desired purpose, of reporting different values to some MQs based on what media type is being asked about, because they're evaluated totally independently of the rest; in effect they're just a So yeah, I'm with Amelia and Chris in preferring option 2, where we define some video-* MQs that duplicate some of the existing MQs, but specifically refer to the video plane. Like Amelia said, I don't think we need to carry over some of the weirder legacy color/sizing MQs, but I do think height/width are useful, so I suggest |
Agree with @vi-dot-cpp - I don't think we want to add transfer function to Screen. We instead added it to mediacapabilities.decodingInfo(), which works well for both the classic desktop/laptops as well as smart TV setups. strawman: what if we do an enum called |
Seems option 2 is the favorite, so this would imply adding |
Actually, the dynamic range supported by the PQ transfer function is already "crazy high" and the 2020 color gamut "crazy wide". Never say never, but it will be a long long while before consumer devices are capable of fully supporting either. Content today is mastered within a subset of the range that is expressible in this pixel encoding, but that subset still well exceeds existing consumer devices. Devices are expected to map down (tone map) from the provided range / gamut of the content to their actual capabilities. Provided a device has that tone mapping capability (which we'll discover through |
The currently defined CSS Or, could it cover what you need when combined with a measure of color bits per pixel, as suggested by the example in the CSSOM View spec describing the It would definitely be preferable to harmonize the concepts used in media queries with those used in CSSOM View, even separate from the bi-plane considerations. If we can do that, then it seems like a natural extension to handle bi-plane rendering by extending the necessary media queries to have video-* versions, and extending the Screen interface to have a |
@mwatson2 - keep me honest
They are distinct but interconnected concepts. Color gamut describes a color spectrum while SDR/HDR is about luminance range. In practice, different gamuts do correlate with sdr / hdr, but there are edge cases (like Apple's 2017 P3 displays, which are not HDR) and I think its not clean enough to live without a separate dynamic range signal. |
@chcunningham is correct that these are distinct concepts. Color gamut, color depth and dynamic range are all distinct things that can vary independently, though not all combinations are in use. In particular, BT.2020 color gamut is used with both standard dynamic range and high dynamic range as is 10 bit color depth. Color depth is about precision, not range. (btw, Example 3 here is wrong about this). To further clarify the problem description, given media in a specific format we must ask first whether the media can be rendered at all in some reasonable form and second whether it should in the case the site has a choice of formats. The first is a question about UA support for the codec and pixel data format and it's ability to map that meaningfully to the output device. The second is a question about the raw capability of the output device. We separate these questions because in some cases the site might not have a choice of formats and is only interested in whether the format can be rendered or not. If the site has a choice of formats, all of which can be rendered, it needs to know which is worthwhile and will produce the best result. Unless you have no choice, there is no point sending HDR if the output device is SDR, even if the UA has the capability to map it down. |
Agreeing with others that color gamut (how saturated a color can be displayed) and dynamic range (how many photographic stops of luminance can be displayed {all at once | at various times}) are distinct concepts although they are slightly correlated (HDR tends to require WCG as well, also higher bit depth per component).
That single Boolean will struggle with content that uses Rec.2020 colorspace and the HLG transfer function, though. "Everything uses PQ" is a Film/Movie-centric view; it is true there but not so much for News or Live Sports, for example. |
Ah, that's my own mis-remembering, not negligence on the part of the Media WG. Do you all have thoughts the If we opt for this enum, should we define a rubric by which to judge the dynamic range of a display? |
PG vs HLG is important for the can this be rendered question (which is answered by
Good luck with that ;-) The question I want to answer is whether it would produce a better result to send HDR content vs SDR when I have both available and the device can render both. At least at the margins this is a matter of opinion. So then I think we should leave this to UAs, as agents of the user, who is the one with the opinion. |
Looks like we are converging on the following, feel free to chime in:
CSS guidance is to add a
Screen HDR capabilities are represented the
There is concern though that { standard, high } are qualitative/un-standardized. As @mwatson2 noted:
Are we able to address this concern by standardizing recommended ranges for properties that comprise dynamic range? What are your thoughts/feedback? |
I think you mean for width to be in "CSS pixels" and same for height (length is typo). For clarity, resolution is "the number of device pixels per css unit". All that to say: while the values may differ between video* prefixed vs unprefixed features, but the units/definitions should be common to both.
I think he's just saying that some of the underlying pieces (eotf and color gamut) have lots of headroom to describe a category of devices that don't exist yet. Said another way, 5 years from now when a new generation of TVs may have a much higher contrast ratio, and we'll call it "crazy high" dynamic range, but PQ may still be a suitable transfer function. Mark's later comment is squarely on the side of not trying to assign tight definitions to categories of dynamic range. I think this sounds practical. There are a number of competing HDR badge requirements (e.g. UHD vs Vesa) and its a bit of a minefield to walk in. |
You're right. I've made edits to avoid confusion. |
@gregwhitworth there's been a lot of discussion since you added the agenda+ tag. Are we converging on option 2, as above? Let's continue the discussion here and possibly take it up on the call next week. |
@astearns Yep, I looked at the agenda list when I filed this and didn't expect it to make the agenda until about the 20th. Can we plan on it for that week? |
The media working group just resolved on this:
I'd like to add this to the agenda to get resolution in CSSWG as well. |
I think that the media wg made a good resolution, so urge css wg to resolve the same. |
Do we have a link to the Media WG discussion & resolution? Specifically, did the group make any statement about a preferred CSS OM API, or only about the media queries? |
The minutes from that meeting are here, but we didn't really discuss your question. I think the focus on media queries is mostly an artifact of the discussion having started with the (now abandoned) proposal number 3 above, which would add a new media queries media-type for the video plane. We also discussed how media queries will allow you to subscribe for events when things change - important in multi-display use cases. Having the information be also exposed on Screen seems like a nice-to-have. Is it generally a best practice to expose things in both ways? If so, I think either Screen.video.dyanmicRange or Screen.videoDynamicRange (and similar for other properties) would work - whichever is more idiomatic. |
The CSS Working Group just discussed
The full IRC log of that discussion<dael> Topic: [cssom-1][mediaqueries-5][css-color] Dealing with bi-plane (video/graphics) when reporting values<dael> github: https://github.com//issues/4471#issuecomment-555743057 <dael> gregwhitworth: Overview: the media WG looking into adding to capabilities API. Wanted to determine what in an output can support. WE came up with 3 options that are in the issue. <dael> gregwhitworth: AmeliaBR chris and TabAtkins said video-[property] made sense. Why we need this is TV manufactuors have 2 graphics plans. Where movie is shown gets different high support but menus might get lower capability and they don't plan to change that. <AmeliaBR> s/graphics plans/graphics planes/ <dael> gregwhitworth: They want to tell the truth and if we only have one plane they have to lie. chris went over it in the beginning where we could jsut tell them to lie, but ultimately what WG came to is video-[property list] that works in CSS media queries so we can use in JS or CSS and see if UA supports them <dael> gregwhitworth: Does anyone disagree with the resolution in media WG <dael> chris: Clarification; TVs have 4k for video and lower. I didn't want TVs to say this is how TVs work and we don't care about PCs. But would they return the same if there's one? <dael> gregwhitworth: Yes, we'd answer same statement if there's one plane. <dael> chris: Then yes, I think this is the best possible and I support <dael> florian: For video playing we're talking about if it's full screen and not window mode? <dael> gregwhitworth: Yes. We've been vague on what we mean because it's not a standarized term <dael> florian: I mean something that does not depend on layout <dael> gregwhitworth: My expectation would be no. I don't htink they're doing web layout. THey're different roles. <dael> florian: As long as it's a full thing then sure <dael> chris: I think it would work. Hardware would do a mask <dael> florian: Sure, that works. It's a MQ and shouldn't depend on layout <dael> AmeliaBR: I do think it's true that some environments use the separate plane for embedded videos, but it's at the level where they're rendering video data and converting to screen pixels. What MQ would match is assming full screen <dael> gregwhitworth: Right, wouldn't be layout of plane but dimension of the plane. It would be saying TV supports 4k and returns true with width and height <dael> myles: How does web content say I want this element to go in this plane <dael> gregwhitworth: You don't. WebDev doesn't get to derrive which element it goes on <dael> AmeliaBR: Part of definitions would be if rendering agent isn't using separate plane then these values would match regular MQ <dael> gregwhitworth: Correct <dael> myles: If every peice of content has non-standard parts what's rational for standarizing this MQ <dael> gregwhitworth: This would be like standarizing GPU chipsets. It's their version of hardware <dael> myles: Why standardize? Why not have own custom thing to annotate <dael> gregwhitworth: They're rendering web content. That was an option is pretend this doesn't exist. We keep only 1 query and force TVs to lie. But we had content providers say we want to know wha video is capable of rendering. I want the truth for each. I don't want ot send 4k images on lower resolution <dael> florian: Don't want UA sniff <dael> gregwhitworth: Yes, that's part of why 3 options. And it's not technically TV only but that's the angle <dael> chris: I want this to work same for non-TVs <dael> AmeliaBR: That's important consideration. MQs are saying when you render video what are features going to be. Sensible use case is on source lements in a video element that you're using to pick correct source. <bkardell_> what constitutes a 'tv' here? <bkardell_> seems like a weird term of distinction? <dael> AmeliaBR: How the browser decides what type of rendering environment it's going to use for video isn't important. Only thing that matters is UAs are using different rendering for video then for rest of content so existing MQs aren't sufficient. <dael> gregwhitworth: Yep <dael> AmeliaBR: If in future we have situation where this division isn't good enough and some other content wants super high level then that can be a discussion at the time. Reality of environments we have now is high resolution is for video <dael> gregwhitworth: My expectation also is that over time things will converge so 4k is available in both. Not reality now and b/c TV isn't upgraded often content providers want to provide correct content <dael> AmeliaBR: bkardell_ asks what's a TV here and we don't have to define that. We're defining the video resolution regardless of if it's a TV or a high powered laptop with a separate video card <dael> chris: Important point is we don't care but the answer is clear. Many times it will be the same but there are cases where it's not. <dael> chris: I don't see a down side. For most cases this is a bunc hof alaises <dael> astearns: Prop: add the video prefix MQ and define how used in bi-plane and non-bi-plane environments <dael> bkardell_: sgtm <dael> astearns: Obj? <dael> RESOLVED: Add the video prefix MQ and define how used in bi-plane and non-bi-plane environments <bkardell_> s/bkardell_/gregwhitworth <dael> chris: I think we should open a new issue on the OM thing <dael> astearns: I was about to bring that up. I think we should have a new issue for the OM part so summerizing that separately will be easier. <dael> chris: Anything I need to do for color 4? <dael> gregwhitworth: No, that was me ensuring chris got on the thread <chris> lol <dael> fantasai: For the OM part is there stuff that's parallel with the media queries or is there some additional thinking? <dael> AmeliaBR: Not exactly parallel. <dael> AmeliaBR: Last comment in issue is one of the Media folks saying they want to discuss on best API <dael> astearns: Let's open a new issue, hash it out, and bring to group <dael> AmeliaBR: Who is doing edits? <dael> gregwhitworth: I can take a stab at it <dael> fantasai: MQ 4 right? <dael> fantasai: We need a FPWD of MQ 5 at some point <fantasai> s/MQ 4/MQ 5/ <fantasai> https://drafts.csswg.org/mediaqueries-5/#contents |
@frivoal @tabatkins I'm finally getting around to making this edit (sorry for the delay) but I had a quick editorial question. Since ALL of them should contain the same values as the non-video counterparts, how do we want to represent that? Do we want it all duplicated or something along the lines of |
@gregwhitworth Interesting question, maybe worth a separate issue? CSS Values defines a way to reference the value syntax for properties ( Maybe |
I'm fine with just repeating the values for now. We can add a new non-terminal syntax if we start doing this sort of thing more often. Remember, WET (Write Everything Twice), not DRY! |
So, although we all agree that the |
Sorry, I forgot to mention the issue: #4535 |
"We" don't regard them as badly designed. They might have been better as more generic keywords, but that would have run the risk of needing more specific examples. Anyway, that doesn't need to hold up this issue. |
@gregwhitworth are you still able to make the required edits to close this issue, or should we look for other volunteers? Not sure if this is still in scope for you. |
Fine with me (I don't have that permission though) |
Hey folks,
Over in the Media WG we're trying to help web developers serving media content provide the best end user experience and we've encountered an interesting scenario that we'd like to get the CSSWG's feedback on. @chcunningham did a great job summarizing the very long discussion down to the various options we feel are available here.
We'd love to get your feedback on the proposals. Thanks.
The text was updated successfully, but these errors were encountered: