読者です 読者をやめる 読者になる 読者になる

latest log

酩酊状態で書いたエンジニアポエムです。酩酊状態で読んでください。

Chrome canary で enable-experimental-canvas-features フラグを有効にすると何がおきるのか

Chrome canary で chrome://flags/#enable-experimental-canvas-features を有効にした場合になにが起きるか調べました。

var ctx = document.createElement("canvas").getContext("2d");

{
  canvas: canvas,
  fillStyle: "#000000",
  font: "10px sans-serif",
  globalAlpha: 1,
  globalCompositeOperation: "source-over",
  imageSmoothingEnabled: true,
  lineCap: "butt",
  lineDashOffset: 0,
  lineJoin: "miter",
  lineWidth: 1,
  miterLimit: 10,
  shadowBlur: 0,
  shadowColor: "rgba(0, 0, 0, 0)",
  shadowOffsetX: 0,
  shadowOffsetY: 0,
  strokeStyle: "#000000",
  textAlign: "start",
  textBaseline: "alphabetic",
  webkitImageSmoothingEnabled: true
}

Object.keys(ctx.__proto__);
["save", "restore", "scale", "rotate", "translate", "transform",
 "setTransform", "resetTransform", "createLinearGradient",
 "createRadialGradient", "createPattern", "clearRect", "fillRect",
 "strokeRect", "beginPath", "fill", "stroke", "drawFocusIfNeeded",
 "clip", "isPointInPath", "isPointInStroke", "fillText", "strokeText",
 "measureText", "drawImage", "createImageData", "getImageData",
 "putImageData", "getContextAttributes", "setLineDash", "getLineDash",
 "setAlpha", "setCompositeOperation", "setLineWidth", "setLineCap",
 "setLineJoin", "setMiterLimit", "clearShadow", "setStrokeColor",
 "setFillColor", "drawImageFromRect", "setShadow", "closePath",
 "moveTo", "lineTo", "quadraticCurveTo", "bezierCurveTo",
 "arcTo", "rect", "arc", "ellipse"
]

#enable-experimental-canvas-features を有効にすると、プロパティが2つ、メソッドが5つ追加されます

{
 currentTransform: {
   a: 1,
   b: 0,
   c: 0,
   d: 1,
   e: 0,
   f: 0
 },
 direction: "ltr"
}

["scrollPathIntoView", "addHitRegion", "removeHitRegion", "clearHitRegions", "isContextLost"]

(ε・◇・)з o O ( あ、そうそう Chrome canary が version 40 の大台にのりましたね、おめでとうございます。