Full explainer available in the MSEdgeExplainers repo.
Motivation and background
Achieving low latency is critical for delivering great inking experiences on the web. Ink on the web is generally produced by consuming PointerEvents and rendering ink strokes to the application view, whether that be 2D or WebGL canvas. There are typically two types of representation of an ink stroke: ‘wet ink’, rendered while the pen is in contact with the screen, and ‘dry ink’, which is rendered once the pen is lifted. For applications such as annotating documents, wet ink is generally rendered segment-by-segment via canvas, but it is desirable for dry ink to become part of the document’s view.
There are a few fundamental sources of latency - operating system compositors introduce a frame of latency in order to compose all of the windows together. Additionally some browsers have a notion of aligning input with requestAnimationFrame callbacks to increase efficiency by not having web applications render frames that would never be seen by the user. There are existing proposals to address latency but they are not sufficient to solve all use cases for inking on the web (see explainer link for a more in depth discussion of the related work).
This is a proposal to progressively enhance existing inking web applications by providing an API by which developers can describe the last rendered point of an ink stroke. This can be described in sufficient detail that the User Agent and/or operating system can render an ink trail with lower latency than can be achieved in today’s web rendering pipeline, by connecting the last known input point to the last application-rendered point.