Bug 81340

Summary: Setting WebGL canvas width/height does not reset context state
Product: WebKit Reporter: Sami Kyostila <skyostil>
Component: WebGLAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: bfulgham, gman
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   

Description Sami Kyostila 2012-03-16 05:32:44 PDT
From http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html:

"When the canvas element is created, and subsequently whenever the width and height attributes are set (whether to a new value or to the previous value), the bitmap and any associated contexts must be cleared back to their initial state and reinitialized with the newly specified coordinate space dimensions."

Currently this is only done for 2D contexts and not for WebGL. Also, the fast path for clearing the canvas when its size remains constant (https://bugs.webkit.org/show_bug.cgi?id=80871) is not applied to WebGL.
Comment 1 Gregg Tavares 2019-05-04 02:08:02 PDT
This is not relevant for WebGL. State is not lost in WebGL. That is part of the WebGL spec. You can close this issue. Open on one with WhatWG to fix their spec if this is still wrong there.