[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75
cmarrin at apple.com
cmarrin at apple.com
Thu Oct 29 20:37:55 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit baf6fd0b6158f2de812548e9b70330bf7380a0b4
Author: cmarrin at apple.com <cmarrin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Oct 2 00:25:12 2009 +0000
https://bugs.webkit.org/show_bug.cgi?id=29906
Turn on compile time switch for WebGL, but have runtime switch default to off
This also fixes LayoutTests which broke with the flag turned on, and
fixes a crash found in the LayoutTests.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49006 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index d6d0a07..6b2fb82 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,21 @@
+2009-10-01 Chris Marrin <cmarrin at apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Turn on ENABLE_3D_CANVAS in TOT
+ https://bugs.webkit.org/show_bug.cgi?id=29906
+
+ Fixed layout tests which failed with flag on
+
+ * fast/canvas/webgl/gl-get-calls.html:
+ * fast/dom/Window/window-properties.html:
+ * fast/dom/script-tests/constructed-objects-prototypes.js:
+ (constructorPropertiesOnWindow):
+ * fast/dom/script-tests/prototype-inheritance-2.js:
+ (constructorNamesForWindow):
+ * fast/dom/script-tests/prototype-inheritance.js:
+ * fast/js/script-tests/global-constructors.js:
+
2009-10-01 Beth Dakin <bdakin at apple.com>
Reviewed by Dan Bernstein.
diff --git a/LayoutTests/fast/canvas/webgl/gl-get-calls.html b/LayoutTests/fast/canvas/webgl/gl-get-calls.html
index 0185020..60fc217 100644
--- a/LayoutTests/fast/canvas/webgl/gl-get-calls.html
+++ b/LayoutTests/fast/canvas/webgl/gl-get-calls.html
@@ -10,91 +10,91 @@
<script>
+if (window.layoutTestController)
+ layoutTestController.overridePreference("WebKitWebGLEnabled", "1");
+
description("This test ensures basic functionality of the underlying graphics library");
debug("");
debug("Canvas.getContext");
var context = document.getElementById("canvas").getContext("webkit-3d");
-if (context)
- testPassed("context exists");
-else
- testFailed("context does not exist");
+if (!context)
+ testFailed("context does not exist");
+else {
+ testPassed("context exists");
-debug("");
-debug("Context is correct type");
-if (context instanceof CanvasRenderingContext3D)
- testPassed("context is correct type");
-else
- testFailed("context is not correct type");
+ debug("");
+ debug("Context is correct type");
+ if (context instanceof CanvasRenderingContext3D)
+ testPassed("context is correct type");
+ else
+ testFailed("context is not correct type");
-debug("");
-debug("Context contains getError");
-if ("getError" in context)
- testPassed("context contains getError");
-else
- testFailed("context does not contains getError");
-
-debug("");
-debug("Check default values");
-shouldBe('context.getInteger(context.ACTIVE_TEXTURE)', 'context.TEXTURE0');
-shouldBe('context.getInteger(context.ALIASED_LINE_WIDTH_RANGE)', '1');
-shouldBe('context.getInteger(context.ALIASED_POINT_SIZE_RANGE)', '1');
-shouldBe('context.getInteger(context.ARRAY_BUFFER_BINDING)', '0');
-shouldBe('context.getInteger(context.BLEND)', '0');
-shouldBe('context.getInteger(context.BLEND_COLOR)', '0');
-shouldBe('context.getInteger(context.BLEND_DST_ALPHA)', '0');
-shouldBe('context.getInteger(context.BLEND_DST_RGB)', '0');
-shouldBe('context.getInteger(context.BLEND_EQUATION_ALPHA)', 'context.FUNC_ADD');
-shouldBe('context.getInteger(context.BLEND_EQUATION_RGB)', 'context.FUNC_ADD');
-shouldBe('context.getInteger(context.BLEND_SRC_ALPHA)', '1');
-shouldBe('context.getInteger(context.BLEND_SRC_RGB)', '1');
-shouldBe('context.getInteger(context.COLOR_CLEAR_VALUE)', '0');
-shouldBe('context.getInteger(context.COLOR_WRITEMASK)', '1');
-shouldBe('context.getInteger(context.CULL_FACE)', '0');
-shouldBe('context.getInteger(context.CULL_FACE_MODE)', 'context.BACK');
-shouldBe('context.getInteger(context.CURRENT_PROGRAM)', '0');
-shouldBe('context.getInteger(context.DEPTH_FUNC)', 'context.LESS');
-shouldBe('context.getInteger(context.DEPTH_RANGE)', '0');
-shouldBe('context.getInteger(context.DEPTH_TEST)', '0');
-shouldBe('context.getInteger(context.DEPTH_WRITEMASK)', '1');
-shouldBe('context.getInteger(context.DITHER)', '1');
-shouldBe('context.getInteger(context.ELEMENT_ARRAY_BUFFER_BINDING)', '0');
-shouldBe('context.getInteger(context.FRONT_FACE)', 'context.CCW');
-shouldBe('context.getInteger(context.GENERATE_MIPMAP_HINT)', 'context.DONT_CARE');
-shouldBe('context.getInteger(context.LINE_WIDTH)', '1');
-shouldBe('context.getInteger(context.POLYGON_OFFSET_FACTOR)', '0');
-shouldBe('context.getInteger(context.POLYGON_OFFSET_FILL)', '0');
-shouldBe('context.getInteger(context.POLYGON_OFFSET_UNITS)', '0');
-shouldBe('context.getInteger(context.RENDERBUFFER_BINDING_EXT)', '0');
-shouldBe('context.getInteger(context.SAMPLE_COVERAGE_INVERT)', '0');
-shouldBe('context.getInteger(context.SAMPLE_COVERAGE_VALUE)', '1');
-shouldBe('context.getInteger(context.SCISSOR_BOX)', '0');
-shouldBe('context.getInteger(context.SCISSOR_TEST)', '0');
-shouldBe('context.getInteger(context.STENCIL_BACK_FAIL)', 'context.KEEP');
-shouldBe('context.getInteger(context.STENCIL_BACK_FUNC)', 'context.ALWAYS');
-shouldBe('context.getInteger(context.STENCIL_BACK_PASS_DEPTH_FAIL)', 'context.KEEP');
-shouldBe('context.getInteger(context.STENCIL_BACK_PASS_DEPTH_PASS)', 'context.KEEP');
-shouldBe('context.getInteger(context.STENCIL_BACK_REF)', '0');
-shouldBe('context.getInteger(context.STENCIL_BACK_VALUE_MASK)', '-1');
-shouldBe('context.getInteger(context.STENCIL_BACK_WRITEMASK)', '-1');
-shouldBe('context.getInteger(context.STENCIL_BITS)', '0');
-shouldBe('context.getInteger(context.STENCIL_CLEAR_VALUE)', '0');
-shouldBe('context.getInteger(context.STENCIL_FAIL)', 'context.KEEP');
-shouldBe('context.getInteger(context.STENCIL_FUNC)', 'context.ALWAYS');
-shouldBe('context.getInteger(context.STENCIL_PASS_DEPTH_FAIL)', 'context.KEEP');
-shouldBe('context.getInteger(context.STENCIL_PASS_DEPTH_PASS)', 'context.KEEP');
-shouldBe('context.getInteger(context.STENCIL_REF)', '0');
-shouldBe('context.getInteger(context.STENCIL_TEST)', '0');
-shouldBe('context.getInteger(context.STENCIL_VALUE_MASK)', '-1');
-shouldBe('context.getInteger(context.STENCIL_WRITEMASK)', '-1');
-shouldBe('context.getInteger(context.TEXTURE_BINDING_2D)', '0');
-shouldBe('context.getInteger(context.TEXTURE_BINDING_CUBE_MAP)', '0');
-shouldBe('context.getInteger(context.VIEWPORT)', '0');
-
-
-
+ debug("");
+ debug("Context contains getError");
+ if ("getError" in context)
+ testPassed("context contains getError");
+ else
+ testFailed("context does not contains getError");
+ debug("");
+ debug("Check default values");
+ shouldBe('context.getInteger(context.ACTIVE_TEXTURE)', 'context.TEXTURE0');
+ shouldBe('context.getInteger(context.ALIASED_LINE_WIDTH_RANGE)', '1');
+ shouldBe('context.getInteger(context.ALIASED_POINT_SIZE_RANGE)', '1');
+ shouldBe('context.getInteger(context.ARRAY_BUFFER_BINDING)', '0');
+ shouldBe('context.getInteger(context.BLEND)', '0');
+ shouldBe('context.getInteger(context.BLEND_COLOR)', '0');
+ shouldBe('context.getInteger(context.BLEND_DST_ALPHA)', '0');
+ shouldBe('context.getInteger(context.BLEND_DST_RGB)', '0');
+ shouldBe('context.getInteger(context.BLEND_EQUATION_ALPHA)', 'context.FUNC_ADD');
+ shouldBe('context.getInteger(context.BLEND_EQUATION_RGB)', 'context.FUNC_ADD');
+ shouldBe('context.getInteger(context.BLEND_SRC_ALPHA)', '1');
+ shouldBe('context.getInteger(context.BLEND_SRC_RGB)', '1');
+ shouldBe('context.getInteger(context.COLOR_CLEAR_VALUE)', '0');
+ shouldBe('context.getInteger(context.COLOR_WRITEMASK)', '1');
+ shouldBe('context.getInteger(context.CULL_FACE)', '0');
+ shouldBe('context.getInteger(context.CULL_FACE_MODE)', 'context.BACK');
+ shouldBe('context.getInteger(context.CURRENT_PROGRAM)', '0');
+ shouldBe('context.getInteger(context.DEPTH_FUNC)', 'context.LESS');
+ shouldBe('context.getInteger(context.DEPTH_RANGE)', '0');
+ shouldBe('context.getInteger(context.DEPTH_TEST)', '0');
+ shouldBe('context.getInteger(context.DEPTH_WRITEMASK)', '1');
+ shouldBe('context.getInteger(context.DITHER)', '1');
+ shouldBe('context.getInteger(context.ELEMENT_ARRAY_BUFFER_BINDING)', '0');
+ shouldBe('context.getInteger(context.FRONT_FACE)', 'context.CCW');
+ shouldBe('context.getInteger(context.GENERATE_MIPMAP_HINT)', 'context.DONT_CARE');
+ shouldBe('context.getInteger(context.LINE_WIDTH)', '1');
+ shouldBe('context.getInteger(context.POLYGON_OFFSET_FACTOR)', '0');
+ shouldBe('context.getInteger(context.POLYGON_OFFSET_FILL)', '0');
+ shouldBe('context.getInteger(context.POLYGON_OFFSET_UNITS)', '0');
+ shouldBe('context.getInteger(context.RENDERBUFFER_BINDING_EXT)', '0');
+ shouldBe('context.getInteger(context.SAMPLE_COVERAGE_INVERT)', '0');
+ shouldBe('context.getInteger(context.SAMPLE_COVERAGE_VALUE)', '1');
+ shouldBe('context.getInteger(context.SCISSOR_BOX)', '0');
+ shouldBe('context.getInteger(context.SCISSOR_TEST)', '0');
+ shouldBe('context.getInteger(context.STENCIL_BACK_FAIL)', 'context.KEEP');
+ shouldBe('context.getInteger(context.STENCIL_BACK_FUNC)', 'context.ALWAYS');
+ shouldBe('context.getInteger(context.STENCIL_BACK_PASS_DEPTH_FAIL)', 'context.KEEP');
+ shouldBe('context.getInteger(context.STENCIL_BACK_PASS_DEPTH_PASS)', 'context.KEEP');
+ shouldBe('context.getInteger(context.STENCIL_BACK_REF)', '0');
+ shouldBe('context.getInteger(context.STENCIL_BACK_VALUE_MASK)', '-1');
+ shouldBe('context.getInteger(context.STENCIL_BACK_WRITEMASK)', '-1');
+ shouldBe('context.getInteger(context.STENCIL_BITS)', '0');
+ shouldBe('context.getInteger(context.STENCIL_CLEAR_VALUE)', '0');
+ shouldBe('context.getInteger(context.STENCIL_FAIL)', 'context.KEEP');
+ shouldBe('context.getInteger(context.STENCIL_FUNC)', 'context.ALWAYS');
+ shouldBe('context.getInteger(context.STENCIL_PASS_DEPTH_FAIL)', 'context.KEEP');
+ shouldBe('context.getInteger(context.STENCIL_PASS_DEPTH_PASS)', 'context.KEEP');
+ shouldBe('context.getInteger(context.STENCIL_REF)', '0');
+ shouldBe('context.getInteger(context.STENCIL_TEST)', '0');
+ shouldBe('context.getInteger(context.STENCIL_VALUE_MASK)', '-1');
+ shouldBe('context.getInteger(context.STENCIL_WRITEMASK)', '-1');
+ shouldBe('context.getInteger(context.TEXTURE_BINDING_2D)', '0');
+ shouldBe('context.getInteger(context.TEXTURE_BINDING_CUBE_MAP)', '0');
+ shouldBe('context.getInteger(context.VIEWPORT)', '0');
+}
debug("");
successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Window/window-properties.html b/LayoutTests/fast/dom/Window/window-properties.html
index 822c1fd..fa8be07 100644
--- a/LayoutTests/fast/dom/Window/window-properties.html
+++ b/LayoutTests/fast/dom/Window/window-properties.html
@@ -61,7 +61,16 @@ var __skip__ = {
"window.objCPluginFunction" : 1,
"window.plainText" : 1,
"window.textInputController" : 1,
- "window.CanvasRenderingContext3D" : 1 // We ignore CanvasRenderingContext3D and test it elsewhere, since it is not in all builds
+ // Ignore these properties because they do not exist in all implementations. They will be tested separately
+ "window.CanvasRenderingContext3D" : 1,
+ "window.CanvasArrayBuffer" : 1,
+ "window.CanvasByteArray" : 1,
+ "window.CanvasFloatArray" : 1,
+ "window.CanvasIntArray" : 1,
+ "window.CanvasShortArray" : 1,
+ "window.CanvasUnsignedByteArray" : 1,
+ "window.CanvasUnsignedIntArray" : 1,
+ "window.CanvasUnsignedShortArray" : 1
};
function logValue(valueName)
diff --git a/LayoutTests/fast/dom/script-tests/constructed-objects-prototypes.js b/LayoutTests/fast/dom/script-tests/constructed-objects-prototypes.js
index 56cd434..1f93d2a 100644
--- a/LayoutTests/fast/dom/script-tests/constructed-objects-prototypes.js
+++ b/LayoutTests/fast/dom/script-tests/constructed-objects-prototypes.js
@@ -26,6 +26,17 @@ function constructorPropertiesOnWindow(globalObject)
if (value == null)
continue;
var type = classNameForObject(value);
+ // Ignore these properties because they do not exist in all implementations. They will be tested separately
+ if (type == "CanvasRenderingContext3DConstructor" ||
+ type == "CanvasArrayBufferConstructor" ||
+ type =="CanvasByteArrayConstructor" ||
+ type =="CanvasFloatArrayConstructor" ||
+ type =="CanvasIntArrayConstructor" ||
+ type =="CanvasShortArrayConstructor" ||
+ type =="CanvasUnsignedByteArrayConstructor" ||
+ type =="CanvasUnsignedIntArrayConstructor" ||
+ type =="CanvasUnsignedShortArrayConstructor")
+ continue;
if (!type.match('Constructor$'))
continue;
constructorNames.push(property);
diff --git a/LayoutTests/fast/dom/script-tests/prototype-inheritance-2.js b/LayoutTests/fast/dom/script-tests/prototype-inheritance-2.js
index 154b5d8..26c3148 100644
--- a/LayoutTests/fast/dom/script-tests/prototype-inheritance-2.js
+++ b/LayoutTests/fast/dom/script-tests/prototype-inheritance-2.js
@@ -56,7 +56,16 @@ function constructorNamesForWindow(globalObject)
if (value == null)
continue;
var type = classNameForObject(value);
- if (type == "CanvasRenderingContext3DConstructor")
+ // Ignore these properties because they do not exist in all implementations. They will be tested separately
+ if (type == "CanvasRenderingContext3DConstructor" ||
+ type == "CanvasArrayBufferConstructor" ||
+ type == "CanvasByteArrayConstructor" ||
+ type =="CanvasFloatArrayConstructor" ||
+ type =="CanvasIntArrayConstructor" ||
+ type =="CanvasShortArrayConstructor" ||
+ type =="CanvasUnsignedByteArrayConstructor" ||
+ type =="CanvasUnsignedIntArrayConstructor" ||
+ type =="CanvasUnsignedShortArrayConstructor")
continue; // We ignore CanvasRenderingContext3D and test it elsewhere, since it is not in all builds
if (!type.match('Constructor$'))
continue;
diff --git a/LayoutTests/fast/dom/script-tests/prototype-inheritance.js b/LayoutTests/fast/dom/script-tests/prototype-inheritance.js
index 766e515..e326f6c 100644
--- a/LayoutTests/fast/dom/script-tests/prototype-inheritance.js
+++ b/LayoutTests/fast/dom/script-tests/prototype-inheritance.js
@@ -12,7 +12,9 @@ var skippedProperties = [
"objCController", "textInputController", "navigationController",
"eventSender", "objCPlugin", "objCPluginFunction",
"appleScriptController", "plainText", "accessibilityController",
- "CanvasRenderingContext3D", // Ignore this property because it does not exist in all implementations. It will be tested separately
+ // Ignore these properties because they do not exist in all implementations. They will be tested separately
+ "CanvasRenderingContext3D", "CanvasArrayBuffer",
+ "CanvasByteArray", "CanvasFloatArray", "CanvasIntArray", "CanvasShortArray", "CanvasUnsignedByteArray", "CanvasUnsignedIntArray", "CanvasUnsignedShortArray",
];
var skippedPropertiesSet = {};
diff --git a/LayoutTests/fast/js/script-tests/global-constructors.js b/LayoutTests/fast/js/script-tests/global-constructors.js
index b168f63..ea961ac 100644
--- a/LayoutTests/fast/js/script-tests/global-constructors.js
+++ b/LayoutTests/fast/js/script-tests/global-constructors.js
@@ -15,6 +15,19 @@ constructorNames.sort();
for (var x in constructorNames) {
var name = constructorNames[x];
var expectedConstructorName = "'[object " + name + "Constructor]'";
+
+ // Ignore these properties because they do not exist in all implementations. They will be tested separately
+ if (name == "CanvasRenderingContext3D" ||
+ name == "CanvasArrayBuffer" ||
+ name =="CanvasByteArray" ||
+ name =="CanvasFloatArray" ||
+ name =="CanvasIntArray" ||
+ name =="CanvasShortArray" ||
+ name =="CanvasUnsignedByteArray" ||
+ name =="CanvasUnsignedIntArray" ||
+ name =="CanvasUnsignedShortArray")
+ continue;
+
if (name == "XMLDocument")
// Gecko exposes an "XMLDocument" constructor, but we just use Document for XML documents instead of a custom sub-type
expectedConstructorName = "'[object DocumentConstructor]'";
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 58776e9..44b8d00 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,40 @@
+2009-10-01 Chris Marrin <cmarrin at apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Turn on ENABLE_3D_CANVAS in TOT
+ https://bugs.webkit.org/show_bug.cgi?id=29906
+
+ Fixed a bug found when running tests with flag on
+
+ * Configurations/FeatureDefines.xcconfig:
+ * WebCore.base.exp:
+ * bindings/js/JSCanvasArrayBufferConstructor.h:
+ (WebCore::construct):
+ * html/HTMLCanvasElement.cpp:
+ (WebCore::HTMLCanvasElement::getContext):
+ * html/canvas/CanvasArray.cpp:
+ (WebCore::CanvasArray::CanvasArray):
+ * html/canvas/CanvasByteArray.cpp:
+ (WebCore::CanvasByteArray::create):
+ * html/canvas/CanvasFloatArray.cpp:
+ (WebCore::CanvasFloatArray::create):
+ * html/canvas/CanvasIntArray.cpp:
+ (WebCore::CanvasIntArray::create):
+ * html/canvas/CanvasShortArray.cpp:
+ (WebCore::CanvasShortArray::create):
+ * html/canvas/CanvasUnsignedByteArray.cpp:
+ (WebCore::CanvasUnsignedByteArray::create):
+ * html/canvas/CanvasUnsignedIntArray.cpp:
+ (WebCore::CanvasUnsignedIntArray::create):
+ * html/canvas/CanvasUnsignedShortArray.cpp:
+ (WebCore::CanvasUnsignedShortArray::create):
+ * page/Settings.cpp:
+ (WebCore::Settings::Settings):
+ (WebCore::Settings::setWebGLEnabled):
+ * page/Settings.h:
+ (WebCore::Settings::webGLEnabled):
+
2009-10-01 Beth Dakin <bdakin at apple.com>
Reviewed by Dan Bernstein.
diff --git a/WebCore/Configurations/FeatureDefines.xcconfig b/WebCore/Configurations/FeatureDefines.xcconfig
index 9a37a63..ffc412e 100644
--- a/WebCore/Configurations/FeatureDefines.xcconfig
+++ b/WebCore/Configurations/FeatureDefines.xcconfig
@@ -28,7 +28,7 @@
// Set any ENABLE_FEATURE_NAME macro to an empty string to disable that feature.
-ENABLE_3D_CANVAS = ;
+ENABLE_3D_CANVAS = ENABLE_3D_CANVAS;
ENABLE_3D_RENDERING = $(ENABLE_3D_RENDERING_$(MAC_OS_X_VERSION_MAJOR));
ENABLE_3D_RENDERING_1050 = ENABLE_3D_RENDERING;
diff --git a/WebCore/WebCore.base.exp b/WebCore/WebCore.base.exp
index fa441b9..6674043 100644
--- a/WebCore/WebCore.base.exp
+++ b/WebCore/WebCore.base.exp
@@ -636,7 +636,7 @@ __ZN7WebCore8Settings25setShouldPrintBackgroundsEb
__ZN7WebCore8Settings25setUserStyleSheetLocationERKNS_4KURLE
__ZN7WebCore8Settings26setDefaultTextEncodingNameERKNS_6StringE
__ZN7WebCore8Settings26setNeedsSiteSpecificQuirksEb
-__ZN7WebCore8Settings27setExperimentalWebGLEnabledEb
+__ZN7WebCore8Settings15setWebGLEnabledEb
__ZN7WebCore8Settings27setFTPDirectoryTemplatePathERKNS_6StringE
__ZN7WebCore8Settings27setLoadsImagesAutomaticallyEb
__ZN7WebCore8Settings27setLocalStorageDatabasePathERKNS_6StringE
diff --git a/WebCore/bindings/js/JSCanvasArrayBufferConstructor.h b/WebCore/bindings/js/JSCanvasArrayBufferConstructor.h
index 44c9000..5f1254e 100644
--- a/WebCore/bindings/js/JSCanvasArrayBufferConstructor.h
+++ b/WebCore/bindings/js/JSCanvasArrayBufferConstructor.h
@@ -47,8 +47,9 @@ namespace WebCore {
//
RefPtr<C> arrayObject;
+ // For the 0 args case, just create an object without a buffer
if (args.size() < 1)
- return 0;
+ return C::create(0, 0, 0);
if (args.at(0).isObject()) {
RefPtr<CanvasArrayBuffer> buffer = toCanvasArrayBuffer(args.at(0));
diff --git a/WebCore/html/HTMLCanvasElement.cpp b/WebCore/html/HTMLCanvasElement.cpp
index 9b2f70c..e3fe329 100644
--- a/WebCore/html/HTMLCanvasElement.cpp
+++ b/WebCore/html/HTMLCanvasElement.cpp
@@ -166,7 +166,7 @@ CanvasRenderingContext* HTMLCanvasElement::getContext(const String& type)
}
#if ENABLE(3D_CANVAS)
Settings* settings = document()->settings();
- if (settings && settings->experimentalWebGLEnabled()) {
+ if (settings && settings->webGLEnabled()) {
if ((type == "webkit-3d") ||
(type == "GL")) {
if (m_context && !m_context->is3d())
diff --git a/WebCore/html/canvas/CanvasArray.cpp b/WebCore/html/canvas/CanvasArray.cpp
index 37cc840..1e7c0b8 100644
--- a/WebCore/html/canvas/CanvasArray.cpp
+++ b/WebCore/html/canvas/CanvasArray.cpp
@@ -36,7 +36,7 @@ namespace WebCore {
: m_offset(offset)
, m_buffer(buffer)
{
- m_baseAddress = static_cast<char*>(m_buffer->data()) + m_offset;
+ m_baseAddress = buffer ? (static_cast<char*>(m_buffer->data()) + m_offset) : 0;
}
CanvasArray::~CanvasArray()
diff --git a/WebCore/html/canvas/CanvasByteArray.cpp b/WebCore/html/canvas/CanvasByteArray.cpp
index 8375334..0f72ccf 100644
--- a/WebCore/html/canvas/CanvasByteArray.cpp
+++ b/WebCore/html/canvas/CanvasByteArray.cpp
@@ -48,12 +48,13 @@ PassRefPtr<CanvasByteArray> CanvasByteArray::create(signed char* array, unsigned
PassRefPtr<CanvasByteArray> CanvasByteArray::create(PassRefPtr<CanvasArrayBuffer> buffer, int offset, unsigned length)
{
- // Check to make sure we are talking about a valid region of
- // the given CanvasArrayBuffer's storage.
- if ((offset + (length * sizeof(signed char))) > buffer->byteLength()) {
- return NULL;
+ if (buffer) {
+ // Check to make sure we are talking about a valid region of
+ // the given CanvasArrayBuffer's storage.
+ if ((offset + (length * sizeof(signed char))) > buffer->byteLength())
+ return NULL;
}
-
+
return adoptRef(new CanvasByteArray(buffer, offset, length));
}
diff --git a/WebCore/html/canvas/CanvasFloatArray.cpp b/WebCore/html/canvas/CanvasFloatArray.cpp
index c78be1a..09561cb 100644
--- a/WebCore/html/canvas/CanvasFloatArray.cpp
+++ b/WebCore/html/canvas/CanvasFloatArray.cpp
@@ -48,16 +48,15 @@ namespace WebCore {
PassRefPtr<CanvasFloatArray> CanvasFloatArray::create(PassRefPtr<CanvasArrayBuffer> buffer, int offset, unsigned length)
{
// Make sure the offset results in valid alignment.
- if ((offset % sizeof(float)) != 0) {
+ if ((offset % sizeof(float)) != 0)
return NULL;
- }
- // Check to make sure we are talking about a valid region of
- // the given CanvasArrayBuffer's storage.
- if ((offset + (length * sizeof(float))) > buffer->byteLength()) {
- return NULL;
+ if (buffer) {
+ // Check to make sure we are talking about a valid region of
+ // the given CanvasArrayBuffer's storage.
+ if ((offset + (length * sizeof(float))) > buffer->byteLength())
+ return NULL;
}
-
return adoptRef(new CanvasFloatArray(buffer, offset, length));
}
diff --git a/WebCore/html/canvas/CanvasIntArray.cpp b/WebCore/html/canvas/CanvasIntArray.cpp
index 9a07b6e..4716d7b 100644
--- a/WebCore/html/canvas/CanvasIntArray.cpp
+++ b/WebCore/html/canvas/CanvasIntArray.cpp
@@ -51,16 +51,16 @@ namespace WebCore {
unsigned length)
{
// Make sure the offset results in valid alignment.
- if ((offset % sizeof(int)) != 0) {
+ if ((offset % sizeof(int)) != 0)
return NULL;
- }
- // Check to make sure we are talking about a valid region of
- // the given CanvasArrayBuffer's storage.
- if ((offset + (length * sizeof(int))) > buffer->byteLength()) {
- return NULL;
+ if (buffer) {
+ // Check to make sure we are talking about a valid region of
+ // the given CanvasArrayBuffer's storage.
+ if ((offset + (length * sizeof(int))) > buffer->byteLength())
+ return NULL;
}
-
+
return adoptRef(new CanvasIntArray(buffer, offset, length));
}
diff --git a/WebCore/html/canvas/CanvasShortArray.cpp b/WebCore/html/canvas/CanvasShortArray.cpp
index 44fc18e..d0cf135 100644
--- a/WebCore/html/canvas/CanvasShortArray.cpp
+++ b/WebCore/html/canvas/CanvasShortArray.cpp
@@ -51,14 +51,14 @@ namespace WebCore {
unsigned length)
{
// Make sure the offset results in valid alignment.
- if ((offset % sizeof(short)) != 0) {
+ if ((offset % sizeof(short)) != 0)
return NULL;
- }
- // Check to make sure we are talking about a valid region of
- // the given CanvasArrayBuffer's storage.
- if ((offset + (length * sizeof(short))) > buffer->byteLength()) {
- return NULL;
+ if (buffer) {
+ // Check to make sure we are talking about a valid region of
+ // the given CanvasArrayBuffer's storage.
+ if ((offset + (length * sizeof(short))) > buffer->byteLength())
+ return NULL;
}
return adoptRef(new CanvasShortArray(buffer, offset, length));
diff --git a/WebCore/html/canvas/CanvasUnsignedByteArray.cpp b/WebCore/html/canvas/CanvasUnsignedByteArray.cpp
index 0ad7b2b..a75066c 100644
--- a/WebCore/html/canvas/CanvasUnsignedByteArray.cpp
+++ b/WebCore/html/canvas/CanvasUnsignedByteArray.cpp
@@ -50,10 +50,11 @@ namespace WebCore {
int offset,
unsigned length)
{
- // Check to make sure we are talking about a valid region of
- // the given CanvasArrayBuffer's storage.
- if ((offset + (length * sizeof(unsigned char))) > buffer->byteLength()) {
- return NULL;
+ if (buffer) {
+ // Check to make sure we are talking about a valid region of
+ // the given CanvasArrayBuffer's storage.
+ if ((offset + (length * sizeof(unsigned char))) > buffer->byteLength())
+ return NULL;
}
return adoptRef(new CanvasUnsignedByteArray(buffer, offset, length));
diff --git a/WebCore/html/canvas/CanvasUnsignedIntArray.cpp b/WebCore/html/canvas/CanvasUnsignedIntArray.cpp
index e00e783..bd26343 100644
--- a/WebCore/html/canvas/CanvasUnsignedIntArray.cpp
+++ b/WebCore/html/canvas/CanvasUnsignedIntArray.cpp
@@ -55,10 +55,11 @@ namespace WebCore {
return NULL;
}
- // Check to make sure we are talking about a valid region of
- // the given CanvasArrayBuffer's storage.
- if ((offset + (length * sizeof(unsigned int))) > buffer->byteLength()) {
- return NULL;
+ if (buffer) {
+ // Check to make sure we are talking about a valid region of
+ // the given CanvasArrayBuffer's storage.
+ if ((offset + (length * sizeof(unsigned int))) > buffer->byteLength())
+ return NULL;
}
return adoptRef(new CanvasUnsignedIntArray(buffer, offset, length));
diff --git a/WebCore/html/canvas/CanvasUnsignedShortArray.cpp b/WebCore/html/canvas/CanvasUnsignedShortArray.cpp
index 03a4ce1..45d827b 100644
--- a/WebCore/html/canvas/CanvasUnsignedShortArray.cpp
+++ b/WebCore/html/canvas/CanvasUnsignedShortArray.cpp
@@ -55,10 +55,11 @@ namespace WebCore {
return NULL;
}
- // Check to make sure we are talking about a valid region of
- // the given CanvasArrayBuffer's storage.
- if ((offset + (length * sizeof(unsigned short))) > buffer->byteLength()) {
- return NULL;
+ if (buffer) {
+ // Check to make sure we are talking about a valid region of
+ // the given CanvasArrayBuffer's storage.
+ if ((offset + (length * sizeof(unsigned short))) > buffer->byteLength())
+ return NULL;
}
return adoptRef(new CanvasUnsignedShortArray(buffer, offset, length));
diff --git a/WebCore/page/Settings.cpp b/WebCore/page/Settings.cpp
index ab438a1..16295d2 100644
--- a/WebCore/page/Settings.cpp
+++ b/WebCore/page/Settings.cpp
@@ -117,7 +117,7 @@ Settings::Settings(Page* page)
, m_acceleratedCompositingEnabled(true)
, m_experimentalNotificationsEnabled(false)
, m_pluginHalterEnabled(false)
- , m_experimentalWebGLEnabled(false)
+ , m_webGLEnabled(false)
#if ENABLE(WEB_SOCKETS)
, m_experimentalWebSocketsEnabled(false)
#endif
@@ -532,9 +532,9 @@ void Settings::setShouldUseHighResolutionTimers(bool shouldUseHighResolutionTime
}
#endif
-void Settings::setExperimentalWebGLEnabled(bool enabled)
+void Settings::setWebGLEnabled(bool enabled)
{
- m_experimentalWebGLEnabled = enabled;
+ m_webGLEnabled = enabled;
}
#if ENABLE(WEB_SOCKETS)
diff --git a/WebCore/page/Settings.h b/WebCore/page/Settings.h
index ec9c8f9..cb7b1c2 100644
--- a/WebCore/page/Settings.h
+++ b/WebCore/page/Settings.h
@@ -267,10 +267,8 @@ namespace WebCore {
void setPluginAllowedRunTime(unsigned);
unsigned pluginAllowedRunTime() const { return m_pluginAllowedRunTime; }
- // This run-time flag is only temporary while the WebGL
- // specification is being developed.
- void setExperimentalWebGLEnabled(bool);
- bool experimentalWebGLEnabled() const { return m_experimentalWebGLEnabled; }
+ void setWebGLEnabled(bool);
+ bool webGLEnabled() const { return m_webGLEnabled; }
#if ENABLE(WEB_SOCKETS)
void setExperimentalWebSocketsEnabled(bool);
@@ -344,7 +342,7 @@ namespace WebCore {
bool m_acceleratedCompositingEnabled : 1;
bool m_experimentalNotificationsEnabled : 1;
bool m_pluginHalterEnabled : 1;
- bool m_experimentalWebGLEnabled : 1;
+ bool m_webGLEnabled : 1;
#if ENABLE(WEB_SOCKETS)
bool m_experimentalWebSocketsEnabled : 1;
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index 9b6dcdf..1975216 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,20 @@
+2009-10-01 Chris Marrin <cmarrin at apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Turn on ENABLE_3D_CANVAS in TOT
+ https://bugs.webkit.org/show_bug.cgi?id=29906
+
+ * Configurations/FeatureDefines.xcconfig:
+ * WebView/WebPreferenceKeysPrivate.h:
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences initialize]):
+ (-[WebPreferences webGLEnabled]):
+ (-[WebPreferences setWebGLEnabled:]):
+ * WebView/WebPreferencesPrivate.h:
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChangedNotification:]):
+
2009-09-30 Sam Weinig <sam at webkit.org>
Reviewed by Dan Bernstein.
diff --git a/WebKit/mac/Configurations/FeatureDefines.xcconfig b/WebKit/mac/Configurations/FeatureDefines.xcconfig
index 9a37a63..ffc412e 100644
--- a/WebKit/mac/Configurations/FeatureDefines.xcconfig
+++ b/WebKit/mac/Configurations/FeatureDefines.xcconfig
@@ -28,7 +28,7 @@
// Set any ENABLE_FEATURE_NAME macro to an empty string to disable that feature.
-ENABLE_3D_CANVAS = ;
+ENABLE_3D_CANVAS = ENABLE_3D_CANVAS;
ENABLE_3D_RENDERING = $(ENABLE_3D_RENDERING_$(MAC_OS_X_VERSION_MAJOR));
ENABLE_3D_RENDERING_1050 = ENABLE_3D_RENDERING;
diff --git a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
index f74a8d0..4651b77 100644
--- a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
+++ b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
@@ -86,6 +86,7 @@
#define WebKitZoomsTextOnlyPreferenceKey @"WebKitZoomsTextOnly"
#define WebKitXSSAuditorEnabledPreferenceKey @"WebKitXSSAuditorEnabled"
#define WebKitAcceleratedCompositingEnabledPreferenceKey @"WebKitAcceleratedCompositingEnabled"
+#define WebKitWebGLEnabledPreferenceKey @"WebKitWebGLEnabled"
// These are private both because callers should be using the cover methods and because the
// cover methods themselves are private.
diff --git a/WebKit/mac/WebView/WebPreferences.mm b/WebKit/mac/WebView/WebPreferences.mm
index d2e17ba..9f6f500 100644
--- a/WebKit/mac/WebView/WebPreferences.mm
+++ b/WebKit/mac/WebView/WebPreferences.mm
@@ -352,6 +352,7 @@ static WebCacheModel cacheModelForMainBundle(void)
[NSNumber numberWithBool:YES], WebKitZoomsTextOnlyPreferenceKey,
[NSNumber numberWithBool:YES], WebKitXSSAuditorEnabledPreferenceKey,
[NSNumber numberWithBool:YES], WebKitAcceleratedCompositingEnabledPreferenceKey,
+ [NSNumber numberWithBool:NO], WebKitWebGLEnabledPreferenceKey,
nil];
// This value shouldn't ever change, which is assumed in the initialization of WebKitPDFDisplayModePreferenceKey above
@@ -1160,6 +1161,16 @@ static NSString *classIBCreatorID = nil;
[self _setBoolValue:enabled forKey:WebKitAcceleratedCompositingEnabledPreferenceKey];
}
+- (BOOL)webGLEnabled
+{
+ return [self _boolValueForKey:WebKitWebGLEnabledPreferenceKey];
+}
+
+- (void)setWebGLEnabled:(BOOL)enabled
+{
+ [self _setBoolValue:enabled forKey:WebKitWebGLEnabledPreferenceKey];
+}
+
- (void)didRemoveFromWebView
{
ASSERT(_private->numWebViews);
diff --git a/WebKit/mac/WebView/WebPreferencesPrivate.h b/WebKit/mac/WebView/WebPreferencesPrivate.h
index 65f60ad..002b5e8 100644
--- a/WebKit/mac/WebView/WebPreferencesPrivate.h
+++ b/WebKit/mac/WebView/WebPreferencesPrivate.h
@@ -149,6 +149,9 @@ extern NSString *WebPreferencesRemovedNotification;
- (BOOL)acceleratedCompositingEnabled;
- (void)setAcceleratedCompositingEnabled:(BOOL)enabled;
+- (BOOL)webGLEnabled;
+- (void)setWebGLEnabled:(BOOL)enabled;
+
// Other private methods
- (void)_postPreferencesChangesNotification;
+ (WebPreferences *)_getInstanceForIdentifier:(NSString *)identifier;
diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm
index 998a261..aeb6ff3 100644
--- a/WebKit/mac/WebView/WebView.mm
+++ b/WebKit/mac/WebView/WebView.mm
@@ -1313,9 +1313,7 @@ static bool fastDocumentTeardownEnabled()
settings->setXSSAuditorEnabled([preferences isXSSAuditorEnabled]);
settings->setEnforceCSSMIMETypeInStrictMode(!WKAppVersionCheckLessThan(@"com.apple.iWeb", -1, 2.1));
settings->setAcceleratedCompositingEnabled([preferences acceleratedCompositingEnabled]);
-#if ENABLE(3D_CANVAS)
- settings->setExperimentalWebGLEnabled(true);
-#endif // ENABLE(3D_CANVAS)
+ settings->setWebGLEnabled([preferences webGLEnabled]);
}
static inline IMP getMethod(id o, SEL s)
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 8f4c8ff..8368987 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,12 @@
+2009-10-01 Chris Marrin <cmarrin at apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Turn on ENABLE_3D_CANVAS in TOT
+ https://bugs.webkit.org/show_bug.cgi?id=29906
+
+ * Scripts/build-webkit:
+
2009-10-01 Kenneth Rohde Christiansen <kenneth at webkit.org>
Rubberstamped by Simon Hausmann.
diff --git a/WebKitTools/Scripts/build-webkit b/WebKitTools/Scripts/build-webkit
index 4b5d8bd..4f78eef 100755
--- a/WebKitTools/Scripts/build-webkit
+++ b/WebKitTools/Scripts/build-webkit
@@ -59,7 +59,7 @@ my ($threeDCanvasSupport, $threeDRenderingSupport, $channelMessagingSupport, $da
my @features = (
{ option => "3d-canvas", desc => "Toggle 3D canvas support",
- define => "ENABLE_3D_CANVAS", default => 0, value => \$threeDCanvasSupport },
+ define => "ENABLE_3D_CANVAS", default => (isAppleMacWebKit() && !isTiger()), value => \$threeDCanvasSupport },
{ option => "3d-rendering", desc => "Toggle 3D rendering support",
define => "ENABLE_3D_RENDERING", default => (isAppleMacWebKit() && !isTiger()), value => \$threeDRenderingSupport },
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list