message: Use OffscreenCanvas for measureText if available
diff: @@ -699,7 +699,22 @@ export default class TextMetrics
  * @private
  */
  -const canvas = document.createElement('canvas');
  +const canvas = (() =>
  +{
  + try
  + {
  + // OffscreenCanvas2D measureText can be up to 40% faster.
  + const c = new OffscreenCanvas(0, 0);
  +
  + c.getContext('2d');
  +
  + return c;
  + }
  + catch (ex)
  + {
  + return document.createElement('canvas');
  + }
  +})();
  canvas.width = canvas.height = 10;
  