From 42b88caab2fbb7b074113ae68b29e0d6728204e4 Mon Sep 17 00:00:00 2001 From: xidachen Date: Sun, 6 Aug 2017 21:30:10 -0400 Subject: [PATCH 1/5] added devicePixelRatio property --- css-paint-api/Overview.bs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/css-paint-api/Overview.bs b/css-paint-api/Overview.bs index ab25d54f..94d226bc 100644 --- a/css-paint-api/Overview.bs +++ b/css-paint-api/Overview.bs @@ -356,6 +356,7 @@ The 2D rendering context {#2d-rendering-context}
 [Exposed=PaintWorklet]
 interface PaintRenderingContext2D {
+    readonly attribute unrestricted double devicePixelRatio;
 };
 PaintRenderingContext2D implements CanvasState;
 PaintRenderingContext2D implements CanvasTransform;
@@ -383,6 +384,11 @@ that the user agent will use internally or during rendering. For example, if the
 zoomed the user agent may internally use bitmaps which correspond to the number of device pixels in
 the coordinate space, so that the resulting rendering is of high quality.
 
+A {{PaintRenderingContext2D}} object has a 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.
+
 Additionally the user agent may record the sequence of drawing operations which have been applied to
 the output bitmap such that the user agent can subsequently draw onto a device bitmap at the
 correct resolution. This also allows user agents to re-use the same output of the output

From bf47fc545a6c6c8d9482fa9d9d5f0754a43cea67 Mon Sep 17 00:00:00 2001
From: xidachen 
Date: Thu, 10 Aug 2017 08:30:38 -0400
Subject: [PATCH 2/5] move to PaintWorkletGlobalScope

---
 css-paint-api/Overview.bs | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/css-paint-api/Overview.bs b/css-paint-api/Overview.bs
index 94d226bc..08005979 100644
--- a/css-paint-api/Overview.bs
+++ b/css-paint-api/Overview.bs
@@ -131,10 +131,16 @@ partial interface CSS {
 
 The {{PaintWorkletGlobalScope}} is the global execution context of the {{paintWorklet}}.
 
+The {{PaintWorkletGlobalScope}} has a 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.
+
 
 [Global=(Worklet,PaintWorklet),Exposed=PaintWorklet]
 interface PaintWorkletGlobalScope : WorkletGlobalScope {
     void registerPaint(DOMString name, VoidFunction paintCtor);
+    readonly attribute unrestricted double devicePixelRatio;
 };
 
@@ -356,7 +362,6 @@ The 2D rendering context {#2d-rendering-context}
 [Exposed=PaintWorklet]
 interface PaintRenderingContext2D {
-    readonly attribute unrestricted double devicePixelRatio;
 };
 PaintRenderingContext2D implements CanvasState;
 PaintRenderingContext2D implements CanvasTransform;
@@ -384,11 +389,6 @@ that the user agent will use internally or during rendering. For example, if the
 zoomed the user agent may internally use bitmaps which correspond to the number of device pixels in
 the coordinate space, so that the resulting rendering is of high quality.
 
-A {{PaintRenderingContext2D}} object has a 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.
-
 Additionally the user agent may record the sequence of drawing operations which have been applied to
 the output bitmap such that the user agent can subsequently draw onto a device bitmap at the
 correct resolution. This also allows user agents to re-use the same output of the output

From 169061a632e08dd4e19fb3e810ac12d12b019fba Mon Sep 17 00:00:00 2001
From: xidachen 
Date: Thu, 10 Aug 2017 13:26:30 -0400
Subject: [PATCH 3/5] add link to devicePixelRatio

---
 css-paint-api/Overview.bs | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/css-paint-api/Overview.bs b/css-paint-api/Overview.bs
index 08005979..ed27d8bd 100644
--- a/css-paint-api/Overview.bs
+++ b/css-paint-api/Overview.bs
@@ -131,10 +131,10 @@ partial interface CSS {
 
 The {{PaintWorkletGlobalScope}} is the global execution context of the {{paintWorklet}}.
 
-The {{PaintWorkletGlobalScope}} has a 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.
+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.
 
 
 [Global=(Worklet,PaintWorklet),Exposed=PaintWorklet]

From 4acfa05fbd73f1e07c9973d294f5776ad6fb93eb Mon Sep 17 00:00:00 2001
From: xidachen 
Date: Mon, 14 Aug 2017 14:22:28 -0400
Subject: [PATCH 4/5] added reference to Window.devicePixelRatio

---
 css-paint-api/Overview.bs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/css-paint-api/Overview.bs b/css-paint-api/Overview.bs
index ed27d8bd..6bee866c 100644
--- a/css-paint-api/Overview.bs
+++ b/css-paint-api/Overview.bs
@@ -134,7 +134,7 @@ The {{PaintWorkletGlobalScope}} is the global execution context of the {{paintWo
 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.
+value must be identical to the Window.{{Window/devicePixelRatio}}.
 
 
 [Global=(Worklet,PaintWorklet),Exposed=PaintWorklet]

From a6dddecd33186e186a738a8c02f6fb1a6fa44ac0 Mon Sep 17 00:00:00 2001
From: xidachen 
Date: Mon, 14 Aug 2017 15:03:55 -0400
Subject: [PATCH 5/5] simplify the paragraph

---
 css-paint-api/Overview.bs | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/css-paint-api/Overview.bs b/css-paint-api/Overview.bs
index 6bee866c..40d8505b 100644
--- a/css-paint-api/Overview.bs
+++ b/css-paint-api/Overview.bs
@@ -131,10 +131,8 @@ 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}}.
+The {{PaintWorkletGlobalScope}} has a {{PaintWorkletGlobalScope/devicePixelRatio}}
+property which is identical to the Window.{{Window/devicePixelRatio}} property.
 
 
 [Global=(Worklet,PaintWorklet),Exposed=PaintWorklet]