Add devicePixelRatio property to PaintRenderingContext2D#446
Conversation
|
No, in the discussion we resolved on adding it to the PaintWorkletGlobalScope so it would be consistent with devicePixelRatio. |
|
I looked at the discussion history and you are right. I will make changes accordingly. Thanks. |
|
|
||
| The {{PaintWorkletGlobalScope}} is the global execution context of the {{paintWorklet}}. | ||
|
|
||
| The {{PaintWorkletGlobalScope}} has a devicePixelRatio property, which represents the ratio |
There was a problem hiding this comment.
You can link to devicePixelRatio via. {{PaintWorkletGlobalScope/devicePixelRatio}}
|
@bfgeek added link to devicePixelRatio |
| The {{PaintWorkletGlobalScope}} has a {{PaintWorkletGlobalScope/devicePixelRatio}} property, | ||
| which represents the ratio of the resolution in physical pixels to the resolution of CSS | ||
| pixels for the current display device. When measured from the same display device, this | ||
| value must be identical to the Window.devicePixelRatio. |
There was a problem hiding this comment.
I was going to ask to reference devicePixelRatio, but it looks to me like the csswg has resolved not to standardize devicePixelRatio, see also this blog post for unprefixing -webkit-device-pixel-ratio. If the working group hasn't changed their stance on this, perhaps it's worth a note that we should aim to track whatever the expected way of querying the display density from javascript is. That thread suggests that the standard way is resolution but as far as I can tell you're unable to query that from javascript.
|
@flackr Please review. The new commit now reference to {{Window/devicePixelRatio}}. |
flackr
left a comment
There was a problem hiding this comment.
Thanks, looks good with one adjustment.
| The {{PaintWorkletGlobalScope}} has a {{PaintWorkletGlobalScope/devicePixelRatio}} property, | ||
| which represents the ratio of the resolution in physical pixels to the resolution of CSS | ||
| pixels for the current display device. When measured from the same display device, this | ||
| value must be identical to the Window.{{Window/devicePixelRatio}}. |
There was a problem hiding this comment.
Since we link to the spec which has a more precise definition of the device pixel ratio it probably makes sense to shorten this and not try to redefine what it means here. i.e. How about just The PaintWorkletGlobalScope has a devicePixelRatio property which is identical to the Window.devicePixelRatio property.
|
@flackr Thanks. I made the change, it is much simpler now :) |
|
@bfgeek This can be merged |
Per discussion here: #436, CSS working group agreed to add a devicePixelRatio property to the PaintRenderingContext2D.
@bfgeek Please review.