The WebGLRenderingContext.scissor() method of the WebGL API sets a scissor box, which limits the drawing to a specified rectangle.
WebGLRenderingContext.scissor()
external void scissor(GLint x, GLint y, GLsizei width, GLsizei height);