diff --git a/content/canvas/src/WebGLContextGL.cpp b/content/canvas/src/WebGLContextGL.cpp index 8065012ab90..508ee6abed3 100644 --- a/content/canvas/src/WebGLContextGL.cpp +++ b/content/canvas/src/WebGLContextGL.cpp @@ -486,10 +486,10 @@ WebGLContext::BufferSubData(GLenum target, WebGLsizeiptr byteOffset, CheckedUint32 checked_neededByteLength = CheckedUint32(byteOffset) + data->Length(); if (!checked_neededByteLength.isValid()) - return ErrorInvalidOperation("bufferSubData: integer overflow computing the needed byte length"); + return ErrorInvalidValue("bufferSubData: integer overflow computing the needed byte length"); if (checked_neededByteLength.value() > boundBuffer->ByteLength()) - return ErrorInvalidOperation("bufferSubData: not enough data - operation requires %d bytes, but buffer only has %d bytes", + return ErrorInvalidValue("bufferSubData: not enough data - operation requires %d bytes, but buffer only has %d bytes", checked_neededByteLength.value(), boundBuffer->ByteLength()); MakeContextCurrent(); @@ -524,10 +524,10 @@ WebGLContext::BufferSubData(WebGLenum target, WebGLsizeiptr byteOffset, CheckedUint32 checked_neededByteLength = CheckedUint32(byteOffset) + data.Length(); if (!checked_neededByteLength.isValid()) - return ErrorInvalidOperation("bufferSubData: integer overflow computing the needed byte length"); + return ErrorInvalidValue("bufferSubData: integer overflow computing the needed byte length"); if (checked_neededByteLength.value() > boundBuffer->ByteLength()) - return ErrorInvalidOperation("bufferSubData: not enough data -- operation requires %d bytes, but buffer only has %d bytes", + return ErrorInvalidValue("bufferSubData: not enough data -- operation requires %d bytes, but buffer only has %d bytes", checked_neededByteLength.value(), boundBuffer->ByteLength()); boundBuffer->ElementArrayCacheBufferSubData(byteOffset, data.Data(), data.Length());