Skip to content

Add devicePixelRatio property to PaintRenderingContext2D #446

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

Merged
merged 5 commits into from
Sep 8, 2017
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions css-paint-api/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,16 @@ partial interface CSS {

The {{PaintWorkletGlobalScope}} is the global execution context of the {{paintWorklet}}.

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}}.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.


<pre class='idl'>
[Global=(Worklet,PaintWorklet),Exposed=PaintWorklet]
interface PaintWorkletGlobalScope : WorkletGlobalScope {
void registerPaint(DOMString name, VoidFunction paintCtor);
readonly attribute unrestricted double devicePixelRatio;
};
</pre>

Expand Down