Re: [csswg-drafts] [resize-observer] device-pixel-border-box size (#3554)

Yes that would work (@chrishtr btw :))

One typo about requestAnimationFrame though, new code below:

```
function observerCallback(entry, observer) {
  let devicePixelBorderBoxRect = entry[0].devicePixelBorderBox;
  render(devicePixelBorderBoxRect); // WebGL rendering
}
function rafCallback() {
  observer.unobserve(myCanvas);
  observer.observe(myCanvas, {box: 'device-pixel-border-box'});
  requestAnimationFrame(rafCallback);
}
var observer = new ResizeObserver(observerCallback);
requestAnimationFrame(rafCallback);
```


-- 
GitHub Notification of comment by chrishtr
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3554#issuecomment-514763078 using your GitHub account

Received on Wednesday, 24 July 2019 19:14:25 UTC