[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.16-1409-g5afdf4d
cmarrin at apple.com
cmarrin at apple.com
Thu Dec 3 13:25:03 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit 44c3939da6afdc5a38314c1da606428b80afdb5d
Author: cmarrin at apple.com <cmarrin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Nov 3 00:04:29 2009 +0000
Exception checks were being too aggressive
https://bugs.webkit.org/show_bug.cgi?id=31005
Several calls in CanvasRenderingContext3D are allowed to
have a null value passed, which indicated that the
object is being unbound. Handle this case and the corresponding
null handling in GraphicsContext3DMac.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50432 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index a7d9c01..6b88ef4 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2009-11-02 Chris Marrin <cmarrin at apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Revised tests for changes to when exceptions are raised in WebGL content
+ https://bugs.webkit.org/show_bug.cgi?id=31005
+
+ * fast/canvas/webgl/incorrect-context-object-behaviour-expected.txt:
+ * fast/canvas/webgl/null-object-behaviour-expected.txt:
+ * fast/canvas/webgl/script-tests/incorrect-context-object-behaviour.js:
+ * fast/canvas/webgl/script-tests/null-object-behaviour.js:
+
2009-11-02 Philippe Normand <pnormand at igalia.com>
Reviewed by Jan Alonzo.
diff --git a/LayoutTests/fast/canvas/webgl/incorrect-context-object-behaviour-expected.txt b/LayoutTests/fast/canvas/webgl/incorrect-context-object-behaviour-expected.txt
index 2fc73e8..777d091 100644
--- a/LayoutTests/fast/canvas/webgl/incorrect-context-object-behaviour-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/incorrect-context-object-behaviour-expected.txt
@@ -12,11 +12,11 @@ PASS contextA.detachShader(programB, shaderA) threw exception Error: TYPE_MISMAT
PASS contextA.detachShader(programB, shaderB) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
PASS contextA.shaderSource(shaderB, 'foo') threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
PASS contextA.bindAttribLocation(programB, 0, 'foo') threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
-PASS contextA.bindFramebuffer(0, frameBufferB) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
-PASS contextA.bindRenderbuffer(0, renderBufferB) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
-PASS contextA.bindTexture(textureB) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
-PASS contextA.framebufferRenderbuffer(0, 0, renderBufferB) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
-PASS contextA.framebufferTexture2D(0, 0, textureB) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS contextA.bindFramebuffer(contextA.FRAMEBUFFER, frameBufferB) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS contextA.bindRenderbuffer(contextA.RENDERBUFFER, renderBufferB) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS contextA.bindTexture(contextA.TEXTURE_2D, textureB) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS contextA.framebufferRenderbuffer(contextA.FRAMEBUFFER, contextA.DEPTH_ATTACHMENT, contextA.RENDERBUFFER, renderBufferB) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS contextA.framebufferTexture2D(contextA.FRAMEBUFFER, contextA.COLOR_ATTACHMENT0, contextA.TEXTURE_2D, textureB, 0) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
PASS contextA.getProgrami(programB, 0) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
PASS contextA.getProgramiv(programB, 0) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
PASS contextA.getProgramInfoLog(programB, 0) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
diff --git a/LayoutTests/fast/canvas/webgl/null-object-behaviour-expected.txt b/LayoutTests/fast/canvas/webgl/null-object-behaviour-expected.txt
index a1f8298..1db44bf 100644
--- a/LayoutTests/fast/canvas/webgl/null-object-behaviour-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/null-object-behaviour-expected.txt
@@ -12,12 +12,12 @@ PASS context.detachShader(undefined, shader) threw exception Error: TYPE_MISMATC
PASS context.shaderSource() threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
PASS context.shaderSource(undefined, 'foo') threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
PASS context.bindAttribLocation(undefined, 0, 'foo') threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
-PASS context.bindBuffer(0) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
-PASS context.bindFramebuffer(0) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
-PASS context.bindRenderbuffer(0) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
-PASS context.bindTexture(0) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
-PASS context.framebufferRenderbuffer(0, 0, 0) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
-PASS context.framebufferTexture2D(0, 0, 0) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS context.bindBuffer(context.ARRAY_BUFFER, 0) is undefined.
+PASS context.bindFramebuffer(context.FRAMEBUFFER, 0) is undefined.
+PASS context.bindRenderbuffer(context.RENDERBUFFER, 0) is undefined.
+PASS context.bindTexture(context.TEXTURE_2D, 0) is undefined.
+PASS context.framebufferRenderbuffer(context.FRAMEBUFFER, context.DEPTH_ATTACHMENT, context.RENDERBUFFER, 0) is undefined.
+PASS context.framebufferTexture2D(context.FRAMEBUFFER, context.COLOR_ATTACHMENT0, context.TEXTURE_2D, 0, 0) is undefined.
PASS context.getProgrami(undefined, 0) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
PASS context.getProgramiv(undefined, 0) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
PASS context.getProgramInfoLog(undefined, 0) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
diff --git a/LayoutTests/fast/canvas/webgl/script-tests/incorrect-context-object-behaviour.js b/LayoutTests/fast/canvas/webgl/script-tests/incorrect-context-object-behaviour.js
index c699c7d..c81d7b9 100644
--- a/LayoutTests/fast/canvas/webgl/script-tests/incorrect-context-object-behaviour.js
+++ b/LayoutTests/fast/canvas/webgl/script-tests/incorrect-context-object-behaviour.js
@@ -26,11 +26,11 @@ shouldThrow("contextA.detachShader(programB, shaderA)");
shouldThrow("contextA.detachShader(programB, shaderB)");
shouldThrow("contextA.shaderSource(shaderB, 'foo')");
shouldThrow("contextA.bindAttribLocation(programB, 0, 'foo')");
-shouldThrow("contextA.bindFramebuffer(0, frameBufferB)");
-shouldThrow("contextA.bindRenderbuffer(0, renderBufferB)");
-shouldThrow("contextA.bindTexture(textureB)");
-shouldThrow("contextA.framebufferRenderbuffer(0, 0, renderBufferB)");
-shouldThrow("contextA.framebufferTexture2D(0, 0, textureB)");
+shouldThrow("contextA.bindFramebuffer(contextA.FRAMEBUFFER, frameBufferB)");
+shouldThrow("contextA.bindRenderbuffer(contextA.RENDERBUFFER, renderBufferB)");
+shouldThrow("contextA.bindTexture(contextA.TEXTURE_2D, textureB)");
+shouldThrow("contextA.framebufferRenderbuffer(contextA.FRAMEBUFFER, contextA.DEPTH_ATTACHMENT, contextA.RENDERBUFFER, renderBufferB)");
+shouldThrow("contextA.framebufferTexture2D(contextA.FRAMEBUFFER, contextA.COLOR_ATTACHMENT0, contextA.TEXTURE_2D, textureB, 0)");
shouldThrow("contextA.getProgrami(programB, 0)");
shouldThrow("contextA.getProgramiv(programB, 0)");
shouldThrow("contextA.getProgramInfoLog(programB, 0)");
diff --git a/LayoutTests/fast/canvas/webgl/script-tests/null-object-behaviour.js b/LayoutTests/fast/canvas/webgl/script-tests/null-object-behaviour.js
index 5463d0e..47b23d2 100644
--- a/LayoutTests/fast/canvas/webgl/script-tests/null-object-behaviour.js
+++ b/LayoutTests/fast/canvas/webgl/script-tests/null-object-behaviour.js
@@ -14,12 +14,12 @@ shouldThrow("context.detachShader(undefined, shader)");
shouldThrow("context.shaderSource()");
shouldThrow("context.shaderSource(undefined, 'foo')");
shouldThrow("context.bindAttribLocation(undefined, 0, 'foo')");
-shouldThrow("context.bindBuffer(0)");
-shouldThrow("context.bindFramebuffer(0)");
-shouldThrow("context.bindRenderbuffer(0)");
-shouldThrow("context.bindTexture(0)");
-shouldThrow("context.framebufferRenderbuffer(0, 0, 0)");
-shouldThrow("context.framebufferTexture2D(0, 0, 0)");
+shouldBeUndefined("context.bindBuffer(context.ARRAY_BUFFER, 0)");
+shouldBeUndefined("context.bindFramebuffer(context.FRAMEBUFFER, 0)");
+shouldBeUndefined("context.bindRenderbuffer(context.RENDERBUFFER, 0)");
+shouldBeUndefined("context.bindTexture(context.TEXTURE_2D, 0)");
+shouldBeUndefined("context.framebufferRenderbuffer(context.FRAMEBUFFER, context.DEPTH_ATTACHMENT, context.RENDERBUFFER, 0)");
+shouldBeUndefined("context.framebufferTexture2D(context.FRAMEBUFFER, context.COLOR_ATTACHMENT0, context.TEXTURE_2D, 0, 0)");
shouldThrow("context.getProgrami(undefined, 0)");
shouldThrow("context.getProgramiv(undefined, 0)");
shouldThrow("context.getProgramInfoLog(undefined, 0)");
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 4892a43..962ba8e 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,26 @@
+2009-11-02 Chris Marrin <cmarrin at apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Exception checks were being too aggressive
+ https://bugs.webkit.org/show_bug.cgi?id=31005
+
+ Several calls in CanvasRenderingContext3D are allowed to
+ have a null value passed, which indicated that the
+ object is being unbound. Handle this case and the corresponding
+ null handling in GraphicsContext3DMac.
+
+ * html/canvas/CanvasRenderingContext3D.cpp:
+ (WebCore::CanvasRenderingContext3D::bindBuffer):
+ (WebCore::CanvasRenderingContext3D::bindFramebuffer):
+ (WebCore::CanvasRenderingContext3D::bindRenderbuffer):
+ (WebCore::CanvasRenderingContext3D::bindTexture):
+ (WebCore::CanvasRenderingContext3D::framebufferRenderbuffer):
+ (WebCore::CanvasRenderingContext3D::framebufferTexture2D):
+ * platform/graphics/mac/GraphicsContext3DMac.cpp:
+ (WebCore::GraphicsContext3D::framebufferRenderbuffer):
+ (WebCore::GraphicsContext3D::framebufferTexture2D):
+
2009-11-02 Patrick Mueller <Patrick_Mueller at us.ibm.com>
Reviewed by Timothy Hatcher.
diff --git a/WebCore/html/canvas/CanvasRenderingContext3D.cpp b/WebCore/html/canvas/CanvasRenderingContext3D.cpp
index 4e1fa28..7b17039 100644
--- a/WebCore/html/canvas/CanvasRenderingContext3D.cpp
+++ b/WebCore/html/canvas/CanvasRenderingContext3D.cpp
@@ -151,7 +151,7 @@ void CanvasRenderingContext3D::bindAttribLocation(CanvasProgram* program, unsign
void CanvasRenderingContext3D::bindBuffer(unsigned long target, CanvasBuffer* buffer, ExceptionCode& ec)
{
- if (!buffer || buffer->context() != this) {
+ if (buffer && buffer->context() != this) {
ec = TYPE_MISMATCH_ERR;
return;
}
@@ -162,7 +162,7 @@ void CanvasRenderingContext3D::bindBuffer(unsigned long target, CanvasBuffer* bu
void CanvasRenderingContext3D::bindFramebuffer(unsigned long target, CanvasFramebuffer* buffer, ExceptionCode& ec)
{
- if (!buffer || buffer->context() != this) {
+ if (buffer && buffer->context() != this) {
ec = TYPE_MISMATCH_ERR;
return;
}
@@ -172,7 +172,7 @@ void CanvasRenderingContext3D::bindFramebuffer(unsigned long target, CanvasFrame
void CanvasRenderingContext3D::bindRenderbuffer(unsigned long target, CanvasRenderbuffer* renderBuffer, ExceptionCode& ec)
{
- if (!renderBuffer || renderBuffer->context() != this) {
+ if (renderBuffer && renderBuffer->context() != this) {
ec = TYPE_MISMATCH_ERR;
return;
}
@@ -183,7 +183,7 @@ void CanvasRenderingContext3D::bindRenderbuffer(unsigned long target, CanvasRend
void CanvasRenderingContext3D::bindTexture(unsigned long target, CanvasTexture* texture, ExceptionCode& ec)
{
- if (!texture || texture->context() != this) {
+ if (texture && texture->context() != this) {
ec = TYPE_MISMATCH_ERR;
return;
}
@@ -489,7 +489,7 @@ void CanvasRenderingContext3D::flush()
void CanvasRenderingContext3D::framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, CanvasRenderbuffer* buffer, ExceptionCode& ec)
{
- if (!buffer || buffer->context() != this) {
+ if (buffer && buffer->context() != this) {
ec = TYPE_MISMATCH_ERR;
return;
}
@@ -499,7 +499,7 @@ void CanvasRenderingContext3D::framebufferRenderbuffer(unsigned long target, uns
void CanvasRenderingContext3D::framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, CanvasTexture* texture, long level, ExceptionCode& ec)
{
- if (!texture || texture->context() != this) {
+ if (texture && texture->context() != this) {
ec = TYPE_MISMATCH_ERR;
return;
}
diff --git a/WebCore/platform/graphics/mac/GraphicsContext3DMac.cpp b/WebCore/platform/graphics/mac/GraphicsContext3DMac.cpp
index 9afc0b6..d479f96 100644
--- a/WebCore/platform/graphics/mac/GraphicsContext3DMac.cpp
+++ b/WebCore/platform/graphics/mac/GraphicsContext3DMac.cpp
@@ -478,18 +478,14 @@ void GraphicsContext3D::flush()
void GraphicsContext3D::framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, CanvasRenderbuffer* buffer)
{
- ASSERT(buffer);
-
ensureContext(m_contextObj);
- ::glFramebufferRenderbufferEXT(target, attachment, renderbuffertarget, (GLuint) buffer->object());
+ ::glFramebufferRenderbufferEXT(target, attachment, renderbuffertarget, buffer ? (GLuint) buffer->object() : 0);
}
void GraphicsContext3D::framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, CanvasTexture* texture, long level)
{
- ASSERT(texture);
-
ensureContext(m_contextObj);
- ::glFramebufferTexture2DEXT(target, attachment, textarget, (GLuint) texture->object(), level);
+ ::glFramebufferTexture2DEXT(target, attachment, textarget, texture ? (GLuint) texture->object() : 0, level);
}
void GraphicsContext3D::frontFace(unsigned long mode)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list