canvas.width = canvas.width has become an accepted shorthand for clearing the canvas. WebCore::HTMLCanvasElement::parseAttribute() calls reset() every time the width or height is set from JavaScript. That calls setSurfaceSize(), which forcibly throws away the WebCore::ImageBuffer, even when the width or height isn't actually changing. Most of the calls in reset() check to make sure that size() != oldSize; if we could extend that to being *all* the calls, we ought to be able to avoid destroying and recreating the ImageBuffer, which has a measurable performance impact on Chromium and may be thrashing textures in the driver for hardware-accelerated canvas rendering.
It looks like this suggestion was done in Bug 80871. *** This bug has been marked as a duplicate of bug 80871 ***