Merge m-i to m-c
authorPhil Ringnalda <philringnalda@gmail.com>
Mon, 17 Mar 2014 22:38:12 -0700
changeset 173986 89275f0ae29f3467eb022c62da0c3ea838cf4196
parent 173941 5d61fabc49a85f873893bc2079f12b62dcc3d367 (current diff)
parent 173985 db35f443e62e0dc5478c815aa63e9ac033fb7952 (diff)
child 173995 082761b7bc543109dbc6899ef118cf0e67a90d5a
push id26438
push userphilringnalda@gmail.com
push dateTue, 18 Mar 2014 05:39:07 +0000
treeherdermozilla-central@89275f0ae29f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone31.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge m-i to m-c
content/canvas/test/webgl/00_test_list.txt
content/canvas/test/webgl/README.mozilla
content/canvas/test/webgl/README.txt
content/canvas/test/webgl/conformance/00_readme.txt
content/canvas/test/webgl/conformance/00_test_list.txt
content/canvas/test/webgl/conformance/LICENSE_CHROMIUM
content/canvas/test/webgl/conformance/attribs/00_test_list.txt
content/canvas/test/webgl/conformance/attribs/gl-enable-vertex-attrib.html
content/canvas/test/webgl/conformance/attribs/gl-vertex-attrib-zero-issues.html
content/canvas/test/webgl/conformance/attribs/gl-vertex-attrib.html
content/canvas/test/webgl/conformance/attribs/gl-vertexattribpointer-offsets.html
content/canvas/test/webgl/conformance/attribs/gl-vertexattribpointer.html
content/canvas/test/webgl/conformance/buffers/00_test_list.txt
content/canvas/test/webgl/conformance/buffers/buffer-bind-test.html
content/canvas/test/webgl/conformance/buffers/buffer-data-array-buffer.html
content/canvas/test/webgl/conformance/buffers/index-validation-copies-indices.html
content/canvas/test/webgl/conformance/buffers/index-validation-crash-with-buffer-sub-data.html
content/canvas/test/webgl/conformance/buffers/index-validation-verifies-too-many-indices.html
content/canvas/test/webgl/conformance/buffers/index-validation-with-resized-buffer.html
content/canvas/test/webgl/conformance/buffers/index-validation.html
content/canvas/test/webgl/conformance/canvas/00_test_list.txt
content/canvas/test/webgl/conformance/canvas/buffer-offscreen-test.html
content/canvas/test/webgl/conformance/canvas/buffer-preserve-test.html
content/canvas/test/webgl/conformance/canvas/canvas-test.html
content/canvas/test/webgl/conformance/canvas/canvas-zero-size.html
content/canvas/test/webgl/conformance/canvas/drawingbuffer-static-canvas-test.html
content/canvas/test/webgl/conformance/canvas/drawingbuffer-test.html
content/canvas/test/webgl/conformance/canvas/viewport-unchanged-upon-resize.html
content/canvas/test/webgl/conformance/context/00_test_list.txt
content/canvas/test/webgl/conformance/context/constants.html
content/canvas/test/webgl/conformance/context/context-attribute-preserve-drawing-buffer.html
content/canvas/test/webgl/conformance/context/context-attributes-alpha-depth-stencil-antialias.html
content/canvas/test/webgl/conformance/context/context-lost-restored.html
content/canvas/test/webgl/conformance/context/context-lost.html
content/canvas/test/webgl/conformance/context/context-type-test.html
content/canvas/test/webgl/conformance/context/incorrect-context-object-behaviour.html
content/canvas/test/webgl/conformance/context/methods.html
content/canvas/test/webgl/conformance/context/premultiplyalpha-test.html
content/canvas/test/webgl/conformance/context/resource-sharing-test.html
content/canvas/test/webgl/conformance/extensions/00_test_list.txt
content/canvas/test/webgl/conformance/extensions/ext-sRGB.html
content/canvas/test/webgl/conformance/extensions/ext-texture-filter-anisotropic.html
content/canvas/test/webgl/conformance/extensions/oes-standard-derivatives.html
content/canvas/test/webgl/conformance/extensions/oes-texture-float.html
content/canvas/test/webgl/conformance/extensions/oes-vertex-array-object.html
content/canvas/test/webgl/conformance/extensions/webgl-compressed-texture-etc1.html
content/canvas/test/webgl/conformance/extensions/webgl-compressed-texture-s3tc.html
content/canvas/test/webgl/conformance/extensions/webgl-debug-renderer-info.html
content/canvas/test/webgl/conformance/extensions/webgl-debug-shaders.html
content/canvas/test/webgl/conformance/extensions/webgl-depth-texture.html
content/canvas/test/webgl/conformance/glsl/00_test_list.txt
content/canvas/test/webgl/conformance/glsl/functions/00_test_list.txt
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-abs.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-acos.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-asin.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-atan-xy.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-atan.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-ceil.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-clamp-float.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-clamp-gentype.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-cos.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-cross.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-distance.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-dot.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-faceforward.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-floor.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-fract.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-length.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-lessThan.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-max-float.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-max-gentype.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-min-float.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-min-gentype.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-mix-float.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-mix-gentype.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-mod-float.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-mod-gentype.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-normalize.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-reflect.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-refract.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-sign.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-sin.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-smoothstep-float.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-smoothstep-gentype.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-step-float.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function-step-gentype.html
content/canvas/test/webgl/conformance/glsl/functions/glsl-function.html
content/canvas/test/webgl/conformance/glsl/implicit/00_test_list.txt
content/canvas/test/webgl/conformance/glsl/implicit/add_int_float.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/add_int_mat2.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/add_int_mat3.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/add_int_mat4.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/add_int_vec2.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/add_int_vec3.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/add_int_vec4.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/add_ivec2_vec2.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/add_ivec3_vec3.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/add_ivec4_vec4.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/assign_int_to_float.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/assign_ivec2_to_vec2.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/assign_ivec3_to_vec3.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/assign_ivec4_to_vec4.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/construct_struct.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/divide_int_float.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/divide_int_mat2.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/divide_int_mat3.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/divide_int_mat4.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/divide_int_vec2.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/divide_int_vec3.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/divide_int_vec4.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/divide_ivec2_vec2.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/divide_ivec3_vec3.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/divide_ivec4_vec4.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/equal_int_float.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/equal_ivec2_vec2.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/equal_ivec3_vec3.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/equal_ivec4_vec4.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/function_int_float.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/function_ivec2_vec2.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/function_ivec3_vec3.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/function_ivec4_vec4.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/greater_than.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/greater_than_equal.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/less_than.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/less_than_equal.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/multiply_int_float.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/multiply_int_mat2.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/multiply_int_mat3.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/multiply_int_mat4.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/multiply_int_vec2.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/multiply_int_vec3.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/multiply_int_vec4.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/multiply_ivec2_vec2.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/multiply_ivec3_vec3.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/multiply_ivec4_vec4.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/not_equal_int_float.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/not_equal_ivec2_vec2.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/not_equal_ivec3_vec3.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/not_equal_ivec4_vec4.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/subtract_int_float.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/subtract_int_mat2.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/subtract_int_mat3.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/subtract_int_mat4.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/subtract_int_vec2.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/subtract_int_vec3.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/subtract_int_vec4.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/subtract_ivec2_vec2.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/subtract_ivec3_vec3.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/subtract_ivec4_vec4.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/ternary_int_float.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/ternary_ivec2_vec2.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/ternary_ivec3_vec3.vert.html
content/canvas/test/webgl/conformance/glsl/implicit/ternary_ivec4_vec4.vert.html
content/canvas/test/webgl/conformance/glsl/matrices/00_test_list.txt
content/canvas/test/webgl/conformance/glsl/matrices/glsl-mat4-to-mat3.html
content/canvas/test/webgl/conformance/glsl/misc/00_test_list.txt
content/canvas/test/webgl/conformance/glsl/misc/attrib-location-length-limits.html
content/canvas/test/webgl/conformance/glsl/misc/embedded-struct-definitions-forbidden.html
content/canvas/test/webgl/conformance/glsl/misc/glsl-2types-of-textures-on-same-unit.html
content/canvas/test/webgl/conformance/glsl/misc/glsl-function-nodes.html
content/canvas/test/webgl/conformance/glsl/misc/glsl-long-variable-names.html
content/canvas/test/webgl/conformance/glsl/misc/glsl-vertex-branch.html
content/canvas/test/webgl/conformance/glsl/misc/include.vs
content/canvas/test/webgl/conformance/glsl/misc/non-ascii-comments.vert.html
content/canvas/test/webgl/conformance/glsl/misc/non-ascii.vert.html
content/canvas/test/webgl/conformance/glsl/misc/re-compile-re-link.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-256-character-identifier.frag.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-257-character-identifier.frag.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-_webgl-identifier.vert.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-arbitrary-indexing.frag.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-arbitrary-indexing.vert.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-attrib-array.vert.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-attrib-struct.vert.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-clipvertex.vert.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-comma-assignment.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-comma-conditional-assignment.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-conditional-scoping.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-default-precision.frag.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-default-precision.vert.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-define-line-continuation.frag.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-dfdx-no-ext.frag.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-dfdx.frag.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-do-scoping.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-error-directive.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-explicit-int-cast.vert.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-float-return-value.frag.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-for-loop.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-for-scoping.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-frag-depth.frag.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-function-recursion.frag.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-function-scoped-struct.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-functional-scoping.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-glcolor.vert.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-gles-1.frag.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-gles-symbol.frag.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-glprojectionmatrix.vert.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-hex-int-constant-macro.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-implicit-vec3-to-vec4-cast.vert.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-include.vert.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-int-return-value.frag.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-invalid-identifier.frag.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-ivec2-return-value.frag.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-ivec3-return-value.frag.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-ivec4-return-value.frag.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-limited-indexing.frag.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-line-directive.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-long-line.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-non-ascii-error.frag.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-precision.frag.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-quoted-error.frag.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-undefined-preprocessor-symbol.frag.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-uniform-in-loop-condition.vert.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-vec2-return-value.frag.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-vec3-return-value.frag.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-vec4-return-value.frag.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-vec4-vec3-vec4-conditional.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-version-100.frag.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-version-100.vert.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-version-120.vert.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-version-130.vert.html
content/canvas/test/webgl/conformance/glsl/misc/shader-with-webgl-identifier.vert.html
content/canvas/test/webgl/conformance/glsl/misc/shader-without-precision.frag.html
content/canvas/test/webgl/conformance/glsl/misc/shared.html
content/canvas/test/webgl/conformance/glsl/misc/struct-nesting-exceeds-maximum.html
content/canvas/test/webgl/conformance/glsl/misc/struct-nesting-under-maximum.html
content/canvas/test/webgl/conformance/glsl/misc/uniform-location-length-limits.html
content/canvas/test/webgl/conformance/glsl/reserved/00_test_list.txt
content/canvas/test/webgl/conformance/glsl/reserved/_webgl_field.vert.html
content/canvas/test/webgl/conformance/glsl/reserved/_webgl_function.vert.html
content/canvas/test/webgl/conformance/glsl/reserved/_webgl_struct.vert.html
content/canvas/test/webgl/conformance/glsl/reserved/_webgl_variable.vert.html
content/canvas/test/webgl/conformance/glsl/reserved/webgl_field.vert.html
content/canvas/test/webgl/conformance/glsl/reserved/webgl_function.vert.html
content/canvas/test/webgl/conformance/glsl/reserved/webgl_struct.vert.html
content/canvas/test/webgl/conformance/glsl/reserved/webgl_variable.vert.html
content/canvas/test/webgl/conformance/glsl/samplers/00_test_list.txt
content/canvas/test/webgl/conformance/glsl/samplers/glsl-function-texture2d-bias.html
content/canvas/test/webgl/conformance/glsl/samplers/glsl-function-texture2dlod.html
content/canvas/test/webgl/conformance/glsl/samplers/glsl-function-texture2dproj.html
content/canvas/test/webgl/conformance/glsl/variables/00_test_list.txt
content/canvas/test/webgl/conformance/glsl/variables/gl-fragcoord.html
content/canvas/test/webgl/conformance/glsl/variables/gl-frontfacing.html
content/canvas/test/webgl/conformance/glsl/variables/gl-pointcoord.html
content/canvas/test/webgl/conformance/limits/00_test_list.txt
content/canvas/test/webgl/conformance/limits/gl-max-texture-dimensions.html
content/canvas/test/webgl/conformance/limits/gl-min-attribs.html
content/canvas/test/webgl/conformance/limits/gl-min-textures.html
content/canvas/test/webgl/conformance/limits/gl-min-uniforms.html
content/canvas/test/webgl/conformance/misc/00_test_list.txt
content/canvas/test/webgl/conformance/misc/bad-arguments-test.html
content/canvas/test/webgl/conformance/misc/delayed-drawing.html
content/canvas/test/webgl/conformance/misc/error-reporting.html
content/canvas/test/webgl/conformance/misc/functions-returning-strings.html
content/canvas/test/webgl/conformance/misc/instanceof-test.html
content/canvas/test/webgl/conformance/misc/invalid-passed-params.html
content/canvas/test/webgl/conformance/misc/is-object.html
content/canvas/test/webgl/conformance/misc/null-object-behaviour.html
content/canvas/test/webgl/conformance/misc/object-deletion-behaviour.html
content/canvas/test/webgl/conformance/misc/shader-precision-format.html
content/canvas/test/webgl/conformance/misc/type-conversion-test.html
content/canvas/test/webgl/conformance/misc/uninitialized-test.html
content/canvas/test/webgl/conformance/misc/webgl-specific.html
content/canvas/test/webgl/conformance/more/00_test_list.txt
content/canvas/test/webgl/conformance/more/README.md
content/canvas/test/webgl/conformance/more/all_tests.html
content/canvas/test/webgl/conformance/more/all_tests_linkonly.html
content/canvas/test/webgl/conformance/more/all_tests_sequential.html
content/canvas/test/webgl/conformance/more/conformance/argGenerators-A.js
content/canvas/test/webgl/conformance/more/conformance/argGenerators-B1.js
content/canvas/test/webgl/conformance/more/conformance/argGenerators-B2.js
content/canvas/test/webgl/conformance/more/conformance/argGenerators-B3.js
content/canvas/test/webgl/conformance/more/conformance/argGenerators-B4.js
content/canvas/test/webgl/conformance/more/conformance/argGenerators-C.js
content/canvas/test/webgl/conformance/more/conformance/argGenerators-D_G.js
content/canvas/test/webgl/conformance/more/conformance/argGenerators-G_I.js
content/canvas/test/webgl/conformance/more/conformance/argGenerators-L_S.js
content/canvas/test/webgl/conformance/more/conformance/argGenerators-S_V.js
content/canvas/test/webgl/conformance/more/conformance/badArgsArityLessThanArgc.html
content/canvas/test/webgl/conformance/more/conformance/constants.html
content/canvas/test/webgl/conformance/more/conformance/fuzzTheAPI.html
content/canvas/test/webgl/conformance/more/conformance/getContext.html
content/canvas/test/webgl/conformance/more/conformance/methods.html
content/canvas/test/webgl/conformance/more/conformance/quickCheckAPI-A.html
content/canvas/test/webgl/conformance/more/conformance/quickCheckAPI-B1.html
content/canvas/test/webgl/conformance/more/conformance/quickCheckAPI-B2.html
content/canvas/test/webgl/conformance/more/conformance/quickCheckAPI-B3.html
content/canvas/test/webgl/conformance/more/conformance/quickCheckAPI-B4.html
content/canvas/test/webgl/conformance/more/conformance/quickCheckAPI-C.html
content/canvas/test/webgl/conformance/more/conformance/quickCheckAPI-D_G.html
content/canvas/test/webgl/conformance/more/conformance/quickCheckAPI-G_I.html
content/canvas/test/webgl/conformance/more/conformance/quickCheckAPI-L_S.html
content/canvas/test/webgl/conformance/more/conformance/quickCheckAPI-S_V.html
content/canvas/test/webgl/conformance/more/conformance/quickCheckAPI.js
content/canvas/test/webgl/conformance/more/conformance/quickCheckAPIBadArgs.html
content/canvas/test/webgl/conformance/more/conformance/webGLArrays.html
content/canvas/test/webgl/conformance/more/demos/opengl_web.html
content/canvas/test/webgl/conformance/more/demos/video.html
content/canvas/test/webgl/conformance/more/functions/bindBuffer.html
content/canvas/test/webgl/conformance/more/functions/bindBufferBadArgs.html
content/canvas/test/webgl/conformance/more/functions/bindFramebufferLeaveNonZero.html
content/canvas/test/webgl/conformance/more/functions/bufferData.html
content/canvas/test/webgl/conformance/more/functions/bufferDataBadArgs.html
content/canvas/test/webgl/conformance/more/functions/bufferSubData.html
content/canvas/test/webgl/conformance/more/functions/bufferSubDataBadArgs.html
content/canvas/test/webgl/conformance/more/functions/copyTexImage2D.html
content/canvas/test/webgl/conformance/more/functions/copyTexImage2DBadArgs.html
content/canvas/test/webgl/conformance/more/functions/copyTexSubImage2D.html
content/canvas/test/webgl/conformance/more/functions/copyTexSubImage2DBadArgs.html
content/canvas/test/webgl/conformance/more/functions/deleteBufferBadArgs.html
content/canvas/test/webgl/conformance/more/functions/drawArrays.html
content/canvas/test/webgl/conformance/more/functions/drawArraysOutOfBounds.html
content/canvas/test/webgl/conformance/more/functions/drawElements.html
content/canvas/test/webgl/conformance/more/functions/drawElementsBadArgs.html
content/canvas/test/webgl/conformance/more/functions/isTests.html
content/canvas/test/webgl/conformance/more/functions/readPixels.html
content/canvas/test/webgl/conformance/more/functions/readPixelsBadArgs.html
content/canvas/test/webgl/conformance/more/functions/texImage2D.html
content/canvas/test/webgl/conformance/more/functions/texImage2DBadArgs.html
content/canvas/test/webgl/conformance/more/functions/texImage2DHTML.html
content/canvas/test/webgl/conformance/more/functions/texImage2DHTMLBadArgs.html
content/canvas/test/webgl/conformance/more/functions/texSubImage2D.html
content/canvas/test/webgl/conformance/more/functions/texSubImage2DBadArgs.html
content/canvas/test/webgl/conformance/more/functions/texSubImage2DHTML.html
content/canvas/test/webgl/conformance/more/functions/texSubImage2DHTMLBadArgs.html
content/canvas/test/webgl/conformance/more/functions/uniformMatrix.html
content/canvas/test/webgl/conformance/more/functions/uniformMatrixBadArgs.html
content/canvas/test/webgl/conformance/more/functions/uniformf.html
content/canvas/test/webgl/conformance/more/functions/uniformfArrayLen1.html
content/canvas/test/webgl/conformance/more/functions/uniformfBadArgs.html
content/canvas/test/webgl/conformance/more/functions/uniformi.html
content/canvas/test/webgl/conformance/more/functions/uniformiBadArgs.html
content/canvas/test/webgl/conformance/more/functions/vertexAttrib.html
content/canvas/test/webgl/conformance/more/functions/vertexAttribBadArgs.html
content/canvas/test/webgl/conformance/more/functions/vertexAttribPointer.html
content/canvas/test/webgl/conformance/more/functions/vertexAttribPointerBadArgs.html
content/canvas/test/webgl/conformance/more/glsl/arrayOutOfBounds.html
content/canvas/test/webgl/conformance/more/glsl/longLoops.html
content/canvas/test/webgl/conformance/more/glsl/uniformOutOfBounds.html
content/canvas/test/webgl/conformance/more/glsl/unusedAttribsUniforms.html
content/canvas/test/webgl/conformance/more/index.html
content/canvas/test/webgl/conformance/more/performance/CPUvsGPU.html
content/canvas/test/webgl/conformance/more/performance/bandwidth.html
content/canvas/test/webgl/conformance/more/performance/jsGCPause.html
content/canvas/test/webgl/conformance/more/performance/jsMatrixMult.html
content/canvas/test/webgl/conformance/more/performance/jsToGLOverhead.html
content/canvas/test/webgl/conformance/more/unit.css
content/canvas/test/webgl/conformance/more/unit.js
content/canvas/test/webgl/conformance/more/util.js
content/canvas/test/webgl/conformance/programs/00_test_list.txt
content/canvas/test/webgl/conformance/programs/get-active-test.html
content/canvas/test/webgl/conformance/programs/gl-bind-attrib-location-test.html
content/canvas/test/webgl/conformance/programs/gl-get-active-attribute.html
content/canvas/test/webgl/conformance/programs/gl-get-active-uniform.html
content/canvas/test/webgl/conformance/programs/gl-getshadersource.html
content/canvas/test/webgl/conformance/programs/gl-shader-test.html
content/canvas/test/webgl/conformance/programs/invalid-UTF-16.html
content/canvas/test/webgl/conformance/programs/program-test.html
content/canvas/test/webgl/conformance/reading/00_test_list.txt
content/canvas/test/webgl/conformance/reading/read-pixels-pack-alignment.html
content/canvas/test/webgl/conformance/reading/read-pixels-test.html
content/canvas/test/webgl/conformance/renderbuffers/00_test_list.txt
content/canvas/test/webgl/conformance/renderbuffers/framebuffer-object-attachment.html
content/canvas/test/webgl/conformance/renderbuffers/framebuffer-test.html
content/canvas/test/webgl/conformance/renderbuffers/renderbuffer-initialization.html
content/canvas/test/webgl/conformance/rendering/00_test_list.txt
content/canvas/test/webgl/conformance/rendering/draw-arrays-out-of-bounds.html
content/canvas/test/webgl/conformance/rendering/draw-elements-out-of-bounds.html
content/canvas/test/webgl/conformance/rendering/gl-clear.html
content/canvas/test/webgl/conformance/rendering/gl-drawelements.html
content/canvas/test/webgl/conformance/rendering/gl-scissor-test.html
content/canvas/test/webgl/conformance/rendering/line-loop-tri-fan.html
content/canvas/test/webgl/conformance/rendering/more-than-65536-indices.html
content/canvas/test/webgl/conformance/rendering/point-size.html
content/canvas/test/webgl/conformance/rendering/triangle.html
content/canvas/test/webgl/conformance/resources/3x3.png
content/canvas/test/webgl/conformance/resources/blue-1x1.jpg
content/canvas/test/webgl/conformance/resources/boolUniformShader.vert
content/canvas/test/webgl/conformance/resources/bug-32888-texture.png
content/canvas/test/webgl/conformance/resources/floatUniformShader.vert
content/canvas/test/webgl/conformance/resources/fragmentShader.frag
content/canvas/test/webgl/conformance/resources/glsl-conformance-test.js
content/canvas/test/webgl/conformance/resources/glsl-feature-tests.css
content/canvas/test/webgl/conformance/resources/glsl-generator.js
content/canvas/test/webgl/conformance/resources/gray-ramp-256-with-128-alpha.png
content/canvas/test/webgl/conformance/resources/gray-ramp-256.png
content/canvas/test/webgl/conformance/resources/gray-ramp-default-gamma.png
content/canvas/test/webgl/conformance/resources/gray-ramp-gamma0.1.png
content/canvas/test/webgl/conformance/resources/gray-ramp-gamma1.0.png
content/canvas/test/webgl/conformance/resources/gray-ramp-gamma2.0.png
content/canvas/test/webgl/conformance/resources/gray-ramp-gamma4.0.png
content/canvas/test/webgl/conformance/resources/gray-ramp-gamma9.0.png
content/canvas/test/webgl/conformance/resources/gray-ramp.png
content/canvas/test/webgl/conformance/resources/green-2x2-16bit.png
content/canvas/test/webgl/conformance/resources/intArrayUniformShader.vert
content/canvas/test/webgl/conformance/resources/intUniformShader.vert
content/canvas/test/webgl/conformance/resources/matUniformShader.vert
content/canvas/test/webgl/conformance/resources/noopUniformShader.frag
content/canvas/test/webgl/conformance/resources/noopUniformShader.vert
content/canvas/test/webgl/conformance/resources/npot-video.mp4
content/canvas/test/webgl/conformance/resources/npot-video.theora.ogv
content/canvas/test/webgl/conformance/resources/npot-video.webmvp8.webm
content/canvas/test/webgl/conformance/resources/pnglib.js
content/canvas/test/webgl/conformance/resources/red-green.mp4
content/canvas/test/webgl/conformance/resources/red-green.png
content/canvas/test/webgl/conformance/resources/red-green.theora.ogv
content/canvas/test/webgl/conformance/resources/red-green.webmvp8.webm
content/canvas/test/webgl/conformance/resources/red-indexed.png
content/canvas/test/webgl/conformance/resources/samplerUniformShader.frag
content/canvas/test/webgl/conformance/resources/small-square-with-cie-rgb-profile.png
content/canvas/test/webgl/conformance/resources/small-square-with-colormatch-profile.png
content/canvas/test/webgl/conformance/resources/small-square-with-colorspin-profile.jpg
content/canvas/test/webgl/conformance/resources/small-square-with-colorspin-profile.png
content/canvas/test/webgl/conformance/resources/small-square-with-e-srgb-profile.png
content/canvas/test/webgl/conformance/resources/small-square-with-smpte-c-profile.png
content/canvas/test/webgl/conformance/resources/small-square-with-srgb-iec61966-2.1-profile.png
content/canvas/test/webgl/conformance/resources/structUniformShader.vert
content/canvas/test/webgl/conformance/resources/vertexShader.vert
content/canvas/test/webgl/conformance/resources/webgl-test-utils.js
content/canvas/test/webgl/conformance/resources/webgl-test.js
content/canvas/test/webgl/conformance/resources/zero-alpha.png
content/canvas/test/webgl/conformance/state/00_test_list.txt
content/canvas/test/webgl/conformance/state/gl-enable-enum-test.html
content/canvas/test/webgl/conformance/state/gl-enum-tests.html
content/canvas/test/webgl/conformance/state/gl-get-calls.html
content/canvas/test/webgl/conformance/state/gl-geterror.html
content/canvas/test/webgl/conformance/state/gl-getstring.html
content/canvas/test/webgl/conformance/state/gl-object-get-calls.html
content/canvas/test/webgl/conformance/textures/00_test_list.txt
content/canvas/test/webgl/conformance/textures/compressed-tex-image.html
content/canvas/test/webgl/conformance/textures/copy-tex-image-and-sub-image-2d.html
content/canvas/test/webgl/conformance/textures/gl-pixelstorei.html
content/canvas/test/webgl/conformance/textures/gl-teximage.html
content/canvas/test/webgl/conformance/textures/origin-clean-conformance.html
content/canvas/test/webgl/conformance/textures/tex-image-and-sub-image-2d-with-array-buffer-view.html
content/canvas/test/webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas.html
content/canvas/test/webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-data.html
content/canvas/test/webgl/conformance/textures/tex-image-and-sub-image-2d-with-image.html
content/canvas/test/webgl/conformance/textures/tex-image-and-sub-image-2d-with-video.html
content/canvas/test/webgl/conformance/textures/tex-image-and-uniform-binding-bugs.html
content/canvas/test/webgl/conformance/textures/tex-image-with-format-and-type.html
content/canvas/test/webgl/conformance/textures/tex-image-with-invalid-data.html
content/canvas/test/webgl/conformance/textures/tex-input-validation.html
content/canvas/test/webgl/conformance/textures/tex-sub-image-2d-bad-args.html
content/canvas/test/webgl/conformance/textures/tex-sub-image-2d.html
content/canvas/test/webgl/conformance/textures/texparameter-test.html
content/canvas/test/webgl/conformance/textures/texture-active-bind-2.html
content/canvas/test/webgl/conformance/textures/texture-active-bind.html
content/canvas/test/webgl/conformance/textures/texture-clear.html
content/canvas/test/webgl/conformance/textures/texture-complete.html
content/canvas/test/webgl/conformance/textures/texture-formats-test.html
content/canvas/test/webgl/conformance/textures/texture-mips.html
content/canvas/test/webgl/conformance/textures/texture-npot-video.html
content/canvas/test/webgl/conformance/textures/texture-npot.html
content/canvas/test/webgl/conformance/textures/texture-size-cube-maps.html
content/canvas/test/webgl/conformance/textures/texture-size.html
content/canvas/test/webgl/conformance/textures/texture-transparent-pixels-initialized.html
content/canvas/test/webgl/conformance/typedarrays/00_test_list.txt
content/canvas/test/webgl/conformance/typedarrays/array-buffer-crash.html
content/canvas/test/webgl/conformance/typedarrays/array-buffer-view-crash.html
content/canvas/test/webgl/conformance/typedarrays/array-unit-tests.html
content/canvas/test/webgl/conformance/uniforms/00_test_list.txt
content/canvas/test/webgl/conformance/uniforms/gl-uniform-arrays.html
content/canvas/test/webgl/conformance/uniforms/gl-uniform-bool.html
content/canvas/test/webgl/conformance/uniforms/gl-uniformmatrix4fv.html
content/canvas/test/webgl/conformance/uniforms/gl-unknown-uniform.html
content/canvas/test/webgl/conformance/uniforms/null-uniform-location.html
content/canvas/test/webgl/conformance/uniforms/uniform-location.html
content/canvas/test/webgl/conformance/uniforms/uniform-samplers-test.html
content/canvas/test/webgl/dont-load-image-from-internet.patch
content/canvas/test/webgl/ext-texture-filter-anisotropic.patch
content/canvas/test/webgl/extra/50x50pixel-black-with-red-triangle.png
content/canvas/test/webgl/extra/big-fbos-example.html
content/canvas/test/webgl/extra/canvas-compositing-test.html
content/canvas/test/webgl/extra/canvas-compositing-test.png
content/canvas/test/webgl/extra/fbo-lost-context.html
content/canvas/test/webgl/extra/lots-of-polys-example.html
content/canvas/test/webgl/extra/offscreen-issue.html
content/canvas/test/webgl/extra/out-of-bounds-uniform-array-access.html
content/canvas/test/webgl/extra/out-of-memory.html
content/canvas/test/webgl/extra/out-of-resources.html
content/canvas/test/webgl/extra/out-of-vram.html
content/canvas/test/webgl/extra/simulated-attrib-0-bug-test.html
content/canvas/test/webgl/extra/slow-shader-example.html
content/canvas/test/webgl/extra/webgl-info.html
content/canvas/test/webgl/failing_tests_android.txt
content/canvas/test/webgl/failing_tests_android_nvidia.txt
content/canvas/test/webgl/failing_tests_android_x86.txt
content/canvas/test/webgl/failing_tests_linux.txt
content/canvas/test/webgl/failing_tests_linux_mesa.txt
content/canvas/test/webgl/failing_tests_linux_nvidia.txt
content/canvas/test/webgl/failing_tests_mac.txt
content/canvas/test/webgl/failing_tests_mac_mtnlion.txt
content/canvas/test/webgl/failing_tests_windows.txt
content/canvas/test/webgl/fix-webgl-harness-async.patch
content/canvas/test/webgl/gc.patch
content/canvas/test/webgl/log-more-info-about-test-failures.patch
content/canvas/test/webgl/misc/program-test-1.html
content/canvas/test/webgl/mochitest-conformance-files.ini
content/canvas/test/webgl/mochitest.ini
content/canvas/test/webgl/moz.build
content/canvas/test/webgl/non-conf-tests/driver-info.js
content/canvas/test/webgl/non-conf-tests/mochi-to-testcase.py
content/canvas/test/webgl/non-conf-tests/mochitest.ini
content/canvas/test/webgl/non-conf-tests/test_depth_readpixels.html
content/canvas/test/webgl/non-conf-tests/test_fb_param.html
content/canvas/test/webgl/non-conf-tests/test_fb_param_crash.html
content/canvas/test/webgl/non-conf-tests/test_highp_fs.html
content/canvas/test/webgl/non-conf-tests/test_no_arr_points.html
content/canvas/test/webgl/non-conf-tests/test_privileged_exts.html
content/canvas/test/webgl/non-conf-tests/test_webgl2_not_exposed.html
content/canvas/test/webgl/non-conf-tests/test_webgl_available.html
content/canvas/test/webgl/non-conf-tests/test_webgl_conformance.html
content/canvas/test/webgl/non-conf-tests/test_webgl_request_context.html
content/canvas/test/webgl/non-conf-tests/test_webgl_request_mismatch.html
content/canvas/test/webgl/non-conf-tests/webgl-util.js
content/canvas/test/webgl/reference-cycle-test.patch
content/canvas/test/webgl/resources/desktop-gl-constants.js
content/canvas/test/webgl/resources/js-test-pre.js
content/canvas/test/webgl/resources/js-test-style.css
content/canvas/test/webgl/resources/opengl_logo.jpg
content/canvas/test/webgl/resources/thunderbird-logo-64x64.png
content/canvas/test/webgl/resources/webgl-logo.png
content/canvas/test/webgl/resources/webgl-test-harness.js
content/canvas/test/webgl/skipped_tests_android.txt
content/canvas/test/webgl/skipped_tests_android_x86.txt
content/canvas/test/webgl/skipped_tests_linux.txt
content/canvas/test/webgl/skipped_tests_linux_mesa.txt
content/canvas/test/webgl/skipped_tests_win_vista.txt
content/canvas/test/webgl/skipped_tests_winxp.txt
content/canvas/test/webgl/test_webgl_conformance_test_suite.html
content/canvas/test/webgl/webgl-conformance-tests.html
content/canvas/test/webgl/writemanifest.py
--- a/.hgtags
+++ b/.hgtags
@@ -92,17 +92,11 @@ cf8750abee06cde395c659f8ecd8ae019d7512e3
 5bb309998e7050c9ee80b0147de1e473f008e221 FIREFOX_AURORA_20_BASE
 cc37417e2c284aed960f98ffa479de4ccdd5c7c3 FIREFOX_AURORA_21_BASE
 1c070ab0f9db59f13423b9c1db60419f7a9098f9 FIREFOX_AURORA_22_BASE
 d7ce9089999719d5186595d160f25123a4e63e39 FIREFOX_AURORA_23_BASE
 8d3810543edccf4fbe458178b88dd4a6e420b010 FIREFOX_AURORA_24_BASE
 ad0ae007aa9e03cd74e9005cd6652e544139b3b5 FIREFOX_AURORA_25_BASE
 2520866d58740851d862c7c59246a4e3f8b4a176 FIREFOX_AURORA_26_BASE
 05025f4889a0bf4dc99ce0c244c750adc002f015 FIREFOX_AURORA_27_BASE
-ba2cc1eda988a1614d8986ae145d28e1268409b9 FIREFOX_AURORA_29_BASE-m
-ba2cc1eda988a1614d8986ae145d28e1268409b9 Tagging for mozilla-central version bumps CLOSED TREE DONTBUILD
-ba2cc1eda988a1614d8986ae145d28e1268409b9 Tagging for mozilla-central version bumps CLOSED TREE DONTBUILD
-0000000000000000000000000000000000000000 Tagging for mozilla-central version bumps CLOSED TREE DONTBUILD
-ba2cc1eda988a1614d8986ae145d28e1268409b9 FIREFOX_AURORA_29_BASE-m
-0000000000000000000000000000000000000000 FIREFOX_AURORA_29_BASE-m
+9f12a9fab080f2d363d7424e25b9ffe85ebc3414 FIREFOX_AURORA_28_BASE
 ba2cc1eda988a1614d8986ae145d28e1268409b9 FIREFOX_AURORA_29_BASE
-9f12a9fab080f2d363d7424e25b9ffe85ebc3414 FIREFOX_AURORA_28_BASE
 83c9853e136451474dfa6d1aaa60a7fca7d2d83a FIREFOX_AURORA_30_BASE
--- a/CLOBBER
+++ b/CLOBBER
@@ -17,9 +17,10 @@
 #
 # Modifying this file will now automatically clobber the buildbot machines \o/
 #
 
 # Are you updating CLOBBER because you think it's needed for your WebIDL
 # changes to stick? As of bug 928195, this shouldn't be necessary! Please
 # don't change CLOBBER for WebIDL changes any more.
 
-Bug 983185 requires a clobber. This may not affect all platforms.
+Bug 979480 changed some #defined slot numbers used in self hosted code and
+the selfhosted.js file isn't being regenerated properly
--- a/content/base/src/nsXMLHttpRequest.cpp
+++ b/content/base/src/nsXMLHttpRequest.cpp
@@ -3812,45 +3812,46 @@ nsXMLHttpRequestXPCOMifier::GetInterface
   }
 
   return mXHR->GetInterface(aIID, aResult);
 }
 
 namespace mozilla {
 
 ArrayBufferBuilder::ArrayBufferBuilder()
-  : mRawContents(nullptr),
-    mDataPtr(nullptr),
+  : mDataPtr(nullptr),
     mCapacity(0),
     mLength(0)
 {
 }
 
 ArrayBufferBuilder::~ArrayBufferBuilder()
 {
   reset();
 }
 
 void
 ArrayBufferBuilder::reset()
 {
-  if (mRawContents) {
-    JS_free(nullptr, mRawContents);
+  if (mDataPtr) {
+    JS_free(nullptr, mDataPtr);
   }
-  mRawContents = mDataPtr = nullptr;
+  mDataPtr = nullptr;
   mCapacity = mLength = 0;
 }
 
 bool
 ArrayBufferBuilder::setCapacity(uint32_t aNewCap)
 {
-  if (!JS_ReallocateArrayBufferContents(nullptr, aNewCap, &mRawContents, &mDataPtr)) {
+  uint8_t *newdata = (uint8_t *) JS_ReallocateArrayBufferContents(nullptr, aNewCap, mDataPtr, mCapacity);
+  if (!newdata) {
     return false;
   }
 
+  mDataPtr = newdata;
   mCapacity = aNewCap;
   if (mLength > aNewCap) {
     mLength = aNewCap;
   }
 
   return true;
 }
 
@@ -3898,22 +3899,22 @@ ArrayBufferBuilder::getArrayBuffer(JSCon
   // we need to check for mLength == 0, because nothing may have been
   // added
   if (mCapacity > mLength || mLength == 0) {
     if (!setCapacity(mLength)) {
       return nullptr;
     }
   }
 
-  JSObject* obj = JS_NewArrayBufferWithContents(aCx, mRawContents);
+  JSObject* obj = JS_NewArrayBufferWithContents(aCx, mLength, mDataPtr);
   if (!obj) {
     return nullptr;
   }
 
-  mRawContents = mDataPtr = nullptr;
+  mDataPtr = nullptr;
   mLength = mCapacity = 0;
 
   return obj;
 }
 
 /* static */ bool
 ArrayBufferBuilder::areOverlappingRegions(const uint8_t* aStart1,
                                           uint32_t aLength1,
--- a/content/base/src/nsXMLHttpRequest.h
+++ b/content/base/src/nsXMLHttpRequest.h
@@ -57,17 +57,16 @@ namespace mozilla {
 // based reallocation, up to an optional maximum growth given.
 //
 // When all the data has been appended, call getArrayBuffer,
 // passing in the JSContext* for which the ArrayBuffer object
 // is to be created.  This also implicitly resets the builder,
 // or it can be reset explicitly at any point by calling reset().
 class ArrayBufferBuilder
 {
-  void* mRawContents;
   uint8_t* mDataPtr;
   uint32_t mCapacity;
   uint32_t mLength;
 public:
   ArrayBufferBuilder();
   ~ArrayBufferBuilder();
 
   void reset();
--- a/content/canvas/src/DocumentRendererChild.cpp
+++ b/content/canvas/src/DocumentRendererChild.cpp
@@ -42,17 +42,17 @@ DocumentRendererChild::RenderDocument(ns
                                       uint32_t renderFlags,
                                       bool flushLayout,
                                       const nsIntSize& renderSize,
                                       nsCString& data)
 {
     if (flushLayout)
         nsContentUtils::FlushLayoutForTree(window);
 
-    nsCOMPtr<nsPresContext> presContext;
+    nsRefPtr<nsPresContext> presContext;
     nsCOMPtr<nsPIDOMWindow> win = do_QueryInterface(window);
     if (win) {
         nsIDocShell* docshell = win->GetDocShell();
         if (docshell) {
             docshell->GetPresContext(getter_AddRefs(presContext));
         }
     }
     if (!presContext)
--- a/content/canvas/test/moz.build
+++ b/content/canvas/test/moz.build
@@ -1,14 +1,17 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-DIRS += ['webgl']
+DIRS += [
+    'webgl-conformance',
+    'webgl-mochitest',
+]
 
 MOCHITEST_MANIFESTS += [
     'crossorigin/mochitest.ini',
     'mochitest.ini',
-    ]
+]
 
 MOCHITEST_CHROME_MANIFESTS += ['chrome/chrome.ini']
rename from content/canvas/test/webgl/00_test_list.txt
rename to content/canvas/test/webgl-conformance/00_test_list.txt
rename from content/canvas/test/webgl/README.mozilla
rename to content/canvas/test/webgl-conformance/README.mozilla
rename from content/canvas/test/webgl/README.txt
rename to content/canvas/test/webgl-conformance/README.txt
rename from content/canvas/test/webgl/conformance/00_readme.txt
rename to content/canvas/test/webgl-conformance/conformance/00_readme.txt
new file mode 100644
--- /dev/null
+++ b/content/canvas/test/webgl-conformance/conformance/00_test_list.txt
@@ -0,0 +1,17 @@
+attribs/00_test_list.txt
+buffers/00_test_list.txt
+canvas/00_test_list.txt
+context/00_test_list.txt
+extensions/00_test_list.txt
+glsl/00_test_list.txt
+limits/00_test_list.txt
+misc/00_test_list.txt
+programs/00_test_list.txt
+reading/00_test_list.txt
+renderbuffers/00_test_list.txt
+rendering/00_test_list.txt
+state/00_test_list.txt
+textures/00_test_list.txt
+typedarrays/00_test_list.txt
+uniforms/00_test_list.txt
+
rename from content/canvas/test/webgl/conformance/LICENSE_CHROMIUM
rename to content/canvas/test/webgl-conformance/conformance/LICENSE_CHROMIUM
rename from content/canvas/test/webgl/conformance/attribs/00_test_list.txt
rename to content/canvas/test/webgl-conformance/conformance/attribs/00_test_list.txt
rename from content/canvas/test/webgl/conformance/attribs/gl-enable-vertex-attrib.html
rename to content/canvas/test/webgl-conformance/conformance/attribs/gl-enable-vertex-attrib.html
rename from content/canvas/test/webgl/conformance/attribs/gl-vertex-attrib-zero-issues.html
rename to content/canvas/test/webgl-conformance/conformance/attribs/gl-vertex-attrib-zero-issues.html
rename from content/canvas/test/webgl/conformance/attribs/gl-vertex-attrib.html
rename to content/canvas/test/webgl-conformance/conformance/attribs/gl-vertex-attrib.html
rename from content/canvas/test/webgl/conformance/attribs/gl-vertexattribpointer-offsets.html
rename to content/canvas/test/webgl-conformance/conformance/attribs/gl-vertexattribpointer-offsets.html
rename from content/canvas/test/webgl/conformance/attribs/gl-vertexattribpointer.html
rename to content/canvas/test/webgl-conformance/conformance/attribs/gl-vertexattribpointer.html
rename from content/canvas/test/webgl/conformance/buffers/00_test_list.txt
rename to content/canvas/test/webgl-conformance/conformance/buffers/00_test_list.txt
rename from content/canvas/test/webgl/conformance/buffers/buffer-bind-test.html
rename to content/canvas/test/webgl-conformance/conformance/buffers/buffer-bind-test.html
rename from content/canvas/test/webgl/conformance/buffers/buffer-data-array-buffer.html
rename to content/canvas/test/webgl-conformance/conformance/buffers/buffer-data-array-buffer.html
rename from content/canvas/test/webgl/conformance/buffers/index-validation-copies-indices.html
rename to content/canvas/test/webgl-conformance/conformance/buffers/index-validation-copies-indices.html
rename from content/canvas/test/webgl/conformance/buffers/index-validation-crash-with-buffer-sub-data.html
rename to content/canvas/test/webgl-conformance/conformance/buffers/index-validation-crash-with-buffer-sub-data.html
rename from content/canvas/test/webgl/conformance/buffers/index-validation-verifies-too-many-indices.html
rename to content/canvas/test/webgl-conformance/conformance/buffers/index-validation-verifies-too-many-indices.html
rename from content/canvas/test/webgl/conformance/buffers/index-validation-with-resized-buffer.html
rename to content/canvas/test/webgl-conformance/conformance/buffers/index-validation-with-resized-buffer.html
rename from content/canvas/test/webgl/conformance/buffers/index-validation.html
rename to content/canvas/test/webgl-conformance/conformance/buffers/index-validation.html
rename from content/canvas/test/webgl/conformance/canvas/00_test_list.txt
rename to content/canvas/test/webgl-conformance/conformance/canvas/00_test_list.txt
rename from content/canvas/test/webgl/conformance/canvas/buffer-offscreen-test.html
rename to content/canvas/test/webgl-conformance/conformance/canvas/buffer-offscreen-test.html
rename from content/canvas/test/webgl/conformance/canvas/buffer-preserve-test.html
rename to content/canvas/test/webgl-conformance/conformance/canvas/buffer-preserve-test.html
rename from content/canvas/test/webgl/conformance/canvas/canvas-test.html
rename to content/canvas/test/webgl-conformance/conformance/canvas/canvas-test.html
rename from content/canvas/test/webgl/conformance/canvas/canvas-zero-size.html
rename to content/canvas/test/webgl-conformance/conformance/canvas/canvas-zero-size.html
rename from content/canvas/test/webgl/conformance/canvas/drawingbuffer-static-canvas-test.html
rename to content/canvas/test/webgl-conformance/conformance/canvas/drawingbuffer-static-canvas-test.html
rename from content/canvas/test/webgl/conformance/canvas/drawingbuffer-test.html
rename to content/canvas/test/webgl-conformance/conformance/canvas/drawingbuffer-test.html
rename from content/canvas/test/webgl/conformance/canvas/viewport-unchanged-upon-resize.html
rename to content/canvas/test/webgl-conformance/conformance/canvas/viewport-unchanged-upon-resize.html
rename from content/canvas/test/webgl/conformance/context/00_test_list.txt
rename to content/canvas/test/webgl-conformance/conformance/context/00_test_list.txt
rename from content/canvas/test/webgl/conformance/context/constants.html
rename to content/canvas/test/webgl-conformance/conformance/context/constants.html
rename from content/canvas/test/webgl/conformance/context/context-attribute-preserve-drawing-buffer.html
rename to content/canvas/test/webgl-conformance/conformance/context/context-attribute-preserve-drawing-buffer.html
rename from content/canvas/test/webgl/conformance/context/context-attributes-alpha-depth-stencil-antialias.html
rename to content/canvas/test/webgl-conformance/conformance/context/context-attributes-alpha-depth-stencil-antialias.html
rename from content/canvas/test/webgl/conformance/context/context-lost-restored.html
rename to content/canvas/test/webgl-conformance/conformance/context/context-lost-restored.html
rename from content/canvas/test/webgl/conformance/context/context-lost.html
rename to content/canvas/test/webgl-conformance/conformance/context/context-lost.html
rename from content/canvas/test/webgl/conformance/context/context-type-test.html
rename to content/canvas/test/webgl-conformance/conformance/context/context-type-test.html
rename from content/canvas/test/webgl/conformance/context/incorrect-context-object-behaviour.html
rename to content/canvas/test/webgl-conformance/conformance/context/incorrect-context-object-behaviour.html
rename from content/canvas/test/webgl/conformance/context/methods.html
rename to content/canvas/test/webgl-conformance/conformance/context/methods.html
rename from content/canvas/test/webgl/conformance/context/premultiplyalpha-test.html
rename to content/canvas/test/webgl-conformance/conformance/context/premultiplyalpha-test.html
rename from content/canvas/test/webgl/conformance/context/resource-sharing-test.html
rename to content/canvas/test/webgl-conformance/conformance/context/resource-sharing-test.html
rename from content/canvas/test/webgl/conformance/extensions/00_test_list.txt
rename to content/canvas/test/webgl-conformance/conformance/extensions/00_test_list.txt
rename from content/canvas/test/webgl/conformance/extensions/ext-sRGB.html
rename to content/canvas/test/webgl-conformance/conformance/extensions/ext-sRGB.html
rename from content/canvas/test/webgl/conformance/extensions/ext-texture-filter-anisotropic.html
rename to content/canvas/test/webgl-conformance/conformance/extensions/ext-texture-filter-anisotropic.html
rename from content/canvas/test/webgl/conformance/extensions/oes-standard-derivatives.html
rename to content/canvas/test/webgl-conformance/conformance/extensions/oes-standard-derivatives.html
rename from content/canvas/test/webgl/conformance/extensions/oes-texture-float.html
rename to content/canvas/test/webgl-conformance/conformance/extensions/oes-texture-float.html
rename from content/canvas/test/webgl/conformance/extensions/oes-vertex-array-object.html
rename to content/canvas/test/webgl-conformance/conformance/extensions/oes-vertex-array-object.html
rename from content/canvas/test/webgl/conformance/extensions/webgl-compressed-texture-etc1.html
rename to content/canvas/test/webgl-conformance/conformance/extensions/webgl-compressed-texture-etc1.html
rename from content/canvas/test/webgl/conformance/extensions/webgl-compressed-texture-s3tc.html
rename to content/canvas/test/webgl-conformance/conformance/extensions/webgl-compressed-texture-s3tc.html
rename from content/canvas/test/webgl/conformance/extensions/webgl-debug-renderer-info.html
rename to content/canvas/test/webgl-conformance/conformance/extensions/webgl-debug-renderer-info.html
rename from content/canvas/test/webgl/conformance/extensions/webgl-debug-shaders.html
rename to content/canvas/test/webgl-conformance/conformance/extensions/webgl-debug-shaders.html
rename from content/canvas/test/webgl/conformance/extensions/webgl-depth-texture.html
rename to content/canvas/test/webgl-conformance/conformance/extensions/webgl-depth-texture.html
rename from content/canvas/test/webgl/conformance/glsl/00_test_list.txt
rename to content/canvas/test/webgl-conformance/conformance/glsl/00_test_list.txt
rename from content/canvas/test/webgl/conformance/glsl/functions/00_test_list.txt
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/00_test_list.txt
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-abs.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-abs.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-acos.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-acos.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-asin.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-asin.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-atan-xy.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-atan-xy.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-atan.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-atan.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-ceil.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-ceil.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-clamp-float.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-clamp-float.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-clamp-gentype.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-clamp-gentype.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-cos.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-cos.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-cross.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-cross.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-distance.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-distance.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-dot.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-dot.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-faceforward.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-faceforward.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-floor.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-floor.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-fract.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-fract.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-length.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-length.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-lessThan.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-lessThan.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-max-float.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-max-float.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-max-gentype.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-max-gentype.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-min-float.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-min-float.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-min-gentype.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-min-gentype.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-mix-float.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-mix-float.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-mix-gentype.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-mix-gentype.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-mod-float.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-mod-float.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-mod-gentype.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-mod-gentype.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-normalize.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-normalize.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-reflect.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-reflect.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-refract.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-refract.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-sign.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-sign.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-sin.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-sin.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-smoothstep-float.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-smoothstep-float.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-smoothstep-gentype.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-smoothstep-gentype.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-step-float.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-step-float.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function-step-gentype.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-step-gentype.html
rename from content/canvas/test/webgl/conformance/glsl/functions/glsl-function.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/00_test_list.txt
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/00_test_list.txt
rename from content/canvas/test/webgl/conformance/glsl/implicit/add_int_float.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/add_int_float.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/add_int_mat2.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/add_int_mat2.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/add_int_mat3.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/add_int_mat3.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/add_int_mat4.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/add_int_mat4.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/add_int_vec2.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/add_int_vec2.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/add_int_vec3.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/add_int_vec3.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/add_int_vec4.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/add_int_vec4.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/add_ivec2_vec2.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/add_ivec2_vec2.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/add_ivec3_vec3.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/add_ivec3_vec3.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/add_ivec4_vec4.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/add_ivec4_vec4.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/assign_int_to_float.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/assign_int_to_float.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/assign_ivec2_to_vec2.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/assign_ivec2_to_vec2.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/assign_ivec3_to_vec3.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/assign_ivec3_to_vec3.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/assign_ivec4_to_vec4.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/assign_ivec4_to_vec4.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/construct_struct.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/construct_struct.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/divide_int_float.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/divide_int_float.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/divide_int_mat2.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/divide_int_mat2.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/divide_int_mat3.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/divide_int_mat3.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/divide_int_mat4.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/divide_int_mat4.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/divide_int_vec2.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/divide_int_vec2.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/divide_int_vec3.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/divide_int_vec3.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/divide_int_vec4.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/divide_int_vec4.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/divide_ivec2_vec2.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/divide_ivec2_vec2.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/divide_ivec3_vec3.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/divide_ivec3_vec3.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/divide_ivec4_vec4.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/divide_ivec4_vec4.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/equal_int_float.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/equal_int_float.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/equal_ivec2_vec2.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/equal_ivec2_vec2.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/equal_ivec3_vec3.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/equal_ivec3_vec3.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/equal_ivec4_vec4.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/equal_ivec4_vec4.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/function_int_float.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/function_int_float.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/function_ivec2_vec2.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/function_ivec2_vec2.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/function_ivec3_vec3.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/function_ivec3_vec3.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/function_ivec4_vec4.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/function_ivec4_vec4.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/greater_than.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/greater_than.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/greater_than_equal.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/greater_than_equal.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/less_than.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/less_than.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/less_than_equal.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/less_than_equal.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/multiply_int_float.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/multiply_int_float.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/multiply_int_mat2.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/multiply_int_mat2.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/multiply_int_mat3.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/multiply_int_mat3.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/multiply_int_mat4.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/multiply_int_mat4.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/multiply_int_vec2.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/multiply_int_vec2.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/multiply_int_vec3.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/multiply_int_vec3.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/multiply_int_vec4.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/multiply_int_vec4.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/multiply_ivec2_vec2.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/multiply_ivec2_vec2.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/multiply_ivec3_vec3.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/multiply_ivec3_vec3.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/multiply_ivec4_vec4.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/multiply_ivec4_vec4.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/not_equal_int_float.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/not_equal_int_float.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/not_equal_ivec2_vec2.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/not_equal_ivec2_vec2.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/not_equal_ivec3_vec3.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/not_equal_ivec3_vec3.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/not_equal_ivec4_vec4.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/not_equal_ivec4_vec4.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/subtract_int_float.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/subtract_int_float.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/subtract_int_mat2.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/subtract_int_mat2.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/subtract_int_mat3.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/subtract_int_mat3.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/subtract_int_mat4.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/subtract_int_mat4.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/subtract_int_vec2.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/subtract_int_vec2.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/subtract_int_vec3.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/subtract_int_vec3.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/subtract_int_vec4.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/subtract_int_vec4.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/subtract_ivec2_vec2.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/subtract_ivec2_vec2.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/subtract_ivec3_vec3.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/subtract_ivec3_vec3.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/subtract_ivec4_vec4.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/subtract_ivec4_vec4.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/ternary_int_float.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/ternary_int_float.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/ternary_ivec2_vec2.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/ternary_ivec2_vec2.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/ternary_ivec3_vec3.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/ternary_ivec3_vec3.vert.html
rename from content/canvas/test/webgl/conformance/glsl/implicit/ternary_ivec4_vec4.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/implicit/ternary_ivec4_vec4.vert.html
rename from content/canvas/test/webgl/conformance/glsl/matrices/00_test_list.txt
rename to content/canvas/test/webgl-conformance/conformance/glsl/matrices/00_test_list.txt
rename from content/canvas/test/webgl/conformance/glsl/matrices/glsl-mat4-to-mat3.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/matrices/glsl-mat4-to-mat3.html
rename from content/canvas/test/webgl/conformance/glsl/misc/00_test_list.txt
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/00_test_list.txt
rename from content/canvas/test/webgl/conformance/glsl/misc/attrib-location-length-limits.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/attrib-location-length-limits.html
rename from content/canvas/test/webgl/conformance/glsl/misc/embedded-struct-definitions-forbidden.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/embedded-struct-definitions-forbidden.html
rename from content/canvas/test/webgl/conformance/glsl/misc/glsl-2types-of-textures-on-same-unit.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/glsl-2types-of-textures-on-same-unit.html
rename from content/canvas/test/webgl/conformance/glsl/misc/glsl-function-nodes.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/glsl-function-nodes.html
rename from content/canvas/test/webgl/conformance/glsl/misc/glsl-long-variable-names.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/glsl-long-variable-names.html
rename from content/canvas/test/webgl/conformance/glsl/misc/glsl-vertex-branch.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/glsl-vertex-branch.html
rename from content/canvas/test/webgl/conformance/glsl/misc/include.vs
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/include.vs
rename from content/canvas/test/webgl/conformance/glsl/misc/non-ascii-comments.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/non-ascii-comments.vert.html
rename from content/canvas/test/webgl/conformance/glsl/misc/non-ascii.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/non-ascii.vert.html
rename from content/canvas/test/webgl/conformance/glsl/misc/re-compile-re-link.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/re-compile-re-link.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-256-character-identifier.frag.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-256-character-identifier.frag.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-257-character-identifier.frag.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-257-character-identifier.frag.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-_webgl-identifier.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-_webgl-identifier.vert.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-arbitrary-indexing.frag.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-arbitrary-indexing.frag.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-arbitrary-indexing.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-arbitrary-indexing.vert.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-attrib-array.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-attrib-array.vert.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-attrib-struct.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-attrib-struct.vert.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-clipvertex.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-clipvertex.vert.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-comma-assignment.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-comma-assignment.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-comma-conditional-assignment.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-comma-conditional-assignment.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-conditional-scoping.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-conditional-scoping.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-default-precision.frag.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-default-precision.frag.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-default-precision.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-default-precision.vert.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-define-line-continuation.frag.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-define-line-continuation.frag.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-dfdx-no-ext.frag.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-dfdx-no-ext.frag.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-dfdx.frag.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-dfdx.frag.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-do-scoping.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-do-scoping.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-error-directive.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-error-directive.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-explicit-int-cast.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-explicit-int-cast.vert.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-float-return-value.frag.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-float-return-value.frag.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-for-loop.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-for-loop.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-for-scoping.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-for-scoping.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-frag-depth.frag.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-frag-depth.frag.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-function-recursion.frag.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-function-recursion.frag.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-function-scoped-struct.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-function-scoped-struct.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-functional-scoping.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-functional-scoping.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-glcolor.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-glcolor.vert.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-gles-1.frag.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-gles-1.frag.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-gles-symbol.frag.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-gles-symbol.frag.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-glprojectionmatrix.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-glprojectionmatrix.vert.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-hex-int-constant-macro.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-hex-int-constant-macro.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-implicit-vec3-to-vec4-cast.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-implicit-vec3-to-vec4-cast.vert.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-include.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-include.vert.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-int-return-value.frag.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-int-return-value.frag.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-invalid-identifier.frag.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-invalid-identifier.frag.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-ivec2-return-value.frag.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-ivec2-return-value.frag.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-ivec3-return-value.frag.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-ivec3-return-value.frag.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-ivec4-return-value.frag.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-ivec4-return-value.frag.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-limited-indexing.frag.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-limited-indexing.frag.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-line-directive.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-line-directive.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-long-line.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-long-line.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-non-ascii-error.frag.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-non-ascii-error.frag.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-precision.frag.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-precision.frag.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-quoted-error.frag.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-quoted-error.frag.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-undefined-preprocessor-symbol.frag.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-undefined-preprocessor-symbol.frag.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-uniform-in-loop-condition.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-uniform-in-loop-condition.vert.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-vec2-return-value.frag.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-vec2-return-value.frag.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-vec3-return-value.frag.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-vec3-return-value.frag.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-vec4-return-value.frag.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-vec4-return-value.frag.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-vec4-vec3-vec4-conditional.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-vec4-vec3-vec4-conditional.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-version-100.frag.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-version-100.frag.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-version-100.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-version-100.vert.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-version-120.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-version-120.vert.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-version-130.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-version-130.vert.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-with-webgl-identifier.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-webgl-identifier.vert.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shader-without-precision.frag.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-without-precision.frag.html
rename from content/canvas/test/webgl/conformance/glsl/misc/shared.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/shared.html
rename from content/canvas/test/webgl/conformance/glsl/misc/struct-nesting-exceeds-maximum.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/struct-nesting-exceeds-maximum.html
rename from content/canvas/test/webgl/conformance/glsl/misc/struct-nesting-under-maximum.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/struct-nesting-under-maximum.html
rename from content/canvas/test/webgl/conformance/glsl/misc/uniform-location-length-limits.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/misc/uniform-location-length-limits.html
rename from content/canvas/test/webgl/conformance/glsl/reserved/00_test_list.txt
rename to content/canvas/test/webgl-conformance/conformance/glsl/reserved/00_test_list.txt
rename from content/canvas/test/webgl/conformance/glsl/reserved/_webgl_field.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/reserved/_webgl_field.vert.html
rename from content/canvas/test/webgl/conformance/glsl/reserved/_webgl_function.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/reserved/_webgl_function.vert.html
rename from content/canvas/test/webgl/conformance/glsl/reserved/_webgl_struct.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/reserved/_webgl_struct.vert.html
rename from content/canvas/test/webgl/conformance/glsl/reserved/_webgl_variable.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/reserved/_webgl_variable.vert.html
rename from content/canvas/test/webgl/conformance/glsl/reserved/webgl_field.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/reserved/webgl_field.vert.html
rename from content/canvas/test/webgl/conformance/glsl/reserved/webgl_function.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/reserved/webgl_function.vert.html
rename from content/canvas/test/webgl/conformance/glsl/reserved/webgl_struct.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/reserved/webgl_struct.vert.html
rename from content/canvas/test/webgl/conformance/glsl/reserved/webgl_variable.vert.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/reserved/webgl_variable.vert.html
rename from content/canvas/test/webgl/conformance/glsl/samplers/00_test_list.txt
rename to content/canvas/test/webgl-conformance/conformance/glsl/samplers/00_test_list.txt
rename from content/canvas/test/webgl/conformance/glsl/samplers/glsl-function-texture2d-bias.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/samplers/glsl-function-texture2d-bias.html
rename from content/canvas/test/webgl/conformance/glsl/samplers/glsl-function-texture2dlod.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/samplers/glsl-function-texture2dlod.html
rename from content/canvas/test/webgl/conformance/glsl/samplers/glsl-function-texture2dproj.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/samplers/glsl-function-texture2dproj.html
rename from content/canvas/test/webgl/conformance/glsl/variables/00_test_list.txt
rename to content/canvas/test/webgl-conformance/conformance/glsl/variables/00_test_list.txt
rename from content/canvas/test/webgl/conformance/glsl/variables/gl-fragcoord.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/variables/gl-fragcoord.html
rename from content/canvas/test/webgl/conformance/glsl/variables/gl-frontfacing.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/variables/gl-frontfacing.html
rename from content/canvas/test/webgl/conformance/glsl/variables/gl-pointcoord.html
rename to content/canvas/test/webgl-conformance/conformance/glsl/variables/gl-pointcoord.html
rename from content/canvas/test/webgl/conformance/limits/00_test_list.txt
rename to content/canvas/test/webgl-conformance/conformance/limits/00_test_list.txt
rename from content/canvas/test/webgl/conformance/limits/gl-max-texture-dimensions.html
rename to content/canvas/test/webgl-conformance/conformance/limits/gl-max-texture-dimensions.html
rename from content/canvas/test/webgl/conformance/limits/gl-min-attribs.html
rename to content/canvas/test/webgl-conformance/conformance/limits/gl-min-attribs.html
rename from content/canvas/test/webgl/conformance/limits/gl-min-textures.html
rename to content/canvas/test/webgl-conformance/conformance/limits/gl-min-textures.html
rename from content/canvas/test/webgl/conformance/limits/gl-min-uniforms.html
rename to content/canvas/test/webgl-conformance/conformance/limits/gl-min-uniforms.html
rename from content/canvas/test/webgl/conformance/misc/00_test_list.txt
rename to content/canvas/test/webgl-conformance/conformance/misc/00_test_list.txt
rename from content/canvas/test/webgl/conformance/misc/bad-arguments-test.html
rename to content/canvas/test/webgl-conformance/conformance/misc/bad-arguments-test.html
rename from content/canvas/test/webgl/conformance/misc/delayed-drawing.html
rename to content/canvas/test/webgl-conformance/conformance/misc/delayed-drawing.html
rename from content/canvas/test/webgl/conformance/misc/error-reporting.html
rename to content/canvas/test/webgl-conformance/conformance/misc/error-reporting.html
rename from content/canvas/test/webgl/conformance/misc/functions-returning-strings.html
rename to content/canvas/test/webgl-conformance/conformance/misc/functions-returning-strings.html
rename from content/canvas/test/webgl/conformance/misc/instanceof-test.html
rename to content/canvas/test/webgl-conformance/conformance/misc/instanceof-test.html
rename from content/canvas/test/webgl/conformance/misc/invalid-passed-params.html
rename to content/canvas/test/webgl-conformance/conformance/misc/invalid-passed-params.html
rename from content/canvas/test/webgl/conformance/misc/is-object.html
rename to content/canvas/test/webgl-conformance/conformance/misc/is-object.html
rename from content/canvas/test/webgl/conformance/misc/null-object-behaviour.html
rename to content/canvas/test/webgl-conformance/conformance/misc/null-object-behaviour.html
rename from content/canvas/test/webgl/conformance/misc/object-deletion-behaviour.html
rename to content/canvas/test/webgl-conformance/conformance/misc/object-deletion-behaviour.html
rename from content/canvas/test/webgl/conformance/misc/shader-precision-format.html
rename to content/canvas/test/webgl-conformance/conformance/misc/shader-precision-format.html
rename from content/canvas/test/webgl/conformance/misc/type-conversion-test.html
rename to content/canvas/test/webgl-conformance/conformance/misc/type-conversion-test.html
rename from content/canvas/test/webgl/conformance/misc/uninitialized-test.html
rename to content/canvas/test/webgl-conformance/conformance/misc/uninitialized-test.html
rename from content/canvas/test/webgl/conformance/misc/webgl-specific.html
rename to content/canvas/test/webgl-conformance/conformance/misc/webgl-specific.html
rename from content/canvas/test/webgl/conformance/more/00_test_list.txt
rename to content/canvas/test/webgl-conformance/conformance/more/00_test_list.txt
rename from content/canvas/test/webgl/conformance/more/README.md
rename to content/canvas/test/webgl-conformance/conformance/more/README.md
rename from content/canvas/test/webgl/conformance/more/all_tests.html
rename to content/canvas/test/webgl-conformance/conformance/more/all_tests.html
rename from content/canvas/test/webgl/conformance/more/all_tests_linkonly.html
rename to content/canvas/test/webgl-conformance/conformance/more/all_tests_linkonly.html
rename from content/canvas/test/webgl/conformance/more/all_tests_sequential.html
rename to content/canvas/test/webgl-conformance/conformance/more/all_tests_sequential.html
rename from content/canvas/test/webgl/conformance/more/conformance/argGenerators-A.js
rename to content/canvas/test/webgl-conformance/conformance/more/conformance/argGenerators-A.js
rename from content/canvas/test/webgl/conformance/more/conformance/argGenerators-B1.js
rename to content/canvas/test/webgl-conformance/conformance/more/conformance/argGenerators-B1.js
rename from content/canvas/test/webgl/conformance/more/conformance/argGenerators-B2.js
rename to content/canvas/test/webgl-conformance/conformance/more/conformance/argGenerators-B2.js
rename from content/canvas/test/webgl/conformance/more/conformance/argGenerators-B3.js
rename to content/canvas/test/webgl-conformance/conformance/more/conformance/argGenerators-B3.js
rename from content/canvas/test/webgl/conformance/more/conformance/argGenerators-B4.js
rename to content/canvas/test/webgl-conformance/conformance/more/conformance/argGenerators-B4.js
rename from content/canvas/test/webgl/conformance/more/conformance/argGenerators-C.js
rename to content/canvas/test/webgl-conformance/conformance/more/conformance/argGenerators-C.js
rename from content/canvas/test/webgl/conformance/more/conformance/argGenerators-D_G.js
rename to content/canvas/test/webgl-conformance/conformance/more/conformance/argGenerators-D_G.js
rename from content/canvas/test/webgl/conformance/more/conformance/argGenerators-G_I.js
rename to content/canvas/test/webgl-conformance/conformance/more/conformance/argGenerators-G_I.js
rename from content/canvas/test/webgl/conformance/more/conformance/argGenerators-L_S.js
rename to content/canvas/test/webgl-conformance/conformance/more/conformance/argGenerators-L_S.js
rename from content/canvas/test/webgl/conformance/more/conformance/argGenerators-S_V.js
rename to content/canvas/test/webgl-conformance/conformance/more/conformance/argGenerators-S_V.js
rename from content/canvas/test/webgl/conformance/more/conformance/badArgsArityLessThanArgc.html
rename to content/canvas/test/webgl-conformance/conformance/more/conformance/badArgsArityLessThanArgc.html
rename from content/canvas/test/webgl/conformance/more/conformance/constants.html
rename to content/canvas/test/webgl-conformance/conformance/more/conformance/constants.html
rename from content/canvas/test/webgl/conformance/more/conformance/fuzzTheAPI.html
rename to content/canvas/test/webgl-conformance/conformance/more/conformance/fuzzTheAPI.html
rename from content/canvas/test/webgl/conformance/more/conformance/getContext.html
rename to content/canvas/test/webgl-conformance/conformance/more/conformance/getContext.html
rename from content/canvas/test/webgl/conformance/more/conformance/methods.html
rename to content/canvas/test/webgl-conformance/conformance/more/conformance/methods.html
rename from content/canvas/test/webgl/conformance/more/conformance/quickCheckAPI-A.html
rename to content/canvas/test/webgl-conformance/conformance/more/conformance/quickCheckAPI-A.html
rename from content/canvas/test/webgl/conformance/more/conformance/quickCheckAPI-B1.html
rename to content/canvas/test/webgl-conformance/conformance/more/conformance/quickCheckAPI-B1.html
rename from content/canvas/test/webgl/conformance/more/conformance/quickCheckAPI-B2.html
rename to content/canvas/test/webgl-conformance/conformance/more/conformance/quickCheckAPI-B2.html
rename from content/canvas/test/webgl/conformance/more/conformance/quickCheckAPI-B3.html
rename to content/canvas/test/webgl-conformance/conformance/more/conformance/quickCheckAPI-B3.html
rename from content/canvas/test/webgl/conformance/more/conformance/quickCheckAPI-B4.html
rename to content/canvas/test/webgl-conformance/conformance/more/conformance/quickCheckAPI-B4.html
rename from content/canvas/test/webgl/conformance/more/conformance/quickCheckAPI-C.html
rename to content/canvas/test/webgl-conformance/conformance/more/conformance/quickCheckAPI-C.html
rename from content/canvas/test/webgl/conformance/more/conformance/quickCheckAPI-D_G.html
rename to content/canvas/test/webgl-conformance/conformance/more/conformance/quickCheckAPI-D_G.html
rename from content/canvas/test/webgl/conformance/more/conformance/quickCheckAPI-G_I.html
rename to content/canvas/test/webgl-conformance/conformance/more/conformance/quickCheckAPI-G_I.html
rename from content/canvas/test/webgl/conformance/more/conformance/quickCheckAPI-L_S.html
rename to content/canvas/test/webgl-conformance/conformance/more/conformance/quickCheckAPI-L_S.html
rename from content/canvas/test/webgl/conformance/more/conformance/quickCheckAPI-S_V.html
rename to content/canvas/test/webgl-conformance/conformance/more/conformance/quickCheckAPI-S_V.html
rename from content/canvas/test/webgl/conformance/more/conformance/quickCheckAPI.js
rename to content/canvas/test/webgl-conformance/conformance/more/conformance/quickCheckAPI.js
rename from content/canvas/test/webgl/conformance/more/conformance/quickCheckAPIBadArgs.html
rename to content/canvas/test/webgl-conformance/conformance/more/conformance/quickCheckAPIBadArgs.html
rename from content/canvas/test/webgl/conformance/more/conformance/webGLArrays.html
rename to content/canvas/test/webgl-conformance/conformance/more/conformance/webGLArrays.html
rename from content/canvas/test/webgl/conformance/more/demos/opengl_web.html
rename to content/canvas/test/webgl-conformance/conformance/more/demos/opengl_web.html
rename from content/canvas/test/webgl/conformance/more/demos/video.html
rename to content/canvas/test/webgl-conformance/conformance/more/demos/video.html
rename from content/canvas/test/webgl/conformance/more/functions/bindBuffer.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/bindBuffer.html
rename from content/canvas/test/webgl/conformance/more/functions/bindBufferBadArgs.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/bindBufferBadArgs.html
rename from content/canvas/test/webgl/conformance/more/functions/bindFramebufferLeaveNonZero.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/bindFramebufferLeaveNonZero.html
rename from content/canvas/test/webgl/conformance/more/functions/bufferData.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/bufferData.html
rename from content/canvas/test/webgl/conformance/more/functions/bufferDataBadArgs.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/bufferDataBadArgs.html
rename from content/canvas/test/webgl/conformance/more/functions/bufferSubData.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/bufferSubData.html
rename from content/canvas/test/webgl/conformance/more/functions/bufferSubDataBadArgs.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/bufferSubDataBadArgs.html
rename from content/canvas/test/webgl/conformance/more/functions/copyTexImage2D.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/copyTexImage2D.html
rename from content/canvas/test/webgl/conformance/more/functions/copyTexImage2DBadArgs.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/copyTexImage2DBadArgs.html
rename from content/canvas/test/webgl/conformance/more/functions/copyTexSubImage2D.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/copyTexSubImage2D.html
rename from content/canvas/test/webgl/conformance/more/functions/copyTexSubImage2DBadArgs.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/copyTexSubImage2DBadArgs.html
rename from content/canvas/test/webgl/conformance/more/functions/deleteBufferBadArgs.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/deleteBufferBadArgs.html
rename from content/canvas/test/webgl/conformance/more/functions/drawArrays.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/drawArrays.html
rename from content/canvas/test/webgl/conformance/more/functions/drawArraysOutOfBounds.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/drawArraysOutOfBounds.html
rename from content/canvas/test/webgl/conformance/more/functions/drawElements.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/drawElements.html
rename from content/canvas/test/webgl/conformance/more/functions/drawElementsBadArgs.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/drawElementsBadArgs.html
rename from content/canvas/test/webgl/conformance/more/functions/isTests.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/isTests.html
rename from content/canvas/test/webgl/conformance/more/functions/readPixels.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/readPixels.html
rename from content/canvas/test/webgl/conformance/more/functions/readPixelsBadArgs.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/readPixelsBadArgs.html
--- a/content/canvas/test/webgl/conformance/more/functions/readPixelsBadArgs.html
+++ b/content/canvas/test/webgl-conformance/conformance/more/functions/readPixelsBadArgs.html
@@ -26,16 +26,17 @@ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
+<script src="../../../resources/cors-util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
   return [gl];
 }
 
@@ -110,10 +111,15 @@ Tests.testReadPixelsSOPCanvas = function
 
 Tests.endUnit = function(gl) {
 }
 
 </script>
 </head><body>
 <canvas id="gl" width="16" height="16"></canvas>
 <canvas id="c" width="128" height="128"></canvas>
-<img id="i" src="http://example.com/tests/content/canvas/test/webgl/resources/opengl_logo.jpg">
+<img id="i">
+<script>
+var imagePath = 'resources/opengl_logo.jpg';
+var relPathToBase = '../../../';
+setExampleDotComImage('i', imagePath, relPathToBase);
+</script>
 </body></html>
rename from content/canvas/test/webgl/conformance/more/functions/texImage2D.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/texImage2D.html
rename from content/canvas/test/webgl/conformance/more/functions/texImage2DBadArgs.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/texImage2DBadArgs.html
rename from content/canvas/test/webgl/conformance/more/functions/texImage2DHTML.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/texImage2DHTML.html
--- a/content/canvas/test/webgl/conformance/more/functions/texImage2DHTML.html
+++ b/content/canvas/test/webgl-conformance/conformance/more/functions/texImage2DHTML.html
@@ -26,16 +26,17 @@ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
+<script src="../../../resources/cors-util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
     var canvas = document.getElementById('gl');
     var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
     gl.viewport(0,0,canvas.width,canvas.height);
     gl.clearColor(0,0,1,1);
     gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
@@ -142,11 +143,15 @@ void main()
     vec4 c = texture2D(Texture, texCoord0.st);
     gl_FragColor = c;
 }
 </script>
 </head><body>
 <canvas id="gl" width="256" height="256"></canvas>
 <canvas id="c" width="256" height="256"></canvas>
 <img id="i" width="256" height="256"  src="data:image/png;base64,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">
-<img id="i2" src="http://example.com/tests/content/canvas/test/webgl/resources/thunderbird-logo-64x64.png">
-
+<img id="i2">
+<script>
+var imagePath = 'resources/thunderbird-logo-64x64.png';
+var relPathToBase = '../../../';
+setExampleDotComImage('i2', imagePath, relPathToBase);
+</script>
 </body></html>
rename from content/canvas/test/webgl/conformance/more/functions/texImage2DHTMLBadArgs.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/texImage2DHTMLBadArgs.html
rename from content/canvas/test/webgl/conformance/more/functions/texSubImage2D.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/texSubImage2D.html
rename from content/canvas/test/webgl/conformance/more/functions/texSubImage2DBadArgs.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/texSubImage2DBadArgs.html
rename from content/canvas/test/webgl/conformance/more/functions/texSubImage2DHTML.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/texSubImage2DHTML.html
--- a/content/canvas/test/webgl/conformance/more/functions/texSubImage2DHTML.html
+++ b/content/canvas/test/webgl-conformance/conformance/more/functions/texSubImage2DHTML.html
@@ -26,16 +26,17 @@ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
+<script src="../../../resources/cors-util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
     var canvas = document.getElementById('gl');
     var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
     gl.viewport(0,0,canvas.width,canvas.height);
     gl.clearColor(0,0,1,1);
     gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
@@ -154,11 +155,15 @@ void main()
     vec4 c = texture2D(Texture, texCoord0.st);
     gl_FragColor = c;
 }
 </script>
 </head><body>
 <canvas id="gl" width="256" height="256"></canvas>
 <canvas id="c" width="256" height="256"></canvas>
 <img id="i" width="256" height="256"  src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAATVElEQVR4nO3d+VPUd57Hcf2b9k9Y+z44+qK7OZoGFVA5VfBGzah9cxpNzGEOoRua5lBEue/DK4fZ7MapmSm3Mlshu8xOdCpDJt3v/aEBAUHAOMG4z0fV53fqU/V6fd7fT/e32bEDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwOvBkar7l+3+GwBsk8xUrT0rTb8vx2Q45janlu7YsWPnsgXgTeYwak85U3Xv5ZiM3+XbUh/l2dICBc6080WZ1ur92baSHRQB8GayGdUWu1HzoSNFO+ZM1f2cbTLM51lT5woc5rkDObbZ/Vm2SEm23VvsyjhV5nJQBsCbxGZQVtmN6p4Mo/YPdqNGHKlayUrXJ9zWlESh0xIvzsmYL3HZ54pzMm6VuRyRMpfTW+pyUAbAm8BmVNVnGNTTdqP6vzOMGrGnaMSZqpNsk17ybKlS6DTL/ixbotRlj5flOubL3I65MpfjVrnbEalYKINSl335vQGA3wKbUW2xGdWRDKP66wyjWhYLwJGiFWeaTrJNBnFbU2SP3ST7s6xSmmuXcrczUe52xstzHfPlbsdcudt5qyzX3lKWlxkszXGeK8mxnyzJySjeQRkArzebQVllM6p7bUb149UF4EjVSmaaTrLS9eKypMgee7ocyLZJmdshFXmZUpHnXFEGB/OzJsrdjqEyt/NmWa49XJbt9Ja6Mk4Vu7hEBF5LNr2q3mZQz9gM6u9XFEBqsgCcaTrJXJgEci0pstdhkv3ZNinNTZbAofwsOZSfJQfzMqU8z5kodzsSZbmOeIXb+XW52zFa5nLcKnPZI2ULl4jFfKIAvB7MOrXFZlBHbAb11zaj+kmGUbNuAWSm65dKYHdGmhRlWqQ8zyFHCnLk+L5cOV6UK0cKXVK5J1sO5mdKhdspZavKoDTX0VPiciTLIHtFGVAIwK/NYlBW2fTqXptB/dhmSJ7+LyqArHS95JiTJVDgNEllQZZ4KgulrrpU6qtLJXBsv5wt3yMn9rvlaIFLDi8vg1xH4mB+5p+Wl0Fpjr2lJMcRLM6ynyvOzjhxIIt7A+BXY9Gr6q0L4/9SAaRoxL7w/L9WAWSbDJJrTZFid4Z4jxZJU/1xufHhOem+ek6il0/LB74qaTxTJoGj++Vs2R45vj9XjhTkyOHdC48JC2VwaHfmnyrczn+vcDsmynLtQyU5GTeLczLCpTk2T3GW7VhxVsae7d4f4I1l1qktVoM6YjOovrYa1D8sFoB9WQE415kA8u1pcvRAjnwUOiLDLQG5190o9242ylRHnQyG/XLz6nmJXqqWD3yV0nC6VPxH98nZst1yfF+uHC10SdXebDmUnyyDqoLs7w7lZ35b7nb8scxt/7dSl32kJCejqyQn40pJTkbZDiYC4NWzaJVVVr2q12ZQPbYa1H9fuwB0SwWQla6XLFOyAAoyTfLW4T3SfuWM3L3RIA/7L8vD/svyZe8l+ezW23Kvu1EmO2ploNkn3VfPSevb1fK+t1Iaz5RJ7cli8R0pktOl+XKsKFkGBxfKoHJv1l8P5mf+uSLP8fvyXMdMmdsRKXc5qotdGQXbvV/AG8WiV9Vb9aoZq141azOoxWbcXAHkWlOkJC9Dak8Xy61PL8iDnotLBbBUBH2X5Yvbl+RBz0W5e6NBJtprpL/ZJzc/Oi/XP3hLWi6ekvc8h6WuukS8Vc/KYPEC8WhhzpOqguzvKvdmfXV4d2b3wfzM9w/lZTENAK+CWaewWHWqiE2v+tqqV/2w2QLINhkkP2Nh/K89ImNtIfmi99Kz8Pcl15dL65J80XtJPr/1tty/2Sh3uxvkzvV6GY+FpO+aV65/8DuJXDwpVzyHpO7UQhmU5MvRIpdU7c2RQ7uz5MR+9x+OFbnuHi3MiVQVuKoP784u2u79A37TLFpllVWn6rXqVY+tetWPGxbAsgvAvU6TvHVot8SunJY7N+rly761g/9lb3J9sWx9fvuSfH77bXnQc1HudTfITFedjLWFpPeaR7o+eEvCjSflyoVDUlddKsHjB+TC4UI5VZwnVQU5ibcq9nx1ujS/58QB99XqYnf5DqYB4OVYdM/Gf6te9Y/k8//GBeCyGKXEnSE11Qek55Pzcv9m48rQrxP8L25fki9uvy2fr1qf3bqYnAxuNMh0Z52MRINy+1OPXP/wd9J+5Yw015+Qd84flJqTxXLhcIGcLM77+UhBzt8uVBa2nqvce/ZsxZ6y7d5L4Ddlcfy36FVfW/SqH6wGlawugMWvATvTlhWAySB5GalydH+OfFRzREajQfn81tvrh/6FwV9cF+WzWxflwa2Lcr/notzrbpSZ6/Uy1VUnkx21MtwSkJ5PLkjHe2elqf64XD53UEInDiQuHC6Yry7Omz1W5HrY+FbF4R1MA8DmWLTKKsuy8d9qUL+wAJZ/C3CPM13OHtwtbe+elunr9fLFusF/PvSf31o7+A96nq37PRflfk+j3L+Z/Fjx7o0Gme6qk4n2Ghlq8UvPx+el/coZuVZ3XC6fq/i57lTx32pOHngUOlUc/jR4lEtCYCMWnareolfNWPSqWatB9dOaBbDGl4BcFqMUu20SOnVAbn58Tu52N27qtP98g9A/WAz9QvAX173FEuhukLvdDcnJoLNWxmM1Mhjxy82Pzknn+2cSsXdPz4cbT8x+GKh8+FHwSO0OSgBYm1mnsJh1qohFr1wY/5XxZwWw/teAs9KTvwtwZH+2XA1VyXBrUB70XFz/tF9nzN9K8O91N8i9hfAvrjs3GuTOjXqZXnhEGG+vkdFoUAbD/p97Pj7/t56r57/pu+b5pOXd6qPbvdfAa8ei3VVl0al6LXrlY4tO+aNFr0pstgD2ONLlzMHdEn2nWqY66+SzlxzzHywb858L/TrBv3vjWfgX18z15JruqpOpzlqZaA8lxmKhv49Gg3/oD/s+3u69Bl47Fp2i3qJVzVh0ylmrTvmTVZ+8AFz5HsDzBZBjNkpxrk2Cpw5I90fn5M6Nhhee9lsOfvfmg3/n+rPwz1yvk5muOpleWJMdtfHJjprvJjtqKABgueT4r4iYdcqvzbpdP1j0yvjqArCv9SJQul7ctlSp2pctHwYrZaglIPdvNq5/2r/gYm9Twb+x9eBPd9XJVHISmJ/qrP1murOGRwBgOZN2V5VFp+y1aBfGf50ysVQAa3wHYLEAstL1stuRLqcr8qX18imZ7KiVBz0XXxj6jZ/vNxn86xsHP/kIUCdTnXXx6c7av0x11PRs914Drx2TTlFv0ipmzDrlrEWn/MmiV8lmCiDbbJADuTYJntwvN67+Tmau1ydDvmbot36x9yz49S8Z/NrFNT/dVfv7qc66k9u918BrxaxePf4r4hsVgHPh9wBzrSlSVZQtHwQqZTDil7vdjVs77bcY/JmtB1+mOmsTkx21T6a6ake2e6+B145Ju6vKpFP2mrTKx2bts/F/8VuALyqA3fY0OV2eLy2XTspEe43cf8Gz/TYEXyY7amWyoyY+1VHz/VRnXfN27zXw2lka/7XKWYtW+ZNFp5TNFEC2ySD7XVYJnNgnXR++JdNddZs+7X+d4NfKZEeNTHbUzE921Dya5PIPWClNrbCYtcnx36Td9YNZp4hbdKqNC2Bh/K8szJL3/YdlIOyTOzcatvwx3sY3+r8o+DLZEUpMtNc8mehg/AeeY1LvqjJplb0mjeKxWav40axVJlYXwFpvAmam6STfnibVZXkSefukjMVCcrd7EyP+eqf9loJfu2HwJzpqZKK9RsbbQ/HJ9tD3k501jP/AaiaNot6kSY7/Zq3iJ7NOKYsXgC8qgCyTQfblWMV/fJ90fnBWJjtrV4z3Wzntn7vRv/586Lca/GcrND/RHno02c74D6yQplZYTFpFxKRVLI3/Kwvg+ReB7CnJ3wFwWVLkcGGWvOc/LP3NXpm5Xv/LT/tNBn9yE8EfT4Y/MR4LPRlvDzH+A6uZNYpKk3ZXb/rC+G/SKhKbLYC8jDQ5VZYn4YsnZLQtKHdubC70mx3zf0nwx9tDMh4LyVgsFB+PBb8fb2f8B56TrlHUp2sV0yaNYmn830wBZKXrZV+2RXzH90nH+2dloqMmWQCv4LR/+eCHloK/EH4ZjwXnx2PBR2PtQcZ/YDmTRpmarlY0mTS7vkrTKP5q0ip+NuuUYtmgABypWnFZjHKoIFOueA9JX5NHprvqNh36zZ72vyT4C+FPjLYFn4zHgoz/wGomza7d6ZpdMZNG8Y1Jo3hi1i48/2+iAPIyUuVkqVuaGk/ISDQoM9df3Wm/Mvg1Ww7+WCwkY21BGW0Lxkfbgt+PxUKM/8BqaZpdu9PUiiaTRvGVSav4y9InABsUQGa6XoqyLeI9ViTt752R8fbQqsC/4tN+i8EfawvKaDQoI9HA/Ghb8JuxKOM/8ByT5l9T09SKQLpGMWTSKv7TrFU8NeuUieUFYFv1YyCOVK3kmJPj/7veg9J7zSNTnbWv6LR/BcFfWCPRQHwkGvjLSDTAm3/AetLVyjyTRvmOSauYNOsU35p1yn9sVABuW6qcLM2Vaw3HZbg1INNdr+a0X/sz/K0FfzQalNFoIHn6RwO/H2kL8uYf8CImza5Ck27Xe2atcsqiU8bXLYAUjWSm66QwyyzeY4USu3JaxmKhtUP/i0/7mhWhXxH8tvWCH5SRaEBGo4HESKv/yWhrgMs/YDPSdcois1bxvkWnfGrRK+NrFYA9RSvZZoMc3OuUdzwH5fa1CzLRUfNPPe3H1zjt1wv+4hpuDcRHooHvR6IBLv+AzTLrlEVmnfKhRad8al3z58C04ralyImSXLnWcEyGWv0y2VkrU13Ph/6lTvsNgj+6QfBHWgMy3BqQ4Vb//HBr4NFI1M/lH7AVFr0qYNGrHlr1qqc2gyq+/E1AZ5pOCrNM4jlaIG1XTstoW/Cfd9q/VPADMtzqTwy3+J8MM/4DL2XnihIwquI2o1rsKRrJNhmkYq9DLl+okFufnJfx9ppnoV/vc/utnvaxNcb8TQU/IMOtfhlq8ceHW/zfD0cDF7Z7I4Hfqp02vSpg06se2gzqpxlGTdyeopFca4ocL3HJp/VHZTDik4mOzY34L33ab+7EXwz+wvLND7cEbo20BjK3exOB37KdNqM6YDOoH2YY1U+dabp4QaZJLhzZK9F3q2UkGpCJDU/70Ks77TcMvl+GWnyJwYjvyVBL4J3t3jzgTbDTZlQHMoyah9lm/dOKPc74pfPl0vPxORmLhX6d035TwV9YEV98sMU/NRDm8g94VXbaU7UBl8X48ESJ6+kn9Ud+Hgh7EuPtoVdz2rdtJvQvDv5gxLewvH8ciHg7hloClu3eNOBNstNtSw34jxc9bH2nenaoxTc33h6aH4uF4uPtwcR48n/u/RNO+80G3ydDEd//DIR99wbCvsbt3izgTbTzaqgy0PPxufBINBAbbw89Go+FZsdjobnx9tDcaCw4P9oWjI/FgomxWCAx+gpO++G1xvxVwR+M+GQw7P1xMOx7PBj29fZHvFXbvVHAm2rn4prsrKkd6wiFR9tDsfH2mthILPRorC04O9YWmhuNheZG2wLzI9FgfLQtkBiNBhLPhf4XnPaLayDik4GwTwbC3v8daPY+HIj4Pupv9jL+A7+CncvXeHtN7WgsGB6NhWKjsVBsJBp8NBoNzo5EA3MLa364NRAfafUnhpPr5U77lcGXgbD37wNhz5/7m70jA2HPmW3eE+D/rZWF0BasHW4LhkeigdhILBQbbg08Gm4NzA63+OeGW/xzQ63++aEWf3yoxZdIrmWhb3k+9INLoV8KvvQ3e+MDzd4f+ps9/9Ef9rYNRHyObd4DAAtWFMJoW7B2uDUYHooGYkPRQGyoxf9oqMU3OxTxzQ1FfHNDLb75oYgvPhjxJpZWeO3gJ8PvSfQ3eX8aCHtn+5u9M33NXP4Br7MVhTDcGqgdbvWHB1v9scFWf2ww4n80GPHNDoa9c4MR39xg2Ds3EPbOD4S98YGwJzEQ9iT6m73S3+yVvmbPfH+zZ76vyfO0v9n7p75mb29/M5d/wG/Jc4Uw1OIP90f8scGIP9Yf8ccGwr5HA2Hv7ECzd26g2TvXlwx9vK/Z821/s+e/+po83/Y3eT7ra/Y0cfkH/LbtXL2GWny1A2FfuC/sjfWHvbH+Zs+jvrD3Zm+TZ6i3yTPW1+yZ7GvyXO9r9vi3908H8M+wohB6m7xlt695Tw6EfecGw15ff5Pnnb5mT6D32oUD2/x3AvgV7dyxY8fOgSavu7/Jk9V3zave7j8IAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAICV/g9tPJEQu1XvmQAAAABJRU5ErkJggg==">
-<img id="i2" src="http://example.com/tests/content/canvas/test/webgl/resources/thunderbird-logo-64x64.png">
-
+<img id="i2">
+<script>
+var imagePath = 'resources/thunderbird-logo-64x64.png';
+var relPathToBase = '../../../';
+setExampleDotComImage('i2', imagePath, relPathToBase);
+</script>
 </body></html>
rename from content/canvas/test/webgl/conformance/more/functions/texSubImage2DHTMLBadArgs.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/texSubImage2DHTMLBadArgs.html
rename from content/canvas/test/webgl/conformance/more/functions/uniformMatrix.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/uniformMatrix.html
rename from content/canvas/test/webgl/conformance/more/functions/uniformMatrixBadArgs.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/uniformMatrixBadArgs.html
rename from content/canvas/test/webgl/conformance/more/functions/uniformf.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/uniformf.html
rename from content/canvas/test/webgl/conformance/more/functions/uniformfArrayLen1.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/uniformfArrayLen1.html
rename from content/canvas/test/webgl/conformance/more/functions/uniformfBadArgs.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/uniformfBadArgs.html
rename from content/canvas/test/webgl/conformance/more/functions/uniformi.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/uniformi.html
rename from content/canvas/test/webgl/conformance/more/functions/uniformiBadArgs.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/uniformiBadArgs.html
rename from content/canvas/test/webgl/conformance/more/functions/vertexAttrib.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/vertexAttrib.html
rename from content/canvas/test/webgl/conformance/more/functions/vertexAttribBadArgs.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/vertexAttribBadArgs.html
rename from content/canvas/test/webgl/conformance/more/functions/vertexAttribPointer.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/vertexAttribPointer.html
rename from content/canvas/test/webgl/conformance/more/functions/vertexAttribPointerBadArgs.html
rename to content/canvas/test/webgl-conformance/conformance/more/functions/vertexAttribPointerBadArgs.html
rename from content/canvas/test/webgl/conformance/more/glsl/arrayOutOfBounds.html
rename to content/canvas/test/webgl-conformance/conformance/more/glsl/arrayOutOfBounds.html
rename from content/canvas/test/webgl/conformance/more/glsl/longLoops.html
rename to content/canvas/test/webgl-conformance/conformance/more/glsl/longLoops.html
rename from content/canvas/test/webgl/conformance/more/glsl/uniformOutOfBounds.html
rename to content/canvas/test/webgl-conformance/conformance/more/glsl/uniformOutOfBounds.html
rename from content/canvas/test/webgl/conformance/more/glsl/unusedAttribsUniforms.html
rename to content/canvas/test/webgl-conformance/conformance/more/glsl/unusedAttribsUniforms.html
rename from content/canvas/test/webgl/conformance/more/index.html
rename to content/canvas/test/webgl-conformance/conformance/more/index.html
rename from content/canvas/test/webgl/conformance/more/performance/CPUvsGPU.html
rename to content/canvas/test/webgl-conformance/conformance/more/performance/CPUvsGPU.html
rename from content/canvas/test/webgl/conformance/more/performance/bandwidth.html
rename to content/canvas/test/webgl-conformance/conformance/more/performance/bandwidth.html
rename from content/canvas/test/webgl/conformance/more/performance/jsGCPause.html
rename to content/canvas/test/webgl-conformance/conformance/more/performance/jsGCPause.html
rename from content/canvas/test/webgl/conformance/more/performance/jsMatrixMult.html
rename to content/canvas/test/webgl-conformance/conformance/more/performance/jsMatrixMult.html
rename from content/canvas/test/webgl/conformance/more/performance/jsToGLOverhead.html
rename to content/canvas/test/webgl-conformance/conformance/more/performance/jsToGLOverhead.html
rename from content/canvas/test/webgl/conformance/more/unit.css
rename to content/canvas/test/webgl-conformance/conformance/more/unit.css
rename from content/canvas/test/webgl/conformance/more/unit.js
rename to content/canvas/test/webgl-conformance/conformance/more/unit.js
rename from content/canvas/test/webgl/conformance/more/util.js
rename to content/canvas/test/webgl-conformance/conformance/more/util.js
rename from content/canvas/test/webgl/conformance/programs/00_test_list.txt
rename to content/canvas/test/webgl-conformance/conformance/programs/00_test_list.txt
rename from content/canvas/test/webgl/conformance/programs/get-active-test.html
rename to content/canvas/test/webgl-conformance/conformance/programs/get-active-test.html
rename from content/canvas/test/webgl/conformance/programs/gl-bind-attrib-location-test.html
rename to content/canvas/test/webgl-conformance/conformance/programs/gl-bind-attrib-location-test.html
rename from content/canvas/test/webgl/conformance/programs/gl-get-active-attribute.html
rename to content/canvas/test/webgl-conformance/conformance/programs/gl-get-active-attribute.html
rename from content/canvas/test/webgl/conformance/programs/gl-get-active-uniform.html
rename to content/canvas/test/webgl-conformance/conformance/programs/gl-get-active-uniform.html
rename from content/canvas/test/webgl/conformance/programs/gl-getshadersource.html
rename to content/canvas/test/webgl-conformance/conformance/programs/gl-getshadersource.html
rename from content/canvas/test/webgl/conformance/programs/gl-shader-test.html
rename to content/canvas/test/webgl-conformance/conformance/programs/gl-shader-test.html
rename from content/canvas/test/webgl/conformance/programs/invalid-UTF-16.html
rename to content/canvas/test/webgl-conformance/conformance/programs/invalid-UTF-16.html
rename from content/canvas/test/webgl/conformance/programs/program-test.html
rename to content/canvas/test/webgl-conformance/conformance/programs/program-test.html
rename from content/canvas/test/webgl/conformance/reading/00_test_list.txt
rename to content/canvas/test/webgl-conformance/conformance/reading/00_test_list.txt
rename from content/canvas/test/webgl/conformance/reading/read-pixels-pack-alignment.html
rename to content/canvas/test/webgl-conformance/conformance/reading/read-pixels-pack-alignment.html
rename from content/canvas/test/webgl/conformance/reading/read-pixels-test.html
rename to content/canvas/test/webgl-conformance/conformance/reading/read-pixels-test.html
rename from content/canvas/test/webgl/conformance/renderbuffers/00_test_list.txt
rename to content/canvas/test/webgl-conformance/conformance/renderbuffers/00_test_list.txt
rename from content/canvas/test/webgl/conformance/renderbuffers/framebuffer-object-attachment.html
rename to content/canvas/test/webgl-conformance/conformance/renderbuffers/framebuffer-object-attachment.html
rename from content/canvas/test/webgl/conformance/renderbuffers/framebuffer-test.html
rename to content/canvas/test/webgl-conformance/conformance/renderbuffers/framebuffer-test.html
rename from content/canvas/test/webgl/conformance/renderbuffers/renderbuffer-initialization.html
rename to content/canvas/test/webgl-conformance/conformance/renderbuffers/renderbuffer-initialization.html
rename from content/canvas/test/webgl/conformance/rendering/00_test_list.txt
rename to content/canvas/test/webgl-conformance/conformance/rendering/00_test_list.txt
rename from content/canvas/test/webgl/conformance/rendering/draw-arrays-out-of-bounds.html
rename to content/canvas/test/webgl-conformance/conformance/rendering/draw-arrays-out-of-bounds.html
rename from content/canvas/test/webgl/conformance/rendering/draw-elements-out-of-bounds.html
rename to content/canvas/test/webgl-conformance/conformance/rendering/draw-elements-out-of-bounds.html
rename from content/canvas/test/webgl/conformance/rendering/gl-clear.html
rename to content/canvas/test/webgl-conformance/conformance/rendering/gl-clear.html
rename from content/canvas/test/webgl/conformance/rendering/gl-drawelements.html
rename to content/canvas/test/webgl-conformance/conformance/rendering/gl-drawelements.html
rename from content/canvas/test/webgl/conformance/rendering/gl-scissor-test.html
rename to content/canvas/test/webgl-conformance/conformance/rendering/gl-scissor-test.html
rename from content/canvas/test/webgl/conformance/rendering/line-loop-tri-fan.html
rename to content/canvas/test/webgl-conformance/conformance/rendering/line-loop-tri-fan.html
rename from content/canvas/test/webgl/conformance/rendering/more-than-65536-indices.html
rename to content/canvas/test/webgl-conformance/conformance/rendering/more-than-65536-indices.html
rename from content/canvas/test/webgl/conformance/rendering/point-size.html
rename to content/canvas/test/webgl-conformance/conformance/rendering/point-size.html
rename from content/canvas/test/webgl/conformance/rendering/triangle.html
rename to content/canvas/test/webgl-conformance/conformance/rendering/triangle.html
rename from content/canvas/test/webgl/conformance/resources/3x3.png
rename to content/canvas/test/webgl-conformance/conformance/resources/3x3.png
rename from content/canvas/test/webgl/conformance/resources/blue-1x1.jpg
rename to content/canvas/test/webgl-conformance/conformance/resources/blue-1x1.jpg
rename from content/canvas/test/webgl/conformance/resources/boolUniformShader.vert
rename to content/canvas/test/webgl-conformance/conformance/resources/boolUniformShader.vert
rename from content/canvas/test/webgl/conformance/resources/bug-32888-texture.png
rename to content/canvas/test/webgl-conformance/conformance/resources/bug-32888-texture.png
rename from content/canvas/test/webgl/conformance/resources/floatUniformShader.vert
rename to content/canvas/test/webgl-conformance/conformance/resources/floatUniformShader.vert
rename from content/canvas/test/webgl/conformance/resources/fragmentShader.frag
rename to content/canvas/test/webgl-conformance/conformance/resources/fragmentShader.frag
rename from content/canvas/test/webgl/conformance/resources/glsl-conformance-test.js
rename to content/canvas/test/webgl-conformance/conformance/resources/glsl-conformance-test.js
rename from content/canvas/test/webgl/conformance/resources/glsl-feature-tests.css
rename to content/canvas/test/webgl-conformance/conformance/resources/glsl-feature-tests.css
rename from content/canvas/test/webgl/conformance/resources/glsl-generator.js
rename to content/canvas/test/webgl-conformance/conformance/resources/glsl-generator.js
rename from content/canvas/test/webgl/conformance/resources/gray-ramp-256-with-128-alpha.png
rename to content/canvas/test/webgl-conformance/conformance/resources/gray-ramp-256-with-128-alpha.png
rename from content/canvas/test/webgl/conformance/resources/gray-ramp-256.png
rename to content/canvas/test/webgl-conformance/conformance/resources/gray-ramp-256.png
rename from content/canvas/test/webgl/conformance/resources/gray-ramp-default-gamma.png
rename to content/canvas/test/webgl-conformance/conformance/resources/gray-ramp-default-gamma.png
rename from content/canvas/test/webgl/conformance/resources/gray-ramp-gamma0.1.png
rename to content/canvas/test/webgl-conformance/conformance/resources/gray-ramp-gamma0.1.png
rename from content/canvas/test/webgl/conformance/resources/gray-ramp-gamma1.0.png
rename to content/canvas/test/webgl-conformance/conformance/resources/gray-ramp-gamma1.0.png
rename from content/canvas/test/webgl/conformance/resources/gray-ramp-gamma2.0.png
rename to content/canvas/test/webgl-conformance/conformance/resources/gray-ramp-gamma2.0.png
rename from content/canvas/test/webgl/conformance/resources/gray-ramp-gamma4.0.png
rename to content/canvas/test/webgl-conformance/conformance/resources/gray-ramp-gamma4.0.png
rename from content/canvas/test/webgl/conformance/resources/gray-ramp-gamma9.0.png
rename to content/canvas/test/webgl-conformance/conformance/resources/gray-ramp-gamma9.0.png
rename from content/canvas/test/webgl/conformance/resources/gray-ramp.png
rename to content/canvas/test/webgl-conformance/conformance/resources/gray-ramp.png
rename from content/canvas/test/webgl/conformance/resources/green-2x2-16bit.png
rename to content/canvas/test/webgl-conformance/conformance/resources/green-2x2-16bit.png
rename from content/canvas/test/webgl/conformance/resources/intArrayUniformShader.vert
rename to content/canvas/test/webgl-conformance/conformance/resources/intArrayUniformShader.vert
rename from content/canvas/test/webgl/conformance/resources/intUniformShader.vert
rename to content/canvas/test/webgl-conformance/conformance/resources/intUniformShader.vert
rename from content/canvas/test/webgl/conformance/resources/matUniformShader.vert
rename to content/canvas/test/webgl-conformance/conformance/resources/matUniformShader.vert
rename from content/canvas/test/webgl/conformance/resources/noopUniformShader.frag
rename to content/canvas/test/webgl-conformance/conformance/resources/noopUniformShader.frag
rename from content/canvas/test/webgl/conformance/resources/noopUniformShader.vert
rename to content/canvas/test/webgl-conformance/conformance/resources/noopUniformShader.vert
rename from content/canvas/test/webgl/conformance/resources/npot-video.mp4
rename to content/canvas/test/webgl-conformance/conformance/resources/npot-video.mp4
rename from content/canvas/test/webgl/conformance/resources/npot-video.theora.ogv
rename to content/canvas/test/webgl-conformance/conformance/resources/npot-video.theora.ogv
rename from content/canvas/test/webgl/conformance/resources/npot-video.webmvp8.webm
rename to content/canvas/test/webgl-conformance/conformance/resources/npot-video.webmvp8.webm
rename from content/canvas/test/webgl/conformance/resources/pnglib.js
rename to content/canvas/test/webgl-conformance/conformance/resources/pnglib.js
rename from content/canvas/test/webgl/conformance/resources/red-green.mp4
rename to content/canvas/test/webgl-conformance/conformance/resources/red-green.mp4
rename from content/canvas/test/webgl/conformance/resources/red-green.png
rename to content/canvas/test/webgl-conformance/conformance/resources/red-green.png
rename from content/canvas/test/webgl/conformance/resources/red-green.theora.ogv
rename to content/canvas/test/webgl-conformance/conformance/resources/red-green.theora.ogv
rename from content/canvas/test/webgl/conformance/resources/red-green.webmvp8.webm
rename to content/canvas/test/webgl-conformance/conformance/resources/red-green.webmvp8.webm
rename from content/canvas/test/webgl/conformance/resources/red-indexed.png
rename to content/canvas/test/webgl-conformance/conformance/resources/red-indexed.png
rename from content/canvas/test/webgl/conformance/resources/samplerUniformShader.frag
rename to content/canvas/test/webgl-conformance/conformance/resources/samplerUniformShader.frag
rename from content/canvas/test/webgl/conformance/resources/small-square-with-cie-rgb-profile.png
rename to content/canvas/test/webgl-conformance/conformance/resources/small-square-with-cie-rgb-profile.png
rename from content/canvas/test/webgl/conformance/resources/small-square-with-colormatch-profile.png
rename to content/canvas/test/webgl-conformance/conformance/resources/small-square-with-colormatch-profile.png
rename from content/canvas/test/webgl/conformance/resources/small-square-with-colorspin-profile.jpg
rename to content/canvas/test/webgl-conformance/conformance/resources/small-square-with-colorspin-profile.jpg
rename from content/canvas/test/webgl/conformance/resources/small-square-with-colorspin-profile.png
rename to content/canvas/test/webgl-conformance/conformance/resources/small-square-with-colorspin-profile.png
rename from content/canvas/test/webgl/conformance/resources/small-square-with-e-srgb-profile.png
rename to content/canvas/test/webgl-conformance/conformance/resources/small-square-with-e-srgb-profile.png
rename from content/canvas/test/webgl/conformance/resources/small-square-with-smpte-c-profile.png
rename to content/canvas/test/webgl-conformance/conformance/resources/small-square-with-smpte-c-profile.png
rename from content/canvas/test/webgl/conformance/resources/small-square-with-srgb-iec61966-2.1-profile.png
rename to content/canvas/test/webgl-conformance/conformance/resources/small-square-with-srgb-iec61966-2.1-profile.png
rename from content/canvas/test/webgl/conformance/resources/structUniformShader.vert
rename to content/canvas/test/webgl-conformance/conformance/resources/structUniformShader.vert
rename from content/canvas/test/webgl/conformance/resources/vertexShader.vert
rename to content/canvas/test/webgl-conformance/conformance/resources/vertexShader.vert
rename from content/canvas/test/webgl/conformance/resources/webgl-test-utils.js
rename to content/canvas/test/webgl-conformance/conformance/resources/webgl-test-utils.js
rename from content/canvas/test/webgl/conformance/resources/webgl-test.js
rename to content/canvas/test/webgl-conformance/conformance/resources/webgl-test.js
rename from content/canvas/test/webgl/conformance/resources/zero-alpha.png
rename to content/canvas/test/webgl-conformance/conformance/resources/zero-alpha.png
rename from content/canvas/test/webgl/conformance/state/00_test_list.txt
rename to content/canvas/test/webgl-conformance/conformance/state/00_test_list.txt
rename from content/canvas/test/webgl/conformance/state/gl-enable-enum-test.html
rename to content/canvas/test/webgl-conformance/conformance/state/gl-enable-enum-test.html
rename from content/canvas/test/webgl/conformance/state/gl-enum-tests.html
rename to content/canvas/test/webgl-conformance/conformance/state/gl-enum-tests.html
rename from content/canvas/test/webgl/conformance/state/gl-get-calls.html
rename to content/canvas/test/webgl-conformance/conformance/state/gl-get-calls.html
rename from content/canvas/test/webgl/conformance/state/gl-geterror.html
rename to content/canvas/test/webgl-conformance/conformance/state/gl-geterror.html
rename from content/canvas/test/webgl/conformance/state/gl-getstring.html
rename to content/canvas/test/webgl-conformance/conformance/state/gl-getstring.html
rename from content/canvas/test/webgl/conformance/state/gl-object-get-calls.html
rename to content/canvas/test/webgl-conformance/conformance/state/gl-object-get-calls.html
rename from content/canvas/test/webgl/conformance/textures/00_test_list.txt
rename to content/canvas/test/webgl-conformance/conformance/textures/00_test_list.txt
rename from content/canvas/test/webgl/conformance/textures/compressed-tex-image.html
rename to content/canvas/test/webgl-conformance/conformance/textures/compressed-tex-image.html
rename from content/canvas/test/webgl/conformance/textures/copy-tex-image-and-sub-image-2d.html
rename to content/canvas/test/webgl-conformance/conformance/textures/copy-tex-image-and-sub-image-2d.html
rename from content/canvas/test/webgl/conformance/textures/gl-pixelstorei.html
rename to content/canvas/test/webgl-conformance/conformance/textures/gl-pixelstorei.html
rename from content/canvas/test/webgl/conformance/textures/gl-teximage.html
rename to content/canvas/test/webgl-conformance/conformance/textures/gl-teximage.html
rename from content/canvas/test/webgl/conformance/textures/origin-clean-conformance.html
rename to content/canvas/test/webgl-conformance/conformance/textures/origin-clean-conformance.html
--- a/content/canvas/test/webgl/conformance/textures/origin-clean-conformance.html
+++ b/content/canvas/test/webgl-conformance/conformance/textures/origin-clean-conformance.html
@@ -6,16 +6,17 @@ found in the LICENSE file.
 <!DOCTYPE html>
 <html>
 <head>
 <meta charset="utf-8">
 <title>WebGL Origin Restrictions Conformance Tests</title>
 <link rel="stylesheet" href="../../resources/js-test-style.css"/>
 <script src="../../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../../resources/js-test-pre.js"></script>
+<script src="../../resources/cors-util.js"></script>
 <script src="../resources/webgl-test.js"></script>
 <script>
 // This function returns the last 2 words of the domain of a URL
 // This is probably not the correct check but it will do for now.
 function getBaseDomain(str) {
   str = str.replace("\\", "/");
   var pos = str.indexOf("://");
   if (pos >= 0) {
@@ -32,20 +33,22 @@ function causedException(func) {
   try {
     func();
   } catch(e) {
     hadException = true;
   }
   return hadException;
 }
 
-window.onload = function() {
+function onImageLoad() {
   description("This test ensures WebGL implementations follow proper same-origin restrictions.");
   var img = document.getElementById("img");
-  assertMsg(img.width > 0 && img.height > 0, "img was loaded");
+  assertMsg(img.width > 0 && img.height > 0,
+            "Image should have loaded properly: " + img.src);
+
   imgDomain = getBaseDomain(img.src);
   pageDomain = getBaseDomain(window.location.toString());
   assertMsg(imgDomain != pageDomain,
             "img domain (" + imgDomain + ") and page domain (" + pageDomain + ") are not the same.");
 
   function makeTexImage2D(gl, src) {
     return function() {
       gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, src);
@@ -118,11 +121,16 @@ window.onload = function() {
 }
 </script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 <canvas id="canvas1"></canvas>
 <canvas id="canvas2"></canvas>
-<img id="img" src="http://example.com/tests/content/canvas/test/webgl/resources/opengl_logo.jpg" style="display:none;">
+<img id="img" style="display:none;">
+<script>
+var imagePath = 'resources/opengl_logo.jpg';
+var relPathToBase = '../../';
+setExampleDotComImage('img', imagePath, relPathToBase, onImageLoad);
+</script>
 </body>
 </html>
rename from content/canvas/test/webgl/conformance/textures/tex-image-and-sub-image-2d-with-array-buffer-view.html
rename to content/canvas/test/webgl-conformance/conformance/textures/tex-image-and-sub-image-2d-with-array-buffer-view.html
rename from content/canvas/test/webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas.html
rename to content/canvas/test/webgl-conformance/conformance/textures/tex-image-and-sub-image-2d-with-canvas.html
rename from content/canvas/test/webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-data.html
rename to content/canvas/test/webgl-conformance/conformance/textures/tex-image-and-sub-image-2d-with-image-data.html
rename from content/canvas/test/webgl/conformance/textures/tex-image-and-sub-image-2d-with-image.html
rename to content/canvas/test/webgl-conformance/conformance/textures/tex-image-and-sub-image-2d-with-image.html
rename from content/canvas/test/webgl/conformance/textures/tex-image-and-sub-image-2d-with-video.html
rename to content/canvas/test/webgl-conformance/conformance/textures/tex-image-and-sub-image-2d-with-video.html
rename from content/canvas/test/webgl/conformance/textures/tex-image-and-uniform-binding-bugs.html
rename to content/canvas/test/webgl-conformance/conformance/textures/tex-image-and-uniform-binding-bugs.html
rename from content/canvas/test/webgl/conformance/textures/tex-image-with-format-and-type.html
rename to content/canvas/test/webgl-conformance/conformance/textures/tex-image-with-format-and-type.html
rename from content/canvas/test/webgl/conformance/textures/tex-image-with-invalid-data.html
rename to content/canvas/test/webgl-conformance/conformance/textures/tex-image-with-invalid-data.html
rename from content/canvas/test/webgl/conformance/textures/tex-input-validation.html
rename to content/canvas/test/webgl-conformance/conformance/textures/tex-input-validation.html
rename from content/canvas/test/webgl/conformance/textures/tex-sub-image-2d-bad-args.html
rename to content/canvas/test/webgl-conformance/conformance/textures/tex-sub-image-2d-bad-args.html
rename from content/canvas/test/webgl/conformance/textures/tex-sub-image-2d.html
rename to content/canvas/test/webgl-conformance/conformance/textures/tex-sub-image-2d.html
rename from content/canvas/test/webgl/conformance/textures/texparameter-test.html
rename to content/canvas/test/webgl-conformance/conformance/textures/texparameter-test.html
rename from content/canvas/test/webgl/conformance/textures/texture-active-bind-2.html
rename to content/canvas/test/webgl-conformance/conformance/textures/texture-active-bind-2.html
rename from content/canvas/test/webgl/conformance/textures/texture-active-bind.html
rename to content/canvas/test/webgl-conformance/conformance/textures/texture-active-bind.html
rename from content/canvas/test/webgl/conformance/textures/texture-clear.html
rename to content/canvas/test/webgl-conformance/conformance/textures/texture-clear.html
rename from content/canvas/test/webgl/conformance/textures/texture-complete.html
rename to content/canvas/test/webgl-conformance/conformance/textures/texture-complete.html
rename from content/canvas/test/webgl/conformance/textures/texture-formats-test.html
rename to content/canvas/test/webgl-conformance/conformance/textures/texture-formats-test.html
rename from content/canvas/test/webgl/conformance/textures/texture-mips.html
rename to content/canvas/test/webgl-conformance/conformance/textures/texture-mips.html
rename from content/canvas/test/webgl/conformance/textures/texture-npot-video.html
rename to content/canvas/test/webgl-conformance/conformance/textures/texture-npot-video.html
rename from content/canvas/test/webgl/conformance/textures/texture-npot.html
rename to content/canvas/test/webgl-conformance/conformance/textures/texture-npot.html
rename from content/canvas/test/webgl/conformance/textures/texture-size-cube-maps.html
rename to content/canvas/test/webgl-conformance/conformance/textures/texture-size-cube-maps.html
rename from content/canvas/test/webgl/conformance/textures/texture-size.html
rename to content/canvas/test/webgl-conformance/conformance/textures/texture-size.html
rename from content/canvas/test/webgl/conformance/textures/texture-transparent-pixels-initialized.html
rename to content/canvas/test/webgl-conformance/conformance/textures/texture-transparent-pixels-initialized.html
rename from content/canvas/test/webgl/conformance/typedarrays/00_test_list.txt
rename to content/canvas/test/webgl-conformance/conformance/typedarrays/00_test_list.txt
rename from content/canvas/test/webgl/conformance/typedarrays/array-buffer-crash.html
rename to content/canvas/test/webgl-conformance/conformance/typedarrays/array-buffer-crash.html
rename from content/canvas/test/webgl/conformance/typedarrays/array-buffer-view-crash.html
rename to content/canvas/test/webgl-conformance/conformance/typedarrays/array-buffer-view-crash.html
rename from content/canvas/test/webgl/conformance/typedarrays/array-unit-tests.html
rename to content/canvas/test/webgl-conformance/conformance/typedarrays/array-unit-tests.html
rename from content/canvas/test/webgl/conformance/uniforms/00_test_list.txt
rename to content/canvas/test/webgl-conformance/conformance/uniforms/00_test_list.txt
rename from content/canvas/test/webgl/conformance/uniforms/gl-uniform-arrays.html
rename to content/canvas/test/webgl-conformance/conformance/uniforms/gl-uniform-arrays.html
rename from content/canvas/test/webgl/conformance/uniforms/gl-uniform-bool.html
rename to content/canvas/test/webgl-conformance/conformance/uniforms/gl-uniform-bool.html
rename from content/canvas/test/webgl/conformance/uniforms/gl-uniformmatrix4fv.html
rename to content/canvas/test/webgl-conformance/conformance/uniforms/gl-uniformmatrix4fv.html
rename from content/canvas/test/webgl/conformance/uniforms/gl-unknown-uniform.html
rename to content/canvas/test/webgl-conformance/conformance/uniforms/gl-unknown-uniform.html
rename from content/canvas/test/webgl/conformance/uniforms/null-uniform-location.html
rename to content/canvas/test/webgl-conformance/conformance/uniforms/null-uniform-location.html
rename from content/canvas/test/webgl/conformance/uniforms/uniform-location.html
rename to content/canvas/test/webgl-conformance/conformance/uniforms/uniform-location.html
rename from content/canvas/test/webgl/conformance/uniforms/uniform-samplers-test.html
rename to content/canvas/test/webgl-conformance/conformance/uniforms/uniform-samplers-test.html
rename from content/canvas/test/webgl/dont-load-image-from-internet.patch
rename to content/canvas/test/webgl-conformance/dont-load-image-from-internet.patch
rename from content/canvas/test/webgl/ext-texture-filter-anisotropic.patch
rename to content/canvas/test/webgl-conformance/ext-texture-filter-anisotropic.patch
rename from content/canvas/test/webgl/extra/50x50pixel-black-with-red-triangle.png
rename to content/canvas/test/webgl-conformance/extra/50x50pixel-black-with-red-triangle.png
rename from content/canvas/test/webgl/extra/big-fbos-example.html
rename to content/canvas/test/webgl-conformance/extra/big-fbos-example.html
rename from content/canvas/test/webgl/extra/canvas-compositing-test.html
rename to content/canvas/test/webgl-conformance/extra/canvas-compositing-test.html
rename from content/canvas/test/webgl/extra/canvas-compositing-test.png
rename to content/canvas/test/webgl-conformance/extra/canvas-compositing-test.png
rename from content/canvas/test/webgl/extra/fbo-lost-context.html
rename to content/canvas/test/webgl-conformance/extra/fbo-lost-context.html
rename from content/canvas/test/webgl/extra/lots-of-polys-example.html
rename to content/canvas/test/webgl-conformance/extra/lots-of-polys-example.html
rename from content/canvas/test/webgl/extra/offscreen-issue.html
rename to content/canvas/test/webgl-conformance/extra/offscreen-issue.html
rename from content/canvas/test/webgl/extra/out-of-bounds-uniform-array-access.html
rename to content/canvas/test/webgl-conformance/extra/out-of-bounds-uniform-array-access.html
rename from content/canvas/test/webgl/extra/out-of-memory.html
rename to content/canvas/test/webgl-conformance/extra/out-of-memory.html
rename from content/canvas/test/webgl/extra/out-of-resources.html
rename to content/canvas/test/webgl-conformance/extra/out-of-resources.html
rename from content/canvas/test/webgl/extra/out-of-vram.html
rename to content/canvas/test/webgl-conformance/extra/out-of-vram.html
rename from content/canvas/test/webgl/extra/simulated-attrib-0-bug-test.html
rename to content/canvas/test/webgl-conformance/extra/simulated-attrib-0-bug-test.html
rename from content/canvas/test/webgl/extra/slow-shader-example.html
rename to content/canvas/test/webgl-conformance/extra/slow-shader-example.html
rename from content/canvas/test/webgl/extra/webgl-info.html
rename to content/canvas/test/webgl-conformance/extra/webgl-info.html
rename from content/canvas/test/webgl/failing_tests_android.txt
rename to content/canvas/test/webgl-conformance/failing_tests_android.txt
rename from content/canvas/test/webgl/failing_tests_android_nvidia.txt
rename to content/canvas/test/webgl-conformance/failing_tests_android_nvidia.txt
rename from content/canvas/test/webgl/failing_tests_android_x86.txt
rename to content/canvas/test/webgl-conformance/failing_tests_android_x86.txt
rename from content/canvas/test/webgl/failing_tests_linux.txt
rename to content/canvas/test/webgl-conformance/failing_tests_linux.txt
rename from content/canvas/test/webgl/failing_tests_linux_mesa.txt
rename to content/canvas/test/webgl-conformance/failing_tests_linux_mesa.txt
rename from content/canvas/test/webgl/failing_tests_linux_nvidia.txt
rename to content/canvas/test/webgl-conformance/failing_tests_linux_nvidia.txt
rename from content/canvas/test/webgl/failing_tests_mac.txt
rename to content/canvas/test/webgl-conformance/failing_tests_mac.txt
rename from content/canvas/test/webgl/failing_tests_mac_mtnlion.txt
rename to content/canvas/test/webgl-conformance/failing_tests_mac_mtnlion.txt
rename from content/canvas/test/webgl/failing_tests_windows.txt
rename to content/canvas/test/webgl-conformance/failing_tests_windows.txt
rename from content/canvas/test/webgl/fix-webgl-harness-async.patch
rename to content/canvas/test/webgl-conformance/fix-webgl-harness-async.patch
rename from content/canvas/test/webgl/gc.patch
rename to content/canvas/test/webgl-conformance/gc.patch
rename from content/canvas/test/webgl/log-more-info-about-test-failures.patch
rename to content/canvas/test/webgl-conformance/log-more-info-about-test-failures.patch
rename from content/canvas/test/webgl/misc/program-test-1.html
rename to content/canvas/test/webgl-conformance/misc/program-test-1.html
rename from content/canvas/test/webgl/mochitest-conformance-files.ini
rename to content/canvas/test/webgl-conformance/mochitest-conformance-files.ini
--- a/content/canvas/test/webgl/mochitest-conformance-files.ini
+++ b/content/canvas/test/webgl-conformance/mochitest-conformance-files.ini
@@ -460,15 +460,16 @@ support-files =
   conformance/uniforms/00_test_list.txt
   conformance/uniforms/gl-uniform-arrays.html
   conformance/uniforms/gl-uniform-bool.html
   conformance/uniforms/gl-uniformmatrix4fv.html
   conformance/uniforms/gl-unknown-uniform.html
   conformance/uniforms/null-uniform-location.html
   conformance/uniforms/uniform-location.html
   conformance/uniforms/uniform-samplers-test.html
+  resources/cors-util.js
   resources/desktop-gl-constants.js
   resources/js-test-pre.js
   resources/js-test-style.css
   resources/opengl_logo.jpg
   resources/thunderbird-logo-64x64.png
   resources/webgl-logo.png
   resources/webgl-test-harness.js
rename from content/canvas/test/webgl/mochitest.ini
rename to content/canvas/test/webgl-conformance/mochitest.ini
rename from content/canvas/test/webgl/moz.build
rename to content/canvas/test/webgl-conformance/moz.build
--- a/content/canvas/test/webgl/moz.build
+++ b/content/canvas/test/webgl-conformance/moz.build
@@ -2,10 +2,9 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 MOCHITEST_MANIFESTS += [
     'mochitest-conformance-files.ini',
     'mochitest.ini',
-    'non-conf-tests/mochitest.ini',
 ]
rename from content/canvas/test/webgl/reference-cycle-test.patch
rename to content/canvas/test/webgl-conformance/reference-cycle-test.patch
new file mode 100644
--- /dev/null
+++ b/content/canvas/test/webgl-conformance/resources/cors-util.js
@@ -0,0 +1,31 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+function getExampleDotComURL(conformanceDirRelativePath) {
+  var prefix = 'http://example.com/tests/content/canvas/test/webgl-conformance/';
+  return prefix + conformanceDirRelativePath;
+}
+
+function setExampleDotComImage(imageElemID, imagePath, relPathToBase, onLoadCallback) {
+  var img = document.getElementById(imageElemID);
+  if (!img)
+    throw 'Bad `imageElemID`: ' + imageElemID;
+
+  if (onLoadCallback)
+    img.onload = onLoadCallback;
+
+  img.onerror = function() {
+    console.log('Failed to load image from: ' + img.src);
+    console.log('Loading same-domain backup image.');
+
+    img.onerror = function() {
+      console.log('Failed to load backup image from: ' + img.src);
+      return;
+    };
+
+    img.src = relPathToBase + imagePath;
+  };
+
+  img.src = getExampleDotComURL(imagePath);
+}
rename from content/canvas/test/webgl/resources/desktop-gl-constants.js
rename to content/canvas/test/webgl-conformance/resources/desktop-gl-constants.js
rename from content/canvas/test/webgl/resources/js-test-pre.js
rename to content/canvas/test/webgl-conformance/resources/js-test-pre.js
--- a/content/canvas/test/webgl/resources/js-test-pre.js
+++ b/content/canvas/test/webgl-conformance/resources/js-test-pre.js
@@ -111,32 +111,32 @@ function testFailed(msg)
         messages.unshift(stack.pop());
     }
 
     for (message in messages) {
         dump(messages[message] + '\n');
     }
 }
 
-function testFailedRender(msg, ref, test, width, height) 
+function testFailedRender(msg, ref, test, width, height)
 {
     var refData;
     if (typeof ref.getImageData == 'function') {
         refData = ref.canvas.toDataURL();
     } else {
         refData = arrayToURLData(ref, width, height);
     }
 
     var testData;
     if (typeof test.getImageData == 'function') {
         testData = test.canvas.toDataURL();
     } else {
         testData = arrayToURLData(test, width, height);
     }
-    
+
     testFailed(msg);
 
     var data = 'REFTEST TEST-DEBUG-INFO | ' + msg + ' | image comparison (==)\n' +
                'REFTEST   IMAGE 1 (TEST): ' + testData + '\n' +
                'REFTEST   IMAGE 2 (REFERENCE): ' + refData;
     dump('FAIL: ' + data + '\n');
     dump('To view the differences between these image renderings, go to the following link: https://hg.mozilla.org/mozilla-central/raw-file/tip/layout/tools/reftest/reftest-analyzer.xhtml#log=' +
     encodeURIComponent(encodeURIComponent(data)) + '\n');
@@ -467,9 +467,8 @@ function gc() {
     for (var i = 0; i < 1000; i++)
         gcRec(10);
 }
 
 function finishTest() {
     debug('<br /><span class="pass">TEST COMPLETE</span>');
     notifyFinishedToHarness();
 }
-
rename from content/canvas/test/webgl/resources/js-test-style.css
rename to content/canvas/test/webgl-conformance/resources/js-test-style.css
rename from content/canvas/test/webgl/resources/opengl_logo.jpg
rename to content/canvas/test/webgl-conformance/resources/opengl_logo.jpg
rename from content/canvas/test/webgl/resources/thunderbird-logo-64x64.png
rename to content/canvas/test/webgl-conformance/resources/thunderbird-logo-64x64.png
rename from content/canvas/test/webgl/resources/webgl-logo.png
rename to content/canvas/test/webgl-conformance/resources/webgl-logo.png
rename from content/canvas/test/webgl/resources/webgl-test-harness.js
rename to content/canvas/test/webgl-conformance/resources/webgl-test-harness.js
rename from content/canvas/test/webgl/skipped_tests_android.txt
rename to content/canvas/test/webgl-conformance/skipped_tests_android.txt
rename from content/canvas/test/webgl/skipped_tests_android_x86.txt
rename to content/canvas/test/webgl-conformance/skipped_tests_android_x86.txt
rename from content/canvas/test/webgl/skipped_tests_linux.txt
rename to content/canvas/test/webgl-conformance/skipped_tests_linux.txt
rename from content/canvas/test/webgl/skipped_tests_linux_mesa.txt
rename to content/canvas/test/webgl-conformance/skipped_tests_linux_mesa.txt
rename from content/canvas/test/webgl/skipped_tests_win_vista.txt
rename to content/canvas/test/webgl-conformance/skipped_tests_win_vista.txt
rename from content/canvas/test/webgl/skipped_tests_winxp.txt
rename to content/canvas/test/webgl-conformance/skipped_tests_winxp.txt
rename from content/canvas/test/webgl/test_webgl_conformance_test_suite.html
rename to content/canvas/test/webgl-conformance/test_webgl_conformance_test_suite.html
rename from content/canvas/test/webgl/webgl-conformance-tests.html
rename to content/canvas/test/webgl-conformance/webgl-conformance-tests.html
rename from content/canvas/test/webgl/writemanifest.py
rename to content/canvas/test/webgl-conformance/writemanifest.py
rename from content/canvas/test/webgl/non-conf-tests/driver-info.js
rename to content/canvas/test/webgl-mochitest/driver-info.js
rename from content/canvas/test/webgl/non-conf-tests/mochi-to-testcase.py
rename to content/canvas/test/webgl-mochitest/mochi-to-testcase.py
rename from content/canvas/test/webgl/non-conf-tests/mochitest.ini
rename to content/canvas/test/webgl-mochitest/mochitest.ini
new file mode 100644
--- /dev/null
+++ b/content/canvas/test/webgl-mochitest/moz.build
@@ -0,0 +1,9 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+MOCHITEST_MANIFESTS += [
+    'mochitest.ini',
+]
rename from content/canvas/test/webgl/non-conf-tests/test_depth_readpixels.html
rename to content/canvas/test/webgl-mochitest/test_depth_readpixels.html
rename from content/canvas/test/webgl/non-conf-tests/test_fb_param.html
rename to content/canvas/test/webgl-mochitest/test_fb_param.html
rename from content/canvas/test/webgl/non-conf-tests/test_fb_param_crash.html
rename to content/canvas/test/webgl-mochitest/test_fb_param_crash.html
rename from content/canvas/test/webgl/non-conf-tests/test_highp_fs.html
rename to content/canvas/test/webgl-mochitest/test_highp_fs.html
rename from content/canvas/test/webgl/non-conf-tests/test_no_arr_points.html
rename to content/canvas/test/webgl-mochitest/test_no_arr_points.html
rename from content/canvas/test/webgl/non-conf-tests/test_privileged_exts.html
rename to content/canvas/test/webgl-mochitest/test_privileged_exts.html
rename from content/canvas/test/webgl/non-conf-tests/test_webgl2_not_exposed.html
rename to content/canvas/test/webgl-mochitest/test_webgl2_not_exposed.html
rename from content/canvas/test/webgl/non-conf-tests/test_webgl_available.html
rename to content/canvas/test/webgl-mochitest/test_webgl_available.html
rename from content/canvas/test/webgl/non-conf-tests/test_webgl_conformance.html
rename to content/canvas/test/webgl-mochitest/test_webgl_conformance.html
rename from content/canvas/test/webgl/non-conf-tests/test_webgl_request_context.html
rename to content/canvas/test/webgl-mochitest/test_webgl_request_context.html
rename from content/canvas/test/webgl/non-conf-tests/test_webgl_request_mismatch.html
rename to content/canvas/test/webgl-mochitest/test_webgl_request_mismatch.html
rename from content/canvas/test/webgl/non-conf-tests/webgl-util.js
rename to content/canvas/test/webgl-mochitest/webgl-util.js
deleted file mode 100644
--- a/content/canvas/test/webgl/conformance/00_test_list.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-attribs/00_test_list.txt
-buffers/00_test_list.txt
-canvas/00_test_list.txt
-context/00_test_list.txt
-extensions/00_test_list.txt
-glsl/00_test_list.txt
-limits/00_test_list.txt
-misc/00_test_list.txt
-programs/00_test_list.txt
-reading/00_test_list.txt
-renderbuffers/00_test_list.txt
-rendering/00_test_list.txt
-state/00_test_list.txt
-textures/00_test_list.txt
-typedarrays/00_test_list.txt
-uniforms/00_test_list.txt
-
--- a/content/media/MediaDecoder.h
+++ b/content/media/MediaDecoder.h
@@ -1020,17 +1020,17 @@ protected:
    * The following member variables can be accessed from any thread.
    ******/
 
   // The state machine object for handling the decoding. It is safe to
   // call methods of this object from other threads. Its internal data
   // is synchronised on a monitor. The lifetime of this object is
   // after mPlayState is LOADING and before mPlayState is SHUTDOWN. It
   // is safe to access it during this period.
-  nsCOMPtr<MediaDecoderStateMachine> mDecoderStateMachine;
+  nsRefPtr<MediaDecoderStateMachine> mDecoderStateMachine;
 
   // Media data resource.
   nsRefPtr<MediaResource> mResource;
 
   // |ReentrantMonitor| for detecting when the video play state changes. A call
   // to |Wait| on this monitor will block the thread until the next state
   // change.
   // Using a wrapper class to restrict direct access to the |ReentrantMonitor|
--- a/content/media/MediaDecoderStateMachine.cpp
+++ b/content/media/MediaDecoderStateMachine.cpp
@@ -2055,17 +2055,17 @@ public:
     mStateMachine->ReleaseDecoder();
     mDecoder->ReleaseStateMachine();
     mStateMachine = nullptr;
     mDecoder = nullptr;
     return NS_OK;
   }
 private:
   nsRefPtr<MediaDecoder> mDecoder;
-  nsCOMPtr<MediaDecoderStateMachine> mStateMachine;
+  nsRefPtr<MediaDecoderStateMachine> mStateMachine;
 };
 
 // Runnable which dispatches an event to the main thread to dispose of the
 // decoder and state machine. This runs on the state machine thread after
 // the state machine has shutdown, and all events for that state machine have
 // finished running.
 class nsDispatchDisposeEvent : public nsRunnable {
 public:
@@ -2074,17 +2074,17 @@ public:
     : mDecoder(aDecoder), mStateMachine(aStateMachine) {}
   NS_IMETHOD Run() {
     NS_DispatchToMainThread(new nsDecoderDisposeEvent(mDecoder.forget(),
                                                       mStateMachine.forget()));
     return NS_OK;
   }
 private:
   nsRefPtr<MediaDecoder> mDecoder;
-  nsCOMPtr<MediaDecoderStateMachine> mStateMachine;
+  nsRefPtr<MediaDecoderStateMachine> mStateMachine;
 };
 
 nsresult MediaDecoderStateMachine::RunStateMachine()
 {
   AssertCurrentThreadInMonitor();
 
   MediaResource* resource = mDecoder->GetResource();
   NS_ENSURE_TRUE(resource, NS_ERROR_NULL_POINTER);
--- a/content/media/plugins/MediaPluginHost.h
+++ b/content/media/plugins/MediaPluginHost.h
@@ -11,17 +11,17 @@
 #include "MPAPI.h"
 #include "MediaResourceServer.h"
 
 namespace mozilla {
 
 class MediaPluginReader;
 
 class MediaPluginHost {
-  nsCOMPtr<MediaResourceServer> mResourceServer;
+  nsRefPtr<MediaResourceServer> mResourceServer;
   nsTArray<MPAPI::Manifest *> mPlugins;
 
   MPAPI::Manifest *FindPlugin(const nsACString& aMimeType);
 public:
   MediaPluginHost();
   ~MediaPluginHost();
 
   static void Shutdown();
--- a/content/media/plugins/MediaResourceServer.cpp
+++ b/content/media/plugins/MediaResourceServer.cpp
@@ -107,17 +107,17 @@ private:
   // Reading from this reads the data sent from the client.
   nsCOMPtr<nsIInputStream> mInput;
 
   // Writing to this sends data to the client.
   nsCOMPtr<nsIOutputStream> mOutput;
 
   // The MediaResourceServer that owns the MediaResource instances
   // served. This is used to lookup the MediaResource from the URL.
-  nsCOMPtr<MediaResourceServer> mServer;
+  nsRefPtr<MediaResourceServer> mServer;
 
   // Write 'aBufferLength' bytes from 'aBuffer' to 'mOutput'. This
   // method ensures all the data is written by checking the number
   // of bytes returned from the output streams 'Write' method and
   // looping until done.
   nsresult WriteAll(char const* aBuffer, int32_t aBufferLength);
 
 public:
@@ -337,17 +337,17 @@ ServeResourceEvent::Shutdown()
   from the MediaResourceServer that created this listener, using the
   URL the client requested.
 */
 class ResourceSocketListener : public nsIServerSocketListener
 {
 public:
   // The MediaResourceServer used to look up the MediaResource
   // on requests.
-  nsCOMPtr<MediaResourceServer> mServer;
+  nsRefPtr<MediaResourceServer> mServer;
 
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSISERVERSOCKETLISTENER
 
   ResourceSocketListener(MediaResourceServer* aServer) :
     mServer(aServer)
   {
@@ -411,17 +411,17 @@ MediaResourceServer::Run()
 
   return NS_OK;
 }
 
 /* static */
 already_AddRefed<MediaResourceServer>
 MediaResourceServer::Start()
 {
-  nsCOMPtr<MediaResourceServer> server = new MediaResourceServer();
+  nsRefPtr<MediaResourceServer> server = new MediaResourceServer();
   NS_DispatchToMainThread(server, NS_DISPATCH_SYNC);
   return server.forget();
 }
 
 void
 MediaResourceServer::Stop()
 {
   MutexAutoLock lock(mMutex);
--- a/content/media/webaudio/AudioBuffer.cpp
+++ b/content/media/webaudio/AudioBuffer.cpp
@@ -193,22 +193,21 @@ static already_AddRefed<ThreadSharedFloa
 StealJSArrayDataIntoThreadSharedFloatArrayBufferList(JSContext* aJSContext,
                                                      const nsTArray<JSObject*>& aJSArrays)
 {
   nsRefPtr<ThreadSharedFloatArrayBufferList> result =
     new ThreadSharedFloatArrayBufferList(aJSArrays.Length());
   for (uint32_t i = 0; i < aJSArrays.Length(); ++i) {
     JS::Rooted<JSObject*> arrayBuffer(aJSContext,
                                       JS_GetArrayBufferViewBuffer(aJSArrays[i]));
-    void* dataToFree = nullptr;
-    uint8_t* stolenData = nullptr;
-    if (arrayBuffer &&
-        JS_StealArrayBufferContents(aJSContext, arrayBuffer, &dataToFree,
-                                    &stolenData)) {
-      result->SetData(i, dataToFree, reinterpret_cast<float*>(stolenData));
+    uint8_t* stolenData = arrayBuffer
+                          ? (uint8_t*) JS_StealArrayBufferContents(aJSContext, arrayBuffer)
+                          : nullptr;
+    if (stolenData) {
+      result->SetData(i, stolenData, reinterpret_cast<float*>(stolenData));
     } else {
       return nullptr;
     }
   }
   return result.forget();
 }
 
 ThreadSharedFloatArrayBufferList*
--- a/content/media/webaudio/AudioContext.cpp
+++ b/content/media/webaudio/AudioContext.cpp
@@ -455,17 +455,17 @@ AudioContext::DecodeAudioData(const Arra
 {
   // Sniff the content of the media.
   // Failed type sniffing will be handled by AsyncDecodeMedia.
   nsAutoCString contentType;
   NS_SniffContent(NS_DATA_SNIFFER_CATEGORY, nullptr,
                   aBuffer.Data(), aBuffer.Length(),
                   contentType);
 
-  nsCOMPtr<DecodeErrorCallback> failureCallback;
+  nsRefPtr<DecodeErrorCallback> failureCallback;
   if (aFailureCallback.WasPassed()) {
     failureCallback = &aFailureCallback.Value();
   }
   nsRefPtr<WebAudioDecodeJob> job(
     new WebAudioDecodeJob(contentType, this, aBuffer,
                           &aSuccessCallback, failureCallback));
   mDecoder.AsyncDecodeMedia(contentType.get(),
                             aBuffer.Data(), aBuffer.Length(), *job);
--- a/content/xml/document/src/nsXMLContentSink.cpp
+++ b/content/xml/document/src/nsXMLContentSink.cpp
@@ -197,17 +197,17 @@ nsXMLContentSink::MaybePrettyPrint()
   mDocument->RemoveObserver(this);
   mIsDocumentObserver = false;
 
   // Reenable the CSSLoader so that the prettyprinting stylesheets can load
   if (mCSSLoader) {
     mCSSLoader->SetEnabled(true);
   }
   
-  nsCOMPtr<nsXMLPrettyPrinter> printer;
+  nsRefPtr<nsXMLPrettyPrinter> printer;
   nsresult rv = NS_NewXMLPrettyPrinter(getter_AddRefs(printer));
   NS_ENSURE_SUCCESS(rv, rv);
 
   bool isPrettyPrinting;
   rv = printer->PrettyPrint(mDocument, &isPrettyPrinting);
   NS_ENSURE_SUCCESS(rv, rv);
 
   mPrettyPrinting = isPrettyPrinting;
--- a/content/xul/templates/src/nsXULTemplateQueryProcessorRDF.h
+++ b/content/xul/templates/src/nsXULTemplateQueryProcessorRDF.h
@@ -39,17 +39,17 @@ class nsXULTemplateResultRDF;
 
 /**
  * An object that generates results from a query on an RDF graph
  */
 class nsXULTemplateQueryProcessorRDF MOZ_FINAL : public nsIXULTemplateQueryProcessor,
                                                  public nsIRDFObserver
 {
 public:
-    typedef nsTArray<nsCOMPtr<nsXULTemplateResultRDF> > ResultArray;
+    typedef nsTArray<nsRefPtr<nsXULTemplateResultRDF> > ResultArray;
 
     nsXULTemplateQueryProcessorRDF();
 
     ~nsXULTemplateQueryProcessorRDF();
 
     nsresult InitGlobals();
 
     // nsISupports interface
--- a/dom/base/Navigator.h
+++ b/dom/base/Navigator.h
@@ -333,17 +333,17 @@ private:
   nsRefPtr<network::Connection> mConnection;
 #ifdef MOZ_B2G_RIL
   nsRefPtr<MobileConnectionArray> mMobileConnections;
   nsRefPtr<CellBroadcast> mCellBroadcast;
   nsRefPtr<IccManager> mIccManager;
   nsRefPtr<Voicemail> mVoicemail;
 #endif
 #ifdef MOZ_B2G_BT
-  nsCOMPtr<bluetooth::BluetoothManager> mBluetooth;
+  nsRefPtr<bluetooth::BluetoothManager> mBluetooth;
 #endif
 #ifdef MOZ_AUDIO_CHANNEL_MANAGER
   nsRefPtr<system::AudioChannelManager> mAudioChannelManager;
 #endif
   nsRefPtr<nsDOMCameraManager> mCameraManager;
   nsCOMPtr<nsIDOMNavigatorSystemMessages> mMessagesManager;
   nsTArray<nsRefPtr<nsDOMDeviceStorage> > mDeviceStorageStores;
   nsRefPtr<time::TimeManager> mTimeManager;
--- a/dom/base/nsContentPermissionHelper.cpp
+++ b/dom/base/nsContentPermissionHelper.cpp
@@ -37,17 +37,17 @@ class ContentPermissionRequestParent : p
                                  Element* element,
                                  const IPC::Principal& principal);
   virtual ~ContentPermissionRequestParent();
 
   bool IsBeingDestroyed();
 
   nsCOMPtr<nsIPrincipal> mPrincipal;
   nsCOMPtr<Element> mElement;
-  nsCOMPtr<nsContentPermissionRequestProxy> mProxy;
+  nsRefPtr<nsContentPermissionRequestProxy> mProxy;
   nsTArray<PermissionRequest> mRequests;
 
  private:
   virtual bool Recvprompt();
   virtual void ActorDestroy(ActorDestroyReason why);
 };
 
 ContentPermissionRequestParent::ContentPermissionRequestParent(const nsTArray<PermissionRequest>& aRequests,
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -5028,17 +5028,17 @@ float
 nsGlobalWindow::GetDevicePixelRatio(ErrorResult& aError)
 {
   FORWARD_TO_OUTER_OR_THROW(GetDevicePixelRatio, (aError), aError, 0.0);
 
   if (!mDocShell) {
     return 1.0;
   }
 
-  nsCOMPtr<nsPresContext> presContext;
+  nsRefPtr<nsPresContext> presContext;
   mDocShell->GetPresContext(getter_AddRefs(presContext));
   if (!presContext) {
     return 1.0;
   }
 
   return float(nsPresContext::AppUnitsPerCSSPixel())/
       presContext->AppUnitsPerDevPixel();
 }
@@ -7595,26 +7595,29 @@ nsGlobalWindow::CallerInnerWindow()
     if (scopeProto && xpc::IsSandboxPrototypeProxy(scopeProto) &&
         (scopeProto = js::CheckedUnwrap(scopeProto, /* stopAtOuter = */ false)))
     {
       scope = scopeProto;
     }
   }
   JSAutoCompartment ac(cx, scope);
 
-  nsCOMPtr<nsIXPConnectWrappedNative> wrapper;
-  nsContentUtils::XPConnect()->
-    GetWrappedNativeOfJSObject(cx, scope, getter_AddRefs(wrapper));
-  if (!wrapper)
+  // We don't use xpc::WindowOrNull here because we want to be able to tell
+  // apart the cases of "scope is not an nsISupports at all" and "scope is an
+  // nsISupports that's not a window". It's not clear whether that's desirable,
+  // see bug 984467.
+  nsISupports* native =
+    nsContentUtils::XPConnect()->GetNativeOfWrapper(cx, scope);
+  if (!native)
     return nullptr;
 
   // The calling window must be holding a reference, so we can just return a
   // raw pointer here and let the QI's addref be balanced by the nsCOMPtr
   // destructor's release.
-  nsCOMPtr<nsPIDOMWindow> win = do_QueryWrappedNative(wrapper);
+  nsCOMPtr<nsPIDOMWindow> win = do_QueryInterface(native);
   if (!win)
     return GetCurrentInnerWindowInternal();
   return static_cast<nsGlobalWindow*>(win.get());
 }
 
 /**
  * Class used to represent events generated by calls to Window.postMessage,
  * which asynchronously creates and dispatches events.
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -626,34 +626,19 @@ NS_ScriptErrorReporter(JSContext *cx,
             : ""));
   }
 #endif
 }
 
 #ifdef DEBUG
 // A couple of useful functions to call when you're debugging.
 nsGlobalWindow *
-JSObject2Win(JSContext *cx, JSObject *obj)
+JSObject2Win(JSObject *obj)
 {
-  nsIXPConnect *xpc = nsContentUtils::XPConnect();
-  if (!xpc) {
-    return nullptr;
-  }
-
-  nsCOMPtr<nsIXPConnectWrappedNative> wrapper;
-  xpc->GetWrappedNativeOfJSObject(cx, obj, getter_AddRefs(wrapper));
-  if (wrapper) {
-    nsCOMPtr<nsPIDOMWindow> win = do_QueryWrappedNative(wrapper);
-    if (win) {
-      return static_cast<nsGlobalWindow *>
-                        (static_cast<nsPIDOMWindow *>(win));
-    }
-  }
-
-  return nullptr;
+  return xpc::WindowOrNull(obj);
 }
 
 void
 PrintWinURI(nsGlobalWindow *win)
 {
   if (!win) {
     printf("No window passed in.\n");
     return;
@@ -1039,38 +1024,37 @@ nsJSContext::GetGlobalObject()
     // If this assertion hits then it means that we have a window object as
     // our global, but we never called CreateOuterObject.
     NS_ASSERTION(inner == global, "Shouldn't be able to innerize here");
   }
 #endif
 
   const JSClass *c = JS_GetClass(global);
 
-  // Whenever we end up with globals that are JSCLASS_IS_DOMJSCLASS
-  // and have an nsISupports DOM object, we will need to modify this
-  // check here.
-  MOZ_ASSERT(!(c->flags & JSCLASS_IS_DOMJSCLASS));
-  if ((~c->flags) & (JSCLASS_HAS_PRIVATE |
-                     JSCLASS_PRIVATE_IS_NSISUPPORTS)) {
-    return nullptr;
-  }
-  
-  nsISupports *priv = static_cast<nsISupports*>(js::GetObjectPrivate(global));
-
-  nsCOMPtr<nsIXPConnectWrappedNative> wrapped_native =
-    do_QueryInterface(priv);
-
   nsCOMPtr<nsIScriptGlobalObject> sgo;
-  if (wrapped_native) {
-    // The global object is a XPConnect wrapped native, the native in
-    // the wrapper might be the nsIScriptGlobalObject
-
-    sgo = do_QueryWrappedNative(wrapped_native);
+  if (IsDOMClass(c)) {
+    sgo = do_QueryInterface(UnwrapDOMObjectToISupports(global));
   } else {
-    sgo = do_QueryInterface(priv);
+    if ((~c->flags) & (JSCLASS_HAS_PRIVATE |
+                       JSCLASS_PRIVATE_IS_NSISUPPORTS)) {
+      return nullptr;
+    }
+
+    nsISupports *priv = static_cast<nsISupports*>(js::GetObjectPrivate(global));
+
+    nsCOMPtr<nsIXPConnectWrappedNative> wrapped_native =
+      do_QueryInterface(priv);
+    if (wrapped_native) {
+      // The global object is a XPConnect wrapped native, the native in
+      // the wrapper might be the nsIScriptGlobalObject
+
+      sgo = do_QueryWrappedNative(wrapped_native);
+    } else {
+      sgo = do_QueryInterface(priv);
+    }
   }
 
   // This'll return a pointer to something we're about to release, but
   // that's ok, the JS object will hold it alive long enough.
   return sgo;
 }
 
 JSContext*
--- a/dom/base/nsJSUtils.cpp
+++ b/dom/base/nsJSUtils.cpp
@@ -206,17 +206,18 @@ nsJSUtils::EvaluateString(JSContext* aCx
 
   // Scope the JSAutoCompartment so that we can later wrap the return value
   // into the caller's cx.
   {
     JSAutoCompartment ac(aCx, aScopeObject);
 
     JS::Rooted<JSObject*> rootedScope(aCx, aScopeObject);
     if (aOffThreadToken) {
-      JSScript *script = JS::FinishOffThreadScript(aCx, JS_GetRuntime(aCx), *aOffThreadToken);
+      JS::Rooted<JSScript*>
+        script(aCx, JS::FinishOffThreadScript(aCx, JS_GetRuntime(aCx), *aOffThreadToken));
       *aOffThreadToken = nullptr; // Mark the token as having been finished.
       if (script) {
         ok = JS_ExecuteScript(aCx, rootedScope, script, aRetValue);
       } else {
         ok = false;
       }
     } else {
       ok = JS::Evaluate(aCx, rootedScope, aCompileOptions,
--- a/dom/bindings/BindingUtils.cpp
+++ b/dom/bindings/BindingUtils.cpp
@@ -1760,17 +1760,17 @@ ReparentWrapper(JSContext* aCx, JS::Hand
   }
 
   bool preserving = cache->PreservingWrapper();
   cache->SetPreservingWrapper(false);
   cache->SetWrapper(aObj);
   cache->SetPreservingWrapper(preserving);
 
   if (propertyHolder) {
-    JSObject* copyTo;
+    JS::Rooted<JSObject*> copyTo(aCx);
     if (isProxy) {
       copyTo = DOMProxyHandler::EnsureExpandoObject(aCx, aObj);
     } else {
       copyTo = aObj;
     }
 
     if (!copyTo || !JS_CopyPropertiesFrom(aCx, copyTo, propertyHolder)) {
       MOZ_CRASH();
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -2487,17 +2487,16 @@ class CGWrapGlobalMethod(CGAbstractMetho
     Create a wrapper JSObject for a global.  The global must implement
     nsWrapperCache.
 
     properties should be a PropertyArrays instance.
     """
     def __init__(self, descriptor, properties):
         assert descriptor.interface.hasInterfacePrototypeObject()
         args = [Argument('JSContext*', 'aCx'),
-                Argument('JS::Handle<JSObject*>', 'aScope'),
                 Argument(descriptor.nativeType + '*', 'aObject'),
                 Argument('nsWrapperCache*', 'aCache'),
                 Argument('JS::CompartmentOptions&', 'aOptions'),
                 Argument('JSPrincipals*', 'aPrincipal')]
         CGAbstractMethod.__init__(self, descriptor, 'Wrap', 'JSObject*', args)
         self.descriptor = descriptor
         self.properties = properties
 
--- a/dom/camera/DOMCameraControl.cpp
+++ b/dom/camera/DOMCameraControl.cpp
@@ -608,58 +608,58 @@ nsDOMCameraControl::SensorAngle()
   int32_t angle = 0;
   mCameraControl->Get(CAMERA_PARAM_SENSORANGLE, angle);
   return angle;
 }
 
 already_AddRefed<CameraShutterCallback>
 nsDOMCameraControl::GetOnShutter()
 {
-  nsCOMPtr<CameraShutterCallback> cb = mOnShutterCb;
+  nsRefPtr<CameraShutterCallback> cb = mOnShutterCb;
   return cb.forget();
 }
 
 void
 nsDOMCameraControl::SetOnShutter(CameraShutterCallback* aCb)
 {
   mOnShutterCb = aCb;
 }
 
 /* attribute CameraClosedCallback onClosed; */
 already_AddRefed<CameraClosedCallback>
 nsDOMCameraControl::GetOnClosed()
 {
-  nsCOMPtr<CameraClosedCallback> onClosed = mOnClosedCb;
+  nsRefPtr<CameraClosedCallback> onClosed = mOnClosedCb;
   return onClosed.forget();
 }
 
 void
 nsDOMCameraControl::SetOnClosed(CameraClosedCallback* aCb)
 {
   mOnClosedCb = aCb;
 }
 
 already_AddRefed<CameraRecorderStateChange>
 nsDOMCameraControl::GetOnRecorderStateChange()
 {
-  nsCOMPtr<CameraRecorderStateChange> cb = mOnRecorderStateChangeCb;
+  nsRefPtr<CameraRecorderStateChange> cb = mOnRecorderStateChangeCb;
   return cb.forget();
 }
 
 void
 nsDOMCameraControl::SetOnRecorderStateChange(CameraRecorderStateChange* aCb)
 {
   mOnRecorderStateChangeCb = aCb;
 }
 
 /* attribute CameraPreviewStateChange onPreviewStateChange; */
 already_AddRefed<CameraPreviewStateChange>
 nsDOMCameraControl::GetOnPreviewStateChange()
 {
-  nsCOMPtr<CameraPreviewStateChange> cb = mOnPreviewStateChangeCb;
+  nsRefPtr<CameraPreviewStateChange> cb = mOnPreviewStateChangeCb;
   return cb.forget();
 }
 void
 nsDOMCameraControl::SetOnPreviewStateChange(CameraPreviewStateChange* aCb)
 {
   mOnPreviewStateChangeCb = aCb;
 }
 
@@ -778,17 +778,17 @@ nsDOMCameraControl::ResumePreview(ErrorR
 void
 nsDOMCameraControl::SetConfiguration(const CameraConfiguration& aConfiguration,
                                      const Optional<OwningNonNull<CameraSetConfigurationCallback> >& aOnSuccess,
                                      const Optional<OwningNonNull<CameraErrorCallback> >& aOnError,
                                      ErrorResult& aRv)
 {
   MOZ_ASSERT(mCameraControl);
 
-  nsCOMPtr<CameraTakePictureCallback> cb = mTakePictureOnSuccessCb;
+  nsRefPtr<CameraTakePictureCallback> cb = mTakePictureOnSuccessCb;
   if (cb) {
     // We're busy taking a picture, can't change modes right now.
     if (aOnError.WasPassed()) {
       ErrorResult ignored;
       aOnError.Value().Call(NS_LITERAL_STRING("Busy"), ignored);
     }
     aRv = NS_ERROR_FAILURE;
     return;
@@ -817,22 +817,22 @@ nsDOMCameraControl::SetConfiguration(con
 
 void
 nsDOMCameraControl::AutoFocus(CameraAutoFocusCallback& aOnSuccess,
                               const Optional<OwningNonNull<CameraErrorCallback> >& aOnError,
                               ErrorResult& aRv)
 {
   MOZ_ASSERT(mCameraControl);
 
-  nsCOMPtr<CameraAutoFocusCallback> cb = mAutoFocusOnSuccessCb.forget();
+  nsRefPtr<CameraAutoFocusCallback> cb = mAutoFocusOnSuccessCb.forget();
   bool cancel = false;
   if (cb) {
     // we have a callback, which means we're already in the process of
     // auto-focusing--cancel the old callback
-    nsCOMPtr<CameraErrorCallback> ecb = mAutoFocusOnErrorCb.forget();
+    nsRefPtr<CameraErrorCallback> ecb = mAutoFocusOnErrorCb.forget();
     if (ecb) {
       ErrorResult ignored;
       ecb->Call(NS_LITERAL_STRING("Interrupted"), ignored);
     }
     cancel = true;
   }
 
   mAutoFocusOnSuccessCb = &aOnSuccess;
@@ -847,17 +847,17 @@ nsDOMCameraControl::AutoFocus(CameraAuto
 void
 nsDOMCameraControl::TakePicture(const CameraPictureOptions& aOptions,
                                 CameraTakePictureCallback& aOnSuccess,
                                 const Optional<OwningNonNull<CameraErrorCallback> >& aOnError,
                                 ErrorResult& aRv)
 {
   MOZ_ASSERT(mCameraControl);
 
-  nsCOMPtr<CameraTakePictureCallback> cb = mTakePictureOnSuccessCb;
+  nsRefPtr<CameraTakePictureCallback> cb = mTakePictureOnSuccessCb;
   if (cb) {
     // There is already a call to TakePicture() in progress, abort this one and
     //  invoke the error callback (if one was passed in).
     if (aOnError.WasPassed()) {
       ErrorResult ignored;
       aOnError.Value().Call(NS_LITERAL_STRING("TakePictureAlreadyInProgress"), ignored);
     }
     aRv = NS_ERROR_FAILURE;
@@ -966,49 +966,49 @@ nsDOMCameraControl::OnHardwareStateChang
 
   DOM_CAMERA_LOGI("DOM OnHardwareStateChange(%d)\n", aState);
 
   switch (aState) {
     case CameraControlListener::kHardwareOpen:
       // The hardware is open, so we can return a camera to JS, even if
       // the preview hasn't started yet.
       if (mGetCameraOnSuccessCb) {
-        nsCOMPtr<GetCameraCallback> cb = mGetCameraOnSuccessCb.forget();
+        nsRefPtr<GetCameraCallback> cb = mGetCameraOnSuccessCb.forget();
         ErrorResult ignored;
         mGetCameraOnErrorCb = nullptr;
         cb->Call(*this, *mCurrentConfiguration, ignored);
       }
       break;
 
     case CameraControlListener::kHardwareClosed:
       if (mReleaseOnSuccessCb) {
         // If we have this event handler, this was a solicited hardware close.
-        nsCOMPtr<CameraReleaseCallback> cb = mReleaseOnSuccessCb.forget();
+        nsRefPtr<CameraReleaseCallback> cb = mReleaseOnSuccessCb.forget();
         mReleaseOnErrorCb = nullptr;
         cb->Call(ignored);
       } else if(mOnClosedCb) {
         // If not, something else closed the hardware.
-        nsCOMPtr<CameraClosedCallback> cb = mOnClosedCb;
+        nsRefPtr<CameraClosedCallback> cb = mOnClosedCb;
         cb->Call(ignored);
       }
       break;
 
     default:
       MOZ_ASSUME_UNREACHABLE("Unanticipated camera hardware state");
   }
 }
 
 void
 nsDOMCameraControl::OnShutter()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   DOM_CAMERA_LOGI("DOM ** SNAP **\n");
 
-  nsCOMPtr<CameraShutterCallback> cb = mOnShutterCb;
+  nsRefPtr<CameraShutterCallback> cb = mOnShutterCb;
   if (cb) {
     ErrorResult ignored;
     cb->Call(ignored);
   }
 }
 
 void
 nsDOMCameraControl::OnPreviewStateChange(CameraControlListener::PreviewState aState)
@@ -1025,17 +1025,17 @@ nsDOMCameraControl::OnPreviewStateChange
       state = NS_LITERAL_STRING("started");
       break;
 
     default:
       state = NS_LITERAL_STRING("stopped");
       break;
   }
 
-  nsCOMPtr<CameraPreviewStateChange> cb = mOnPreviewStateChangeCb;
+  nsRefPtr<CameraPreviewStateChange> cb = mOnPreviewStateChangeCb;
   ErrorResult ignored;
   cb->Call(state, ignored);
 }
 
 void
 nsDOMCameraControl::OnRecorderStateChange(CameraControlListener::RecorderState aState,
                                           int32_t aArg, int32_t aTrackNum)
 {
@@ -1043,17 +1043,17 @@ nsDOMCameraControl::OnRecorderStateChang
   MOZ_ASSERT(NS_IsMainThread());
 
   ErrorResult ignored;
   nsString state;
 
   switch (aState) {
     case CameraControlListener::kRecorderStarted:
       if (mStartRecordingOnSuccessCb) {
-        nsCOMPtr<CameraStartRecordingCallback> cb = mStartRecordingOnSuccessCb.forget();
+        nsRefPtr<CameraStartRecordingCallback> cb = mStartRecordingOnSuccessCb.forget();
         mStartRecordingOnErrorCb = nullptr;
         cb->Call(ignored);
       }
       state = NS_LITERAL_STRING("Started");
       break;
 
     case CameraControlListener::kRecorderStopped:
       NotifyRecordingStatusChange(NS_LITERAL_STRING("shutdown"));
@@ -1086,17 +1086,17 @@ nsDOMCameraControl::OnRecorderStateChang
       break;
 #endif
 
     default:
       MOZ_ASSUME_UNREACHABLE("Unanticipated video recorder error");
       return;
   }
 
-  nsCOMPtr<CameraRecorderStateChange> cb = mOnRecorderStateChangeCb;
+  nsRefPtr<CameraRecorderStateChange> cb = mOnRecorderStateChangeCb;
   if (cb) {
     cb->Call(state, ignored);
   }
 }
 
 void
 nsDOMCameraControl::OnConfigurationChange(DOMCameraConfiguration* aConfiguration)
 {
@@ -1112,43 +1112,43 @@ nsDOMCameraControl::OnConfigurationChang
     mCurrentConfiguration->mMaxFocusAreas);
   DOM_CAMERA_LOGI("    maximum metering areas : %d\n",
     mCurrentConfiguration->mMaxMeteringAreas);
   DOM_CAMERA_LOGI("    preview size (w x h)   : %d x %d\n",
     mCurrentConfiguration->mPreviewSize.mWidth, mCurrentConfiguration->mPreviewSize.mHeight);
   DOM_CAMERA_LOGI("    recorder profile       : %s\n",
     NS_ConvertUTF16toUTF8(mCurrentConfiguration->mRecorderProfile).get());
 
-  nsCOMPtr<CameraSetConfigurationCallback> cb = mSetConfigurationOnSuccessCb.forget();
+  nsRefPtr<CameraSetConfigurationCallback> cb = mSetConfigurationOnSuccessCb.forget();
   mSetConfigurationOnErrorCb = nullptr;
   if (cb) {
     ErrorResult ignored;
     cb->Call(*mCurrentConfiguration, ignored);
   }
 }
 
 void
 nsDOMCameraControl::OnAutoFocusComplete(bool aAutoFocusSucceeded)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsCOMPtr<CameraAutoFocusCallback> cb = mAutoFocusOnSuccessCb.forget();
+  nsRefPtr<CameraAutoFocusCallback> cb = mAutoFocusOnSuccessCb.forget();
   mAutoFocusOnErrorCb = nullptr;
   if (cb) {
     ErrorResult ignored;
     cb->Call(aAutoFocusSucceeded, ignored);
   }
 }
 
 void
 nsDOMCameraControl::OnTakePictureComplete(nsIDOMBlob* aPicture)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsCOMPtr<CameraTakePictureCallback> cb = mTakePictureOnSuccessCb.forget();
+  nsRefPtr<CameraTakePictureCallback> cb = mTakePictureOnSuccessCb.forget();
   mTakePictureOnErrorCb = nullptr;
   if (!cb) {
     // Warn because it shouldn't be possible to get here without
     // having passed a success callback into takePicture(), even
     // though we guard against a nullptr dereference.
     NS_WARNING("DOM Null success callback in OnTakePictureComplete()");
     return;
   }
@@ -1159,17 +1159,17 @@ nsDOMCameraControl::OnTakePictureComplet
 
 void
 nsDOMCameraControl::OnError(CameraControlListener::CameraErrorContext aContext, const nsAString& aError)
 {
   DOM_CAMERA_LOGI("DOM OnError context=%d, error='%s'\n", aContext,
     NS_LossyConvertUTF16toASCII(aError).get());
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsCOMPtr<CameraErrorCallback>* errorCb;
+  nsRefPtr<CameraErrorCallback>* errorCb;
   switch (aContext) {
     case CameraControlListener::kInStartCamera:
       mGetCameraOnSuccessCb = nullptr;
       errorCb = &mGetCameraOnErrorCb;
       break;
 
     case CameraControlListener::kInStopCamera:
       mReleaseOnSuccessCb = nullptr;
@@ -1235,13 +1235,13 @@ nsDOMCameraControl::OnError(CameraContro
 
   if (!*errorCb) {
     DOM_CAMERA_LOGW("DOM No error handler for error '%s' in context=%d\n",
       NS_LossyConvertUTF16toASCII(aError).get(), aContext);
     return;
   }
 
   // kung-fu death grip
-  nsCOMPtr<CameraErrorCallback> cb = (*errorCb).forget();
+  nsRefPtr<CameraErrorCallback> cb = (*errorCb).forget();
   ErrorResult ignored;
   cb->Call(aError, ignored);
 }
 
--- a/dom/camera/DOMCameraControl.h
+++ b/dom/camera/DOMCameraControl.h
@@ -163,34 +163,34 @@ protected:
 
   nsresult Set(JSContext* aCx, uint32_t aKey, const JS::Value& aValue, uint32_t aLimit);
   nsresult Get(JSContext* aCx, uint32_t aKey, JS::Value* aValue);
 
   nsRefPtr<DOMCameraConfiguration>              mCurrentConfiguration;
   nsRefPtr<dom::CameraCapabilities>             mCapabilities;
 
   // solicited camera control event handlers
-  nsCOMPtr<dom::GetCameraCallback>              mGetCameraOnSuccessCb;
-  nsCOMPtr<dom::CameraErrorCallback>            mGetCameraOnErrorCb;
-  nsCOMPtr<dom::CameraAutoFocusCallback>        mAutoFocusOnSuccessCb;
-  nsCOMPtr<dom::CameraErrorCallback>            mAutoFocusOnErrorCb;
-  nsCOMPtr<dom::CameraTakePictureCallback>      mTakePictureOnSuccessCb;
-  nsCOMPtr<dom::CameraErrorCallback>            mTakePictureOnErrorCb;
-  nsCOMPtr<dom::CameraStartRecordingCallback>   mStartRecordingOnSuccessCb;
-  nsCOMPtr<dom::CameraErrorCallback>            mStartRecordingOnErrorCb;
-  nsCOMPtr<dom::CameraReleaseCallback>          mReleaseOnSuccessCb;
-  nsCOMPtr<dom::CameraErrorCallback>            mReleaseOnErrorCb;
-  nsCOMPtr<dom::CameraSetConfigurationCallback> mSetConfigurationOnSuccessCb;
-  nsCOMPtr<dom::CameraErrorCallback>            mSetConfigurationOnErrorCb;
+  nsRefPtr<dom::GetCameraCallback>              mGetCameraOnSuccessCb;
+  nsRefPtr<dom::CameraErrorCallback>            mGetCameraOnErrorCb;
+  nsRefPtr<dom::CameraAutoFocusCallback>        mAutoFocusOnSuccessCb;
+  nsRefPtr<dom::CameraErrorCallback>            mAutoFocusOnErrorCb;
+  nsRefPtr<dom::CameraTakePictureCallback>      mTakePictureOnSuccessCb;
+  nsRefPtr<dom::CameraErrorCallback>            mTakePictureOnErrorCb;
+  nsRefPtr<dom::CameraStartRecordingCallback>   mStartRecordingOnSuccessCb;
+  nsRefPtr<dom::CameraErrorCallback>            mStartRecordingOnErrorCb;
+  nsRefPtr<dom::CameraReleaseCallback>          mReleaseOnSuccessCb;
+  nsRefPtr<dom::CameraErrorCallback>            mReleaseOnErrorCb;
+  nsRefPtr<dom::CameraSetConfigurationCallback> mSetConfigurationOnSuccessCb;
+  nsRefPtr<dom::CameraErrorCallback>            mSetConfigurationOnErrorCb;
 
   // unsolicited event handlers
-  nsCOMPtr<dom::CameraShutterCallback>          mOnShutterCb;
-  nsCOMPtr<dom::CameraClosedCallback>           mOnClosedCb;
-  nsCOMPtr<dom::CameraRecorderStateChange>      mOnRecorderStateChangeCb;
-  nsCOMPtr<dom::CameraPreviewStateChange>       mOnPreviewStateChangeCb;
+  nsRefPtr<dom::CameraShutterCallback>          mOnShutterCb;
+  nsRefPtr<dom::CameraClosedCallback>           mOnClosedCb;
+  nsRefPtr<dom::CameraRecorderStateChange>      mOnRecorderStateChangeCb;
+  nsRefPtr<dom::CameraPreviewStateChange>       mOnPreviewStateChangeCb;
 
   // Camera event listener; we only need this weak reference so that
   //  we can remove the listener from the camera when we're done
   //  with it.
   DOMCameraControlListener* mListener;
 
   // our viewfinder stream
   CameraPreviewMediaStream* mInput;
--- a/dom/camera/DOMCameraManager.cpp
+++ b/dom/camera/DOMCameraManager.cpp
@@ -114,17 +114,17 @@ nsDOMCameraManager::GetCamera(const nsAS
 {
   DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__);
 
   uint32_t cameraId = 0;  // back (or forward-facing) camera by default
   if (aCamera.EqualsLiteral("front")) {
     cameraId = 1;
   }
 
-  nsCOMPtr<CameraErrorCallback> errorCallback = nullptr;
+  nsRefPtr<CameraErrorCallback> errorCallback = nullptr;
   if (aOnError.WasPassed()) {
     errorCallback = &aOnError.Value();
   }
 
   // Creating this object will trigger the aOnSuccess callback
   //  (or the aOnError one, if it fails).
   nsRefPtr<nsDOMCameraControl> cameraControl =
     new nsDOMCameraControl(cameraId, aInitialConfig, &aOnSuccess, errorCallback, mWindow);
--- a/dom/devicestorage/DeviceStorageRequestChild.cpp
+++ b/dom/devicestorage/DeviceStorageRequestChild.cpp
@@ -185,17 +185,17 @@ DeviceStorageRequestChild::
       uint32_t count = r.paths().Length();
       for (uint32_t i = 0; i < count; i++) {
         nsRefPtr<DeviceStorageFile> dsf
           = new DeviceStorageFile(r.type(), r.paths()[i].storageName(),
                                   r.rootdir(), r.paths()[i].name());
         cursor->mFiles.AppendElement(dsf);
       }
 
-      nsCOMPtr<ContinueCursorEvent> event = new ContinueCursorEvent(cursor);
+      nsRefPtr<ContinueCursorEvent> event = new ContinueCursorEvent(cursor);
       event->Continue();
       break;
     }
 
     default:
     {
       NS_RUNTIMEABORT("not reached");
       break;
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -3324,31 +3324,31 @@ ContentParent::RecvGetGraphicsFeatureSta
 bool
 ContentParent::RecvAddIdleObserver(const uint64_t& aObserver, const uint32_t& aIdleTimeInS)
 {
   nsresult rv;
   nsCOMPtr<nsIIdleService> idleService =
     do_GetService("@mozilla.org/widget/idleservice;1", &rv);
   NS_ENSURE_SUCCESS(rv, false);
 
-  nsCOMPtr<ParentIdleListener> listener = new ParentIdleListener(this, aObserver);
+  nsRefPtr<ParentIdleListener> listener = new ParentIdleListener(this, aObserver);
   mIdleListeners.Put(aObserver, listener);
   idleService->AddIdleObserver(listener, aIdleTimeInS);
   return true;
 }
 
 bool
 ContentParent::RecvRemoveIdleObserver(const uint64_t& aObserver, const uint32_t& aIdleTimeInS)
 {
   nsresult rv;
   nsCOMPtr<nsIIdleService> idleService =
     do_GetService("@mozilla.org/widget/idleservice;1", &rv);
   NS_ENSURE_SUCCESS(rv, false);
 
-  nsCOMPtr<ParentIdleListener> listener;
+  nsRefPtr<ParentIdleListener> listener;
   bool found = mIdleListeners.Get(aObserver, &listener);
   if (found) {
     mIdleListeners.Remove(aObserver);
     idleService->RemoveIdleObserver(listener, aIdleTimeInS);
   }
 
   return true;
 }
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -580,17 +580,17 @@ private:
     bool mCalledCloseWithError;
     bool mCalledKillHard;
 
     friend class CrashReporterParent;
 
     nsRefPtr<nsConsoleService>  mConsoleService;
     nsConsoleService* GetConsoleService();
 
-    nsDataHashtable<nsUint64HashKey, nsCOMPtr<ParentIdleListener> > mIdleListeners;
+    nsDataHashtable<nsUint64HashKey, nsRefPtr<ParentIdleListener> > mIdleListeners;
 
 #ifdef MOZ_X11
     // Dup of child's X socket, used to scope its resources to this
     // object instead of the child process's lifetime.
     ScopedClose mChildXSocketFdDup;
 #endif
 };
 
--- a/dom/plugins/base/nsNPAPIPluginInstance.h
+++ b/dom/plugins/base/nsNPAPIPluginInstance.h
@@ -321,17 +321,17 @@ protected:
 
   NPDrawingModel mDrawingModel;
 
 #ifdef MOZ_WIDGET_ANDROID
   uint32_t mANPDrawingModel;
 
   friend class PluginEventRunnable;
 
-  nsTArray<nsCOMPtr<PluginEventRunnable>> mPostedEvents;
+  nsTArray<nsRefPtr<PluginEventRunnable>> mPostedEvents;
   void PopPostedEvent(PluginEventRunnable* r);
   void OnSurfaceTextureFrameAvailable();
 
   uint32_t mFullScreenOrientation;
   bool mWakeLocked;
   bool mFullScreen;
   bool mInverted;
 
--- a/dom/smil/nsSMILTimeValueSpec.h
+++ b/dom/smil/nsSMILTimeValueSpec.h
@@ -119,12 +119,12 @@ protected:
     }
 
     NS_DECL_ISUPPORTS
     NS_DECL_NSIDOMEVENTLISTENER
 
   private:
     nsSMILTimeValueSpec* mSpec;
   };
-  nsCOMPtr<EventListener> mEventListener;
+  nsRefPtr<EventListener> mEventListener;
 };
 
 #endif // NS_SMILTIMEVALUESPEC_H_
--- a/dom/workers/WorkerScope.cpp
+++ b/dom/workers/WorkerScope.cpp
@@ -294,18 +294,18 @@ DedicatedWorkerGlobalScope::WrapGlobalOb
   MOZ_ASSERT(!mWorkerPrivate->IsSharedWorker());
 
   JS::CompartmentOptions options;
   mWorkerPrivate->CopyJSCompartmentOptions(options);
 
   // We're wrapping the global, so the scope is undefined.
   JS::Rooted<JSObject*> scope(aCx);
 
-  return DedicatedWorkerGlobalScopeBinding_workers::Wrap(aCx, scope, this,
-                                                         this, options,
+  return DedicatedWorkerGlobalScopeBinding_workers::Wrap(aCx, this, this,
+                                                         options,
                                                          GetWorkerPrincipal());
 }
 
 void
 DedicatedWorkerGlobalScope::PostMessage(JSContext* aCx,
                                         JS::Handle<JS::Value> aMessage,
                                         const Optional<Sequence<JS::Value>>& aTransferable,
                                         ErrorResult& aRv)
@@ -335,18 +335,17 @@ SharedWorkerGlobalScope::WrapGlobalObjec
   MOZ_ASSERT(mWorkerPrivate->IsSharedWorker());
 
   JS::CompartmentOptions options;
   mWorkerPrivate->CopyJSCompartmentOptions(options);
 
   // We're wrapping the global, so the scope is undefined.
   JS::Rooted<JSObject*> scope(aCx);
 
-  return SharedWorkerGlobalScopeBinding_workers::Wrap(aCx, scope, this, this,
-                                                      options,
+  return SharedWorkerGlobalScopeBinding_workers::Wrap(aCx, this, this, options,
                                                       GetWorkerPrincipal());
 }
 
 bool
 GetterOnlyJSNative(JSContext* aCx, unsigned aArgc, JS::Value* aVp)
 {
   JS_ReportErrorNumber(aCx, js_GetErrorMessage, nullptr, JSMSG_GETTER_ONLY);
   return false;
--- a/dom/xbl/nsXBLBinding.cpp
+++ b/dom/xbl/nsXBLBinding.cpp
@@ -1180,19 +1180,18 @@ nsXBLBinding::LookupMemberInternal(JSCon
     return true;
   }
 
   MOZ_ASSERT(classObject.isObject());
 
   // Look for the property on this binding. If it's not there, try the next
   // binding on the chain.
   nsXBLProtoImpl* impl = mPrototypeBinding->GetImplementation();
-  if (impl && !impl->LookupMember(aCx, aName, aNameAsId, aDesc,
-                                  &classObject.toObject()))
-  {
+  JS::Rooted<JSObject*> object(aCx, &classObject.toObject());
+  if (impl && !impl->LookupMember(aCx, aName, aNameAsId, aDesc, object)) {
     return false;
   }
   if (aDesc.object() || !mNextBinding) {
     return true;
   }
 
   return mNextBinding->LookupMemberInternal(aCx, aName, aNameAsId, aDesc,
                                             aXBLScope);
--- a/dom/xbl/nsXBLProtoImpl.cpp
+++ b/dom/xbl/nsXBLProtoImpl.cpp
@@ -234,17 +234,17 @@ nsXBLProtoImpl::CompilePrototypeMembers(
 
   return NS_OK;
 }
 
 bool
 nsXBLProtoImpl::LookupMember(JSContext* aCx, nsString& aName,
                              JS::Handle<jsid> aNameAsId,
                              JS::MutableHandle<JSPropertyDescriptor> aDesc,
-                             JSObject* aClassObject)
+                             JS::Handle<JSObject*> aClassObject)
 {
   for (nsXBLProtoImplMember* m = mMembers; m; m = m->GetNext()) {
     if (aName.Equals(m->GetName())) {
       return JS_GetPropertyDescriptorById(aCx, aClassObject, aNameAsId, 0, aDesc);
     }
   }
   return true;
 }
--- a/dom/xbl/nsXBLProtoImpl.h
+++ b/dom/xbl/nsXBLProtoImpl.h
@@ -45,17 +45,17 @@ private:
                              JS::MutableHandle<JSObject*> aTargetClassObject,
                              bool* aTargetIsNew);
 
 public:
   nsresult CompilePrototypeMembers(nsXBLPrototypeBinding* aBinding);
 
   bool LookupMember(JSContext* aCx, nsString& aName, JS::Handle<jsid> aNameAsId,
                     JS::MutableHandle<JSPropertyDescriptor> aDesc,
-                    JSObject* aClassObject);
+                    JS::Handle<JSObject*> aClassObject);
 
   void SetMemberList(nsXBLProtoImplMember* aMemberList)
   {
     delete mMembers;
     mMembers = aMemberList;
   }
 
   void SetFieldList(nsXBLProtoImplField* aFieldList)
--- a/editor/composer/src/nsEditorSpellCheck.cpp
+++ b/editor/composer/src/nsEditorSpellCheck.cpp
@@ -139,17 +139,17 @@ public:
 
   nsCOMPtr<nsIEditorSpellCheckCallback> mCallback;
   uint32_t mGroup;
   nsString mRootContentLang;
   nsString mRootDocContentLang;
   nsString mDictionary;
 
 private:
-  nsCOMPtr<nsEditorSpellCheck> mSpellCheck;
+  nsRefPtr<nsEditorSpellCheck> mSpellCheck;
 };
 NS_IMPL_ISUPPORTS1(DictionaryFetcher, nsIContentPrefCallback2)
 
 NS_IMETHODIMP
 DictionaryFetcher::Fetch(nsIEditor* aEditor)
 {
   NS_ENSURE_ARG_POINTER(aEditor);
 
--- a/embedding/components/find/src/nsFind.h
+++ b/embedding/components/find/src/nsFind.h
@@ -3,16 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsFind_h__
 #define nsFind_h__
 
 #include "nsIFind.h"
 
+#include "nsAutoPtr.h"
 #include "nsCOMPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsIDOMNode.h"
 #include "nsIDOMRange.h"
 #include "nsIContentIterator.h"
 #include "nsIWordBreaker.h"
 
 class nsIAtom;
@@ -64,12 +65,12 @@ protected:
                     bool aContinueOk);
 
   // Reset variables before returning -- don't hold any references.
   void ResetAll();
 
   // The iterator we use to move through the document:
   nsresult InitIterator(nsIDOMNode* aStartNode, int32_t aStartOffset,
                         nsIDOMNode* aEndNode, int32_t aEndOffset);
-  nsCOMPtr<nsFindContentIterator> mIterator;
+  nsRefPtr<nsFindContentIterator> mIterator;
 };
 
 #endif // nsFind_h__
--- a/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp
+++ b/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp
@@ -65,17 +65,17 @@
 #include "nsIDOMHTMLEmbedElement.h"
 #include "nsIDOMHTMLObjectElement.h"
 #include "nsIDOMHTMLAppletElement.h"
 #include "nsIDOMHTMLOptionElement.h"
 #include "nsIDOMHTMLTextAreaElement.h"
 #include "nsIDOMHTMLDocument.h"
 #include "nsIDOMHTMLSourceElement.h"
 #include "nsIDOMHTMLMediaElement.h"
- 
+
 #include "nsIImageLoadingContent.h"
 
 #include "ftpCore.h"
 #include "nsITransport.h"
 #include "nsISocketTransport.h"
 #include "nsIStringBundle.h"
 #include "nsIProtocolHandler.h"
 
@@ -173,17 +173,17 @@ struct CleanupData
 
 // Maximum file length constant. The max file name length is
 // volume / server dependent but it is difficult to obtain
 // that information. Instead this constant is a reasonable value that
 // modern systems should able to cope with.
 const uint32_t kDefaultMaxFilenameLength = 64;
 
 // Default flags for persistence
-const uint32_t kDefaultPersistFlags = 
+const uint32_t kDefaultPersistFlags =
     nsIWebBrowserPersist::PERSIST_FLAGS_NO_CONVERSION |
     nsIWebBrowserPersist::PERSIST_FLAGS_REPLACE_EXISTING_FILES;
 
 // String bundle where error messages come from
 const char *kWebBrowserPersistStringBundle =
     "chrome://global/locale/nsWebBrowserPersist.properties";
 
 nsWebBrowserPersist::nsWebBrowserPersist() :
@@ -239,18 +239,18 @@ NS_IMETHODIMP nsWebBrowserPersist::GetIn
 
     *aIFace = nullptr;
 
     nsresult rv = QueryInterface(aIID, aIFace);
     if (NS_SUCCEEDED(rv))
     {
         return rv;
     }
-    
-    if (mProgressListener && (aIID.Equals(NS_GET_IID(nsIAuthPrompt)) 
+
+    if (mProgressListener && (aIID.Equals(NS_GET_IID(nsIAuthPrompt))
                              || aIID.Equals(NS_GET_IID(nsIPrompt))))
     {
         mProgressListener->QueryInterface(aIID, aIFace);
         if (*aIFace)
             return NS_OK;
     }
 
     nsCOMPtr<nsIInterfaceRequestor> req = do_QueryInterface(mProgressListener);
@@ -434,17 +434,17 @@ NS_IMETHODIMP nsWebBrowserPersist::SaveD
     if (aEncodingFlags & ENCODE_FLAGS_CR_LINEBREAKS)
         mEncodingFlags |= nsIDocumentEncoder::OutputCRLineBreak;
     if (aEncodingFlags & ENCODE_FLAGS_LF_LINEBREAKS)
         mEncodingFlags |= nsIDocumentEncoder::OutputLFLineBreak;
     if (aEncodingFlags & ENCODE_FLAGS_NOSCRIPT_CONTENT)
         mEncodingFlags |= nsIDocumentEncoder::OutputNoScriptContent;
     if (aEncodingFlags & ENCODE_FLAGS_NOFRAMES_CONTENT)
         mEncodingFlags |= nsIDocumentEncoder::OutputNoFramesContent;
-    
+
     if (aOutputContentType)
     {
         mContentType.AssignASCII(aOutputContentType);
     }
 
     rv = SaveDocumentInternal(aDocument, fileAsURI, datapathAsURI);
 
     // Now save the URIs that have been gathered
@@ -481,17 +481,17 @@ NS_IMETHODIMP nsWebBrowserPersist::Cance
 /* void cancelSave(); */
 NS_IMETHODIMP nsWebBrowserPersist::CancelSave()
 {
     return Cancel(NS_BINDING_ABORTED);
 }
 
 
 nsresult
-nsWebBrowserPersist::StartUpload(nsIStorageStream *storStream, 
+nsWebBrowserPersist::StartUpload(nsIStorageStream *storStream,
     nsIURI *aDestinationURI, const nsACString &aContentType)
 {
      // setup the upload channel if the destination is not local
     nsCOMPtr<nsIInputStream> inputstream;
     nsresult rv = storStream->NewInputStream(0, getter_AddRefs(inputstream));
     NS_ENSURE_TRUE(inputstream, NS_ERROR_FAILURE);
     NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
     return StartUpload(inputstream, aDestinationURI, aContentType);
@@ -510,18 +510,17 @@ nsWebBrowserPersist::StartUpload(nsIInpu
     // NOTE: ALL data must be available in "inputstream"
     nsresult rv = uploadChannel->SetUploadStream(aInputStream, aContentType, -1);
     NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
     rv = destChannel->AsyncOpen(this, nullptr);
     NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
 
     // add this to the upload list
     nsCOMPtr<nsISupports> keyPtr = do_QueryInterface(destChannel);
-    nsISupportsKey key(keyPtr);
-    mUploadList.Put(&key, new UploadData(aDestinationURI));
+    mUploadList.Put(keyPtr, new UploadData(aDestinationURI));
 
     return NS_OK;
 }
 
 nsresult
 nsWebBrowserPersist::SaveGatheredURIs(nsIURI *aFileAsURI)
 {
     nsresult rv = NS_OK;
@@ -591,17 +590,17 @@ nsWebBrowserPersist::SerializeNextFile()
     }
 
     nsresult rv = SaveGatheredURIs(nullptr);
     if (NS_FAILED(rv))
     {
         return false;
     }
 
-    return (mURIMap.Count() 
+    return (mURIMap.Count()
         || mUploadList.Count()
         || mDocList.Length()
         || mOutputMap.Count());
 }
 
 
 //*****************************************************************************
 // nsWebBrowserPersist::nsIRequestObserver
@@ -622,35 +621,34 @@ NS_IMETHODIMP nsWebBrowserPersist::OnSta
     }
 
     mJustStartedLoading = false;
 
     nsCOMPtr<nsIChannel> channel = do_QueryInterface(request);
     NS_ENSURE_TRUE(channel, NS_ERROR_FAILURE);
 
     nsCOMPtr<nsISupports> keyPtr = do_QueryInterface(request);
-    nsISupportsKey key(keyPtr);
-    OutputData *data = (OutputData *) mOutputMap.Get(&key);
+    OutputData *data = mOutputMap.Get(keyPtr);
 
     // NOTE: This code uses the channel as a hash key so it will not
     //       recognize redirected channels because the key is not the same.
     //       When that happens we remove and add the data entry to use the
     //       new channel as the hash key.
     if (!data)
     {
-        UploadData *upData = (UploadData *) mUploadList.Get(&key);
+        UploadData *upData = mUploadList.Get(keyPtr);
         if (!upData)
         {
             // Redirect? Try and fixup the output table
             nsresult rv = FixRedirectedChannelEntry(channel);
             NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
 
             // Should be able to find the data after fixup unless redirects
             // are disabled.
-            data = (OutputData *) mOutputMap.Get(&key);
+            data = mOutputMap.Get(keyPtr);
             if (!data)
             {
                 return NS_ERROR_FAILURE;
             }
         }
     }
 
     if (data && data->mFile)
@@ -674,51 +672,47 @@ NS_IMETHODIMP nsWebBrowserPersist::OnSta
         }
 
         // compare uris and bail before we add to output map if they are equal
         bool isEqual = false;
         if (NS_SUCCEEDED(data->mFile->Equals(data->mOriginalLocation, &isEqual))
             && isEqual)
         {
             // remove from output map
-            delete data;
-            mOutputMap.Remove(&key);
+            mOutputMap.Remove(keyPtr);
 
             // cancel; we don't need to know any more
             // stop request will get called
             request->Cancel(NS_BINDING_ABORTED);
         }
     }
 
     return NS_OK;
 }
- 
+
 NS_IMETHODIMP nsWebBrowserPersist::OnStopRequest(
     nsIRequest* request, nsISupports *ctxt, nsresult status)
 {
     nsCOMPtr<nsISupports> keyPtr = do_QueryInterface(request);
-    nsISupportsKey key(keyPtr);
-    OutputData *data = (OutputData *) mOutputMap.Get(&key);
+    OutputData *data = mOutputMap.Get(keyPtr);
     if (data)
     {
         if (NS_SUCCEEDED(mPersistResult) && NS_FAILED(status))
             SendErrorStatusChange(true, status, request, data->mFile);
 
-        // This will close automatically close the output stream
-        delete data;
-        mOutputMap.Remove(&key);
+        // This will automatically close the output stream
+        mOutputMap.Remove(keyPtr);
     }
     else
     {
         // if we didn't find the data in mOutputMap, try mUploadList
-        UploadData *upData = (UploadData *) mUploadList.Get(&key);
+        UploadData *upData = mUploadList.Get(keyPtr);
         if (upData)
         {
-            delete upData;
-            mUploadList.Remove(&key);
+            mUploadList.Remove(keyPtr);
         }
     }
 
     // ensure we call SaveDocuments if we:
     // 1) aren't canceling
     // 2) we haven't triggered the save (which we only want to trigger once)
     // 3) we aren't serializing (which will call it inside SerializeNextFile)
     if (mOutputMap.Count() == 0 && !mCancel && !mStartSaving && !mSerializingOutput)
@@ -779,18 +773,17 @@ nsWebBrowserPersist::OnDataAvailable(
     {
         nsresult rv = NS_OK;
         uint32_t bytesRemaining = aLength;
 
         nsCOMPtr<nsIChannel> channel = do_QueryInterface(request);
         NS_ENSURE_TRUE(channel, NS_ERROR_FAILURE);
 
         nsCOMPtr<nsISupports> keyPtr = do_QueryInterface(request);
-        nsISupportsKey key(keyPtr);
-        OutputData *data = (OutputData *) mOutputMap.Get(&key);
+        OutputData *data = mOutputMap.Get(keyPtr);
         if (!data) {
             // might be uploadData; consume necko's buffer and bail...
             uint32_t n;
             return aIStream->ReadSegments(NS_DiscardSegment, nullptr, aLength, &n);
         }
 
         bool readError = true;
 
@@ -854,17 +847,17 @@ nsWebBrowserPersist::OnDataAvailable(
             }
         }
 
         int64_t channelContentLength = -1;
         if (!cancel &&
             NS_SUCCEEDED(channel->GetContentLength(&channelContentLength)))
         {
             // if we get -1 at this point, we didn't get content-length header
-            // assume that we got all of the data and push what we have; 
+            // assume that we got all of the data and push what we have;
             // that's the best we can do now
             if ((-1 == channelContentLength) ||
                 ((channelContentLength - (aOffset + aLength)) == 0))
             {
                 NS_WARN_IF_FALSE(channelContentLength != -1,
                     "nsWebBrowserPersist::OnDataAvailable() no content length "
                     "header, pushing what we have");
                 // we're done with this pass; see if we need to do upload
@@ -916,26 +909,25 @@ NS_IMETHODIMP nsWebBrowserPersist::OnPro
 {
     if (!mProgressListener)
     {
         return NS_OK;
     }
 
     // Store the progress of this request
     nsCOMPtr<nsISupports> keyPtr = do_QueryInterface(request);
-    nsISupportsKey key(keyPtr);
-    OutputData *data = (OutputData *) mOutputMap.Get(&key);
+    OutputData *data = mOutputMap.Get(keyPtr);
     if (data)
     {
         data->mSelfProgress = int64_t(aProgress);
         data->mSelfProgressMax = int64_t(aProgressMax);
     }
     else
     {
-        UploadData *upData = (UploadData *) mUploadList.Get(&key);
+        UploadData *upData = mUploadList.Get(keyPtr);
         if (upData)
         {
             upData->mSelfProgress = int64_t(aProgress);
             upData->mSelfProgressMax = int64_t(aProgressMax);
         }
     }
 
     // Notify listener of total progress
@@ -1007,17 +999,17 @@ NS_IMETHODIMP nsWebBrowserPersist::OnSta
 
 
 //*****************************************************************************
 // nsWebBrowserPersist private methods
 //*****************************************************************************
 
 // Convert error info into proper message text and send OnStatusChange notification
 // to the web progress listener.
-nsresult nsWebBrowserPersist::SendErrorStatusChange( 
+nsresult nsWebBrowserPersist::SendErrorStatusChange(
     bool aIsReadError, nsresult aResult, nsIRequest *aRequest, nsIURI *aURI)
 {
     NS_ENSURE_ARG_POINTER(aURI);
 
     if (!mProgressListener)
     {
         // Do nothing
         return NS_OK;
@@ -1032,17 +1024,17 @@ nsresult nsWebBrowserPersist::SendErrorS
         file->GetPath(path);
     }
     else
     {
         nsAutoCString fileurl;
         aURI->GetSpec(fileurl);
         AppendUTF8toUTF16(fileurl, path);
     }
-    
+
     nsAutoString msgId;
     switch(aResult)
     {
     case NS_ERROR_FILE_NAME_TOO_LONG:
         // File name too long.
         msgId.AssignLiteral("fileNameTooLongError");
         break;
     case NS_ERROR_FILE_ALREADY_EXISTS:
@@ -1076,33 +1068,33 @@ nsresult nsWebBrowserPersist::SendErrorS
     // Get properties file bundle and extract status string.
     nsresult rv;
     nsCOMPtr<nsIStringBundleService> s = do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
     NS_ENSURE_TRUE(NS_SUCCEEDED(rv) && s, NS_ERROR_FAILURE);
 
     nsCOMPtr<nsIStringBundle> bundle;
     rv = s->CreateBundle(kWebBrowserPersistStringBundle, getter_AddRefs(bundle));
     NS_ENSURE_TRUE(NS_SUCCEEDED(rv) && bundle, NS_ERROR_FAILURE);
-    
+
     nsXPIDLString msgText;
     const char16_t *strings[1];
     strings[0] = path.get();
     rv = bundle->FormatStringFromName(msgId.get(), strings, 1, getter_Copies(msgText));
     NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
 
     mProgressListener->OnStatusChange(nullptr, aRequest, aResult, msgText);
 
     return NS_OK;
 }
 
 nsresult nsWebBrowserPersist::GetValidURIFromObject(nsISupports *aObject, nsIURI **aURI) const
 {
     NS_ENSURE_ARG_POINTER(aObject);
     NS_ENSURE_ARG_POINTER(aURI);
-    
+
     nsCOMPtr<nsIFile> objAsFile = do_QueryInterface(aObject);
     if (objAsFile)
     {
         return NS_NewFileURI(aURI, objAsFile);
     }
     nsCOMPtr<nsIURI> objAsURI = do_QueryInterface(aObject);
     if (objAsURI)
     {
@@ -1156,17 +1148,17 @@ nsresult nsWebBrowserPersist::SaveURIInt
     nsIURI *aURI, nsISupports *aCacheKey, nsIURI *aReferrer,
     nsIInputStream *aPostData, const char *aExtraHeaders,
     nsIURI *aFile, bool aCalcFileExt, bool aIsPrivate)
 {
     NS_ENSURE_ARG_POINTER(aURI);
     NS_ENSURE_ARG_POINTER(aFile);
 
     nsresult rv = NS_OK;
-    
+
     mURI = aURI;
 
     nsLoadFlags loadFlags = nsIRequest::LOAD_NORMAL;
     if (mPersistFlags & PERSIST_FLAGS_BYPASS_CACHE)
     {
         loadFlags |= nsIRequest::LOAD_BYPASS_CACHE;
     }
     else if (mPersistFlags & PERSIST_FLAGS_FROM_CACHE)
@@ -1210,34 +1202,34 @@ nsresult nsWebBrowserPersist::SaveURIInt
             nullptr, nullptr, static_cast<nsIInterfaceRequestor *>(this),
             loadFlags);
 
     nsCOMPtr<nsIPrivateBrowsingChannel> pbChannel = do_QueryInterface(inputChannel);
     if (pbChannel)
     {
         pbChannel->SetPrivate(aIsPrivate);
     }
-    
+
     if (NS_FAILED(rv) || inputChannel == nullptr)
     {
         EndDownload(NS_ERROR_FAILURE);
         return NS_ERROR_FAILURE;
     }
-    
+
     // Disable content conversion
     if (mPersistFlags & PERSIST_FLAGS_NO_CONVERSION)
     {
         nsCOMPtr<nsIEncodedChannel> encodedChannel(do_QueryInterface(inputChannel));
         if (encodedChannel)
         {
             encodedChannel->SetApplyConversion(false);
         }
     }
 
-    if (mPersistFlags & PERSIST_FLAGS_FORCE_ALLOW_COOKIES) 
+    if (mPersistFlags & PERSIST_FLAGS_FORCE_ALLOW_COOKIES)
     {
         nsCOMPtr<nsIHttpChannelInternal> httpChannelInternal =
                 do_QueryInterface(inputChannel);
         if (httpChannelInternal)
             httpChannelInternal->SetForceAllowThirdPartyCookie(true);
     }
 
     // Set the referrer, post data and headers if any
@@ -1353,18 +1345,17 @@ nsresult nsWebBrowserPersist::SaveChanne
             EndDownload(NS_ERROR_FAILURE);
             return NS_ERROR_FAILURE;
         }
         return NS_SUCCESS_DONT_FIXUP;
     }
 
     // Add the output transport to the output map with the channel as the key
     nsCOMPtr<nsISupports> keyPtr = do_QueryInterface(aChannel);
-    nsISupportsKey key(keyPtr);
-    mOutputMap.Put(&key, new OutputData(aFile, mURI, aCalcFileExt));
+    mOutputMap.Put(keyPtr, new OutputData(aFile, mURI, aCalcFileExt));
 
     return NS_OK;
 }
 
 nsresult
 nsWebBrowserPersist::GetExtensionForContentType(const char16_t *aContentType, char16_t **aExt)
 {
     NS_ENSURE_ARG_POINTER(aContentType);
@@ -1462,17 +1453,17 @@ nsWebBrowserPersist::GetDocEncoderConten
         }
     }
 
     // Use the default if no encoder exists for the desired one
     if (!*aRealContentType)
     {
         *aRealContentType = ToNewUnicode(defaultContentType);
     }
-    
+
     NS_ENSURE_TRUE(*aRealContentType, NS_ERROR_OUT_OF_MEMORY);
 
     return NS_OK;
 }
 
 nsresult nsWebBrowserPersist::SaveDocumentInternal(
     nsIDOMDocument *aDocument, nsIURI *aFile, nsIURI *aDataPath)
 {
@@ -1597,17 +1588,17 @@ nsresult nsWebBrowserPersist::SaveDocume
         docData->mFile = aFile;
         docData->mRelativePathToData = mCurrentRelativePathToData;
         docData->mDataPath = mCurrentDataPath;
         docData->mDataPathIsRelative = mCurrentDataPathIsRelative;
         mDocList.AppendElement(docData);
 
         // Walk the DOM gathering a list of externally referenced URIs in the uri map
         nsCOMPtr<nsIDOMTreeWalker> walker;
-        rv = aDocument->CreateTreeWalker(docAsNode, 
+        rv = aDocument->CreateTreeWalker(docAsNode,
             nsIDOMNodeFilter::SHOW_ELEMENT |
                 nsIDOMNodeFilter::SHOW_DOCUMENT |
                 nsIDOMNodeFilter::SHOW_PROCESSING_INSTRUCTION,
             nullptr, 1, getter_AddRefs(walker));
         NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
 
         nsCOMPtr<nsIDOMNode> currentNode;
         walker->GetCurrentNode(getter_AddRefs(currentNode));
@@ -1712,17 +1703,17 @@ nsresult nsWebBrowserPersist::SaveDocume
             rv = NS_ERROR_FAILURE;
             break;
         }
 
         mCurrentBaseURI = docData->mBaseURI;
         mCurrentCharset = docData->mCharset;
 
         // Save the document, fixing it up with the new URIs as we do
-        
+
         nsEncoderNodeFixup *nodeFixup;
         nodeFixup = new nsEncoderNodeFixup;
         if (nodeFixup)
             nodeFixup->mWebBrowserPersist = this;
 
         // Get the content type
         nsXPIDLString realContentType;
         GetDocEncoderContentType(docData->mDocument,
@@ -1769,20 +1760,20 @@ nsresult nsWebBrowserPersist::SaveDocume
 
     return rv;
 }
 
 void nsWebBrowserPersist::Cleanup()
 {
     mURIMap.Enumerate(EnumCleanupURIMap, this);
     mURIMap.Reset();
-    mOutputMap.Enumerate(EnumCleanupOutputMap, this);
-    mOutputMap.Reset();
-    mUploadList.Enumerate(EnumCleanupUploadList, this);
-    mUploadList.Reset();
+    mOutputMap.EnumerateRead(EnumCleanupOutputMap, this);
+    mOutputMap.Clear();
+    mUploadList.EnumerateRead(EnumCleanupUploadList, this);
+    mUploadList.Clear();
     uint32_t i;
     for (i = 0; i < mDocList.Length(); i++)
     {
         DocData *docData = mDocList.ElementAt(i);
         delete docData;
     }
     mDocList.Clear();
     for (i = 0; i < mCleanupList.Length(); i++)
@@ -1847,17 +1838,17 @@ void nsWebBrowserPersist::CleanupLocalFi
                     dirStack.AppendObject(pos);
 
                 while (isEmptyDirectory && (stackSize = dirStack.Count()))
                 {
                     // Pop the last element
                     nsCOMPtr<nsISimpleEnumerator> curPos;
                     curPos = dirStack[stackSize-1];
                     dirStack.RemoveObjectAt(stackSize - 1);
-                    
+
                     // Test if the enumerator has any more files in it
                     bool hasMoreElements = false;
                     curPos->HasMoreElements(&hasMoreElements);
                     if (!hasMoreElements)
                     {
                         continue;
                     }
 
@@ -1869,17 +1860,17 @@ void nsWebBrowserPersist::CleanupLocalFi
                     if (!child)
                         continue;
                     nsCOMPtr<nsIFile> childAsFile = do_QueryInterface(child);
                     NS_ASSERTION(childAsFile, "This should be a file but isn't");
 
                     bool childIsSymlink = false;
                     childAsFile->IsSymlink(&childIsSymlink);
                     bool childIsDir = false;
-                    childAsFile->IsDirectory(&childIsDir);                           
+                    childAsFile->IsDirectory(&childIsDir);
                     if (!childIsDir || childIsSymlink)
                     {
                         // Some kind of file or symlink which means dir
                         // is not empty so just drop out.
                         isEmptyDirectory = false;
                         break;
                     }
                     // Push parent enumerator followed by child enumerator
@@ -1999,17 +1990,17 @@ nsWebBrowserPersist::CalculateUniqueFile
                 }
                 tmpBase.Append(tmp);
                 PR_smprintf_free(tmp);
             }
             else
             {
                 tmpBase = base;
             }
-        
+
             tmpPath.Assign(directory);
             tmpPath.Append(tmpBase);
             tmpPath.Append(ext);
 
             // Test if the name is a duplicate
             if (!mFilenameList.Contains(tmpPath))
             {
                 if (!base.Equals(tmpBase))
@@ -2107,25 +2098,25 @@ nsWebBrowserPersist::MakeFilenameFromURI
                         // the middle, inserting ellipsis and so on.
                         break;
                     }
                 }
             }
         }
     }
 
-    // Empty filenames can confuse the local file object later 
+    // Empty filenames can confuse the local file object later
     // when it attempts to set the leaf name in CalculateUniqueFilename
     // for duplicates and ends up replacing the parent dir. To avoid
     // the problem, all filenames are made at least one character long.
     if (fileName.IsEmpty())
     {
         fileName.Append(char16_t('a')); // 'a' is for arbitrary
     }
- 
+
 end:
     aFilename = fileName;
     return NS_OK;
 }
 
 
 nsresult
 nsWebBrowserPersist::CalculateAndAppendFileExt(nsIURI *aURI, nsIChannel *aChannel, nsIURI *aOriginalURIWithExtension)
@@ -2190,17 +2181,17 @@ nsWebBrowserPersist::CalculateAndAppendF
                 {
                     mimeInfo->ExtensionExists(fileExt, &useOldExt);
                 }
 
                 // can't use old extension so use primary extension
                 if (!useOldExt)
                 {
                     mimeInfo->GetPrimaryExtension(fileExt);
-                } 
+                }
 
                 if (!fileExt.IsEmpty())
                 {
                     uint32_t newLength = newFileName.Length() + fileExt.Length() + 1;
                     if (newLength > kDefaultMaxFilenameLength)
                     {
                         if (fileExt.Length() > kDefaultMaxFilenameLength/2)
                             fileExt.Truncate(kDefaultMaxFilenameLength/2);
@@ -2259,17 +2250,17 @@ nsWebBrowserPersist::MakeOutputStreamFro
 
     nsCOMPtr<nsIFileOutputStream> fileOutputStream =
         do_CreateInstance(NS_LOCALFILEOUTPUTSTREAM_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
 
     // XXX brade:  get the right flags here!
     int32_t ioFlags = -1;
     if (mPersistFlags & nsIWebBrowserPersist::PERSIST_FLAGS_APPEND_TO_FILE)
-      ioFlags = PR_APPEND | PR_CREATE_FILE | PR_WRONLY; 
+      ioFlags = PR_APPEND | PR_CREATE_FILE | PR_WRONLY;
     rv = fileOutputStream->Init(aFile, ioFlags, -1, 0);
     NS_ENSURE_SUCCESS(rv, rv);
 
     *aOutputStream = NS_BufferOutputStream(fileOutputStream,
                                            BUFFERED_OUTPUT_SIZE).take();
 
     if (mPersistFlags & PERSIST_FLAGS_CLEANUP_ON_FAILURE)
     {
@@ -2291,17 +2282,17 @@ nsresult
 nsWebBrowserPersist::MakeOutputStreamFromURI(
     nsIURI *aURI, nsIOutputStream  **aOutputStream)
 {
     uint32_t segsize = 8192;
     uint32_t maxsize = uint32_t(-1);
     nsCOMPtr<nsIStorageStream> storStream;
     nsresult rv = NS_NewStorageStream(segsize, maxsize, getter_AddRefs(storStream));
     NS_ENSURE_SUCCESS(rv, rv);
-    
+
     NS_ENSURE_SUCCESS(CallQueryInterface(storStream, aOutputStream), NS_ERROR_FAILURE);
     return NS_OK;
 }
 
 void
 nsWebBrowserPersist::EndDownload(nsresult aResult)
 {
     // Store the error code in the result if it is an error
@@ -2316,154 +2307,131 @@ nsWebBrowserPersist::EndDownload(nsresul
         CleanupLocalFiles();
     }
 
     // Cleanup the channels
     mCompleted = true;
     Cleanup();
 }
 
-/* Hack class to get access to nsISupportsKey's protected mKey member */
-class nsMyISupportsKey : public nsISupportsKey
-{
-public:
-    nsMyISupportsKey(nsISupports *key) : nsISupportsKey(key)
-    {
-    }
-
-    nsresult GetISupports(nsISupports **ret)
-    {
-        *ret = mKey;
-        NS_IF_ADDREF(mKey);
-        return NS_OK;
-    }
-};
-
 struct MOZ_STACK_CLASS FixRedirectData
 {
     nsCOMPtr<nsIChannel> mNewChannel;
     nsCOMPtr<nsIURI> mOriginalURI;
-    nsISupportsKey *mMatchingKey;
+    nsCOMPtr<nsISupports> mMatchingKey;
 };
 
 nsresult
 nsWebBrowserPersist::FixRedirectedChannelEntry(nsIChannel *aNewChannel)
 {
     NS_ENSURE_ARG_POINTER(aNewChannel);
     nsCOMPtr<nsIURI> originalURI;
 
     // Enumerate through existing open channels looking for one with
     // a URI matching the one specified.
 
     FixRedirectData data;
-    data.mMatchingKey = nullptr;
     data.mNewChannel = aNewChannel;
     data.mNewChannel->GetOriginalURI(getter_AddRefs(data.mOriginalURI));
-    mOutputMap.Enumerate(EnumFixRedirect, (void *) &data);
+    mOutputMap.EnumerateRead(EnumFixRedirect, &data);
 
     // If a match is found, remove the data entry with the old channel key
     // and re-add it with the new channel key.
 
     if (data.mMatchingKey)
     {
-        OutputData *outputData = (OutputData *) mOutputMap.Get(data.mMatchingKey);
+        nsAutoPtr<OutputData> outputData;
+        mOutputMap.RemoveAndForget(data.mMatchingKey, outputData);
         NS_ENSURE_TRUE(outputData, NS_ERROR_FAILURE);
-        mOutputMap.Remove(data.mMatchingKey);
 
         // Store data again with new channel unless told to ignore redirects
         if (!(mPersistFlags & PERSIST_FLAGS_IGNORE_REDIRECTED_DATA))
         {
             nsCOMPtr<nsISupports> keyPtr = do_QueryInterface(aNewChannel);
-            nsISupportsKey key(keyPtr);
-            mOutputMap.Put(&key, outputData);
+            mOutputMap.Put(keyPtr, outputData.forget());
         }
     }
 
     return NS_OK;
 }
 
-bool
-nsWebBrowserPersist::EnumFixRedirect(nsHashKey *aKey, void *aData, void* closure)
+PLDHashOperator
+nsWebBrowserPersist::EnumFixRedirect(nsISupports *aKey, OutputData *aData, void* aClosure)
 {
-    FixRedirectData *data = (FixRedirectData *) closure;
-
-    nsCOMPtr<nsISupports> keyPtr;
-    ((nsMyISupportsKey *) aKey)->GetISupports(getter_AddRefs(keyPtr));
-
-    nsCOMPtr<nsIChannel> thisChannel = do_QueryInterface(keyPtr);
+    FixRedirectData *data = static_cast<FixRedirectData *>(aClosure);
+
+    nsCOMPtr<nsIChannel> thisChannel = do_QueryInterface(aKey);
     nsCOMPtr<nsIURI> thisURI;
 
     thisChannel->GetOriginalURI(getter_AddRefs(thisURI));
 
     // Compare this channel's URI to the one passed in.
     bool matchingURI = false;
     thisURI->Equals(data->mOriginalURI, &matchingURI);
     if (matchingURI)
     {
-        data->mMatchingKey = (nsISupportsKey *) aKey;
-        return false; // Stop enumerating
+        data->mMatchingKey = aKey;
+        return PL_DHASH_STOP;
     }
 
-    return true;
+    return PL_DHASH_NEXT;
 }
 
 void
 nsWebBrowserPersist::CalcTotalProgress()
 {
     mTotalCurrentProgress = 0;
     mTotalMaxProgress = 0;
 
     if (mOutputMap.Count() > 0)
     {
         // Total up the progress of each output stream
-        mOutputMap.Enumerate(EnumCalcProgress, this);
+        mOutputMap.EnumerateRead(EnumCalcProgress, this);
     }
 
     if (mUploadList.Count() > 0)
     {
         // Total up the progress of each upload
-        mUploadList.Enumerate(EnumCalcUploadProgress, this);
+        mUploadList.EnumerateRead(EnumCalcUploadProgress, this);
     }
 
     // XXX this code seems pretty bogus and pointless
     if (mTotalCurrentProgress == 0 && mTotalMaxProgress == 0)
     {
         // No output streams so we must be complete
         mTotalCurrentProgress = 10000;
         mTotalMaxProgress = 10000;
     }
 }
 
-bool
-nsWebBrowserPersist::EnumCalcProgress(nsHashKey *aKey, void *aData, void* closure)
+PLDHashOperator
+nsWebBrowserPersist::EnumCalcProgress(nsISupports *aKey, OutputData *aData, void* aClosure)
 {
-    nsWebBrowserPersist *pthis = (nsWebBrowserPersist *) closure;
-    OutputData *data = (OutputData *) aData;
+    nsWebBrowserPersist *pthis = static_cast<nsWebBrowserPersist *>(aClosure);
 
     // only count toward total progress if destination file is local
-    nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(data->mFile);
+    nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(aData->mFile);
     if (fileURL)
     {
-        pthis->mTotalCurrentProgress += data->mSelfProgress;
-        pthis->mTotalMaxProgress += data->mSelfProgressMax;
+        pthis->mTotalCurrentProgress += aData->mSelfProgress;
+        pthis->mTotalMaxProgress += aData->mSelfProgressMax;
     }
-    return true;
+    return PL_DHASH_NEXT;
 }
 
-bool
-nsWebBrowserPersist::EnumCalcUploadProgress(nsHashKey *aKey, void *aData, void* closure)
+PLDHashOperator
+nsWebBrowserPersist::EnumCalcUploadProgress(nsISupports *aKey, UploadData *aData, void* aClosure)
 {
-    if (aData && closure)
+    if (aData && aClosure)
     {
-        nsWebBrowserPersist *pthis = (nsWebBrowserPersist *) closure;
-        UploadData *data = (UploadData *) aData;
-        pthis->mTotalCurrentProgress += data->mSelfProgress;
-        pthis->mTotalMaxProgress += data->mSelfProgressMax;
+        nsWebBrowserPersist *pthis = static_cast<nsWebBrowserPersist *>(aClosure);
+        pthis->mTotalCurrentProgress += aData->mSelfProgress;
+        pthis->mTotalMaxProgress += aData->mSelfProgressMax;
     }
-    return true;
+    return PL_DHASH_NEXT;
 }
 
 bool
 nsWebBrowserPersist::EnumCountURIsToPersist(nsHashKey *aKey, void *aData, void* closure)
 {
     URIData *data = (URIData *) aData;
     uint32_t *count = (uint32_t *) closure;
     if (data->mNeedsPersisting && !data->mSaved)
@@ -2482,17 +2450,17 @@ nsWebBrowserPersist::EnumPersistURIs(nsH
         return true;
     }
 
     nsWebBrowserPersist *pthis = (nsWebBrowserPersist *) closure;
     nsresult rv;
 
     // Create a URI from the key
     nsCOMPtr<nsIURI> uri;
-    rv = NS_NewURI(getter_AddRefs(uri), 
+    rv = NS_NewURI(getter_AddRefs(uri),
                    nsDependentCString(((nsCStringKey *) aKey)->GetString(),
                                       ((nsCStringKey *) aKey)->GetStringLength()),
                    data->mCharset.get());
     NS_ENSURE_SUCCESS(rv, false);
 
     // Make a URI to save the data to
     nsCOMPtr<nsIURI> fileAsURI;
     rv = data->mDataPath->Clone(getter_AddRefs(fileAsURI));
@@ -2520,54 +2488,46 @@ nsWebBrowserPersist::EnumPersistURIs(nsH
     }
 
     if (pthis->mSerializingOutput)
         return false;
 
     return true;
 }
 
-bool
-nsWebBrowserPersist::EnumCleanupOutputMap(nsHashKey *aKey, void *aData, void* closure)
+PLDHashOperator
+nsWebBrowserPersist::EnumCleanupOutputMap(nsISupports *aKey, OutputData *aData, void* aClosure)
 {
-    nsCOMPtr<nsISupports> keyPtr;
-    ((nsMyISupportsKey *) aKey)->GetISupports(getter_AddRefs(keyPtr));
-    nsCOMPtr<nsIChannel> channel = do_QueryInterface(keyPtr);
+    nsCOMPtr<nsIChannel> channel = do_QueryInterface(aKey);
     if (channel)
     {
         channel->Cancel(NS_BINDING_ABORTED);
     }
-    OutputData *data = (OutputData *) aData;
-    delete data;
-    return true;
+    return PL_DHASH_NEXT;
 }
 
 
 bool
 nsWebBrowserPersist::EnumCleanupURIMap(nsHashKey *aKey, void *aData, void* closure)
 {
     URIData *data = (URIData *) aData;
     delete data; // Delete data associated with key
     return true;
 }
 
 
-bool
-nsWebBrowserPersist::EnumCleanupUploadList(nsHashKey *aKey, void *aData, void* closure)
+PLDHashOperator
+nsWebBrowserPersist::EnumCleanupUploadList(nsISupports *aKey, UploadData *aData, void* aClosure)
 {
-    nsCOMPtr<nsISupports> keyPtr;
-    ((nsMyISupportsKey *) aKey)->GetISupports(getter_AddRefs(keyPtr));
-    nsCOMPtr<nsIChannel> channel = do_QueryInterface(keyPtr);
+    nsCOMPtr<nsIChannel> channel = do_QueryInterface(aKey);
     if (channel)
     {
         channel->Cancel(NS_BINDING_ABORTED);
     }
-    UploadData *data = (UploadData *) aData;
-    delete data; // Delete data associated with key
-    return true;
+    return PL_DHASH_NEXT;
 }
 
 nsresult nsWebBrowserPersist::FixupXMLStyleSheetLink(nsIDOMProcessingInstruction *aPI, const nsAString &aHref)
 {
     NS_ENSURE_ARG_POINTER(aPI);
     nsresult rv = NS_OK;
 
     nsAutoString data;
@@ -2735,17 +2695,17 @@ nsresult nsWebBrowserPersist::OnWalkDOMN
     }
 
     nsCOMPtr<nsIDOMHTMLEmbedElement> nodeAsEmbed = do_QueryInterface(aNode);
     if (nodeAsEmbed)
     {
         StoreURIAttribute(aNode, "src");
         return NS_OK;
     }
-    
+
     nsCOMPtr<nsIDOMHTMLObjectElement> nodeAsObject = do_QueryInterface(aNode);
     if (nodeAsObject)
     {
         StoreURIAttribute(aNode, "data");
         return NS_OK;
     }
 
     nsCOMPtr<nsIDOMHTMLAppletElement> nodeAsApplet = do_QueryInterface(aNode);
@@ -2771,17 +2731,17 @@ nsresult nsWebBrowserPersist::OnWalkDOMN
         // otherwise we assume the archive file(s) contains it (bug 430283).
         if (!archiveURIData)
             StoreURIAttribute(aNode, "code");
 
         // restore the base URI we really want to have
         mCurrentBaseURI = oldBase;
         return NS_OK;
     }
-    
+
     nsCOMPtr<nsIDOMHTMLLinkElement> nodeAsLink = do_QueryInterface(aNode);
     if (nodeAsLink)
     {
         // Test if the link has a rel value indicating it to be a stylesheet
         nsAutoString linkRel;
         if (NS_SUCCEEDED(nodeAsLink->GetRel(linkRel)) && !linkRel.IsEmpty())
         {
             nsReadingIterator<char16_t> start;
@@ -3105,17 +3065,17 @@ nsWebBrowserPersist::CloneNodeWithFixedU
     {
         rv = GetNodeToFixup(aNodeIn, aNodeOut);
         if (NS_SUCCEEDED(rv) && *aNodeOut)
         {
             FixupNodeAttribute(*aNodeOut, "src");
         }
         return rv;
     }
-    
+
     nsCOMPtr<nsIDOMHTMLObjectElement> nodeAsObject = do_QueryInterface(aNodeIn);
     if (nodeAsObject)
     {
         rv = GetNodeToFixup(aNodeIn, aNodeOut);
         if (NS_SUCCEEDED(rv) && *aNodeOut)
         {
             FixupNodeAttribute(*aNodeOut, "data");
         }
@@ -3149,17 +3109,17 @@ nsWebBrowserPersist::CloneNodeWithFixedU
               RemoveAttribute(NS_LITERAL_STRING("codebase"));
             FixupNodeAttribute(*aNodeOut, "code");
             FixupNodeAttribute(*aNodeOut, "archive");
             // restore the base URI we really want to have
             mCurrentBaseURI = oldBase;
         }
         return rv;
     }
-    
+
     nsCOMPtr<nsIDOMHTMLLinkElement> nodeAsLink = do_QueryInterface(aNodeIn);
     if (nodeAsLink)
     {
         rv = GetNodeToFixup(aNodeIn, aNodeOut);
         if (NS_SUCCEEDED(rv) && *aNodeOut)
         {
             // First see if the link represents linked content
             rv = FixupNodeAttribute(*aNodeOut, "href");
@@ -3254,28 +3214,28 @@ nsWebBrowserPersist::CloneNodeWithFixedU
         rv = GetNodeToFixup(aNodeIn, aNodeOut);
         if (NS_SUCCEEDED(rv) && *aNodeOut)
         {
             // Tell the document encoder to serialize the text child we create below
             *aSerializeCloneKids = true;
 
             nsAutoString valueStr;
             nodeAsTextArea->GetValue(valueStr);
-            
+
             (*aNodeOut)->SetTextContent(valueStr);
         }
         return rv;
     }
 
     nsCOMPtr<nsIDOMHTMLOptionElement> nodeAsOption = do_QueryInterface(aNodeIn);
     if (nodeAsOption)
     {
         rv = GetNodeToFixup(aNodeIn, aNodeOut);
         if (NS_SUCCEEDED(rv) && *aNodeOut)
-        {          
+        {
             nsCOMPtr<nsIDOMHTMLOptionElement> outElt = do_QueryInterface(*aNodeOut);
             bool selected;
             nodeAsOption->GetSelected(&selected);
             outElt->SetDefaultSelected(selected);
         }
         return rv;
     }
 
@@ -3371,17 +3331,17 @@ nsWebBrowserPersist::StoreURIAttributeNS
     return NS_OK;
 }
 
 nsresult
 nsWebBrowserPersist::FixupURI(nsAString &aURI)
 {
     // get the current location of the file (absolutized)
     nsCOMPtr<nsIURI> uri;
-    nsresult rv = NS_NewURI(getter_AddRefs(uri), aURI, 
+    nsresult rv = NS_NewURI(getter_AddRefs(uri), aURI,
                             mCurrentCharset.get(), mCurrentBaseURI);
     NS_ENSURE_SUCCESS(rv, rv);
     nsAutoCString spec;
     rv = uri->GetSpec(spec);
     NS_ENSURE_SUCCESS(rv, rv);
 
     // Search for the URI in the map and replace it with the local file
     nsCStringKey key(spec.get());
@@ -3392,39 +3352,39 @@ nsWebBrowserPersist::FixupURI(nsAString 
     URIData *data = (URIData *) mURIMap.Get(&key);
     if (!data->mNeedsFixup)
     {
         return NS_OK;
     }
     nsCOMPtr<nsIURI> fileAsURI;
     if (data->mFile)
     {
-        rv = data->mFile->Clone(getter_AddRefs(fileAsURI)); 
+        rv = data->mFile->Clone(getter_AddRefs(fileAsURI));
         NS_ENSURE_SUCCESS(rv, rv);
     }
     else
     {
         rv = data->mDataPath->Clone(getter_AddRefs(fileAsURI));
         NS_ENSURE_SUCCESS(rv, rv);
         rv = AppendPathToURI(fileAsURI, data->mFilename);
         NS_ENSURE_SUCCESS(rv, rv);
     }
     nsAutoString newValue;
 
     // remove username/password if present
     fileAsURI->SetUserPass(EmptyCString());
 
-    // reset node attribute 
+    // reset node attribute
     // Use relative or absolute links
     if (data->mDataPathIsRelative)
     {
         nsCOMPtr<nsIURL> url(do_QueryInterface(fileAsURI));
         if (!url)
           return NS_ERROR_FAILURE;
-          
+
         nsAutoCString filename;
         url->GetFileName(filename);
 
         nsAutoCString rawPathURL(data->mRelativePathToData);
         rawPathURL.Append(filename);
 
         nsAutoCString buf;
         AppendUTF8toUTF16(NS_EscapeURL(rawPathURL, esc_FilePath, buf),
@@ -3522,17 +3482,17 @@ nsWebBrowserPersist::FixupAnchor(nsIDOMN
             return NS_OK;
         }
 
         nsCOMPtr<nsIURI> relativeURI;
         relativeURI = (mPersistFlags & PERSIST_FLAGS_FIXUP_LINKS_TO_DESTINATION)
                       ? mTargetBaseURI : mCurrentBaseURI;
         // Make a new URI to replace the current one
         nsCOMPtr<nsIURI> newURI;
-        rv = NS_NewURI(getter_AddRefs(newURI), oldCValue, 
+        rv = NS_NewURI(getter_AddRefs(newURI), oldCValue,
                        mCurrentCharset.get(), relativeURI);
         if (NS_SUCCEEDED(rv) && newURI)
         {
             newURI->SetUserPass(EmptyCString());
             nsAutoCString uriSpec;
             newURI->GetSpec(uriSpec);
             attr->SetValue(NS_ConvertUTF8toUTF16(uriSpec));
         }
@@ -3671,54 +3631,54 @@ nsWebBrowserPersist::CreateChannelFromUR
 
     rv = ioserv->NewChannelFromURI(aURI, aChannel);
     NS_ENSURE_SUCCESS(rv, rv);
     NS_ENSURE_ARG_POINTER(*aChannel);
 
     rv = (*aChannel)->SetNotificationCallbacks(static_cast<nsIInterfaceRequestor *>(this));
     NS_ENSURE_SUCCESS(rv, rv);
     return NS_OK;
-} 
+}
 
 nsresult
 nsWebBrowserPersist::SaveDocumentWithFixup(
     nsIDOMDocument *aDocument, nsIDocumentEncoderNodeFixup *aNodeFixup,
     nsIURI *aFile, bool aReplaceExisting, const nsACString &aFormatType,
     const nsCString &aSaveCharset, uint32_t aFlags)
 {
     NS_ENSURE_ARG_POINTER(aFile);
-    
+
     nsresult  rv = NS_OK;
     nsCOMPtr<nsIFile> localFile;
     GetLocalFileFromURI(aFile, getter_AddRefs(localFile));
     if (localFile)
     {
         // if we're not replacing an existing file but the file
         // exists, something is wrong
         bool fileExists = false;
         rv = localFile->Exists(&fileExists);
         NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
 
         if (!aReplaceExisting && fileExists)
             return NS_ERROR_FAILURE;                // where are the file I/O errors?
     }
-    
+
     nsCOMPtr<nsIOutputStream> outputStream;
     rv = MakeOutputStream(aFile, getter_AddRefs(outputStream));
     if (NS_FAILED(rv))
     {
         SendErrorStatusChange(false, rv, nullptr, aFile);
         return NS_ERROR_FAILURE;
     }
     NS_ENSURE_TRUE(outputStream, NS_ERROR_FAILURE);
 
     // Get a document encoder instance
     nsAutoCString contractID(NS_DOC_ENCODER_CONTRACTID_BASE);
     contractID.Append(aFormatType);
-    
+
     nsCOMPtr<nsIDocumentEncoder> encoder = do_CreateInstance(contractID.get(), &rv);
     NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
 
     NS_ConvertASCIItoUTF16 newContentType(aFormatType);
     rv = encoder->Init(aDocument, newContentType, aFlags);
     NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
 
     mTargetBaseURI = aFile;
@@ -3737,17 +3697,17 @@ nsWebBrowserPersist::SaveDocumentWithFix
         charsetStr = doc->GetDocumentCharacterSet();
     }
 
     rv = encoder->SetCharset(charsetStr);
     NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
 
     rv = encoder->EncodeToStream(outputStream);
     NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
-    
+
     if (!localFile)
     {
         nsCOMPtr<nsIStorageStream> storStream(do_QueryInterface(outputStream));
         if (storStream)
         {
             outputStream->Close();
             rv = StartUpload(storStream, aFile, aFormatType);
             NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
@@ -3929,17 +3889,17 @@ nsWebBrowserPersist::SetDocumentBase(
     NS_NAMED_LITERAL_STRING(kXHTMLNS, "http://www.w3.org/1999/xhtml");
     NS_NAMED_LITERAL_STRING(kHead, "head");
 
     // Find the head element
     nsCOMPtr<nsIDOMElement> headElement;
     nsCOMPtr<nsIDOMNodeList> headList;
     if (xmlDoc)
     {
-        // First see if there is XHTML content that needs base 
+        // First see if there is XHTML content that needs base
         // tags.
         if (!NeedXHTMLBaseTag(aDocument))
             return NS_OK;
 
         aDocument->GetElementsByTagNameNS(
             kXHTMLNS,
             kHead, getter_AddRefs(headList));
     }
@@ -4104,17 +4064,17 @@ NS_INTERFACE_MAP_END
 NS_IMETHODIMP nsEncoderNodeFixup::FixupNode(
     nsIDOMNode *aNode, bool *aSerializeCloneKids, nsIDOMNode **aOutNode)
 {
     NS_ENSURE_ARG_POINTER(aNode);
     NS_ENSURE_ARG_POINTER(aOutNode);
     NS_ENSURE_TRUE(mWebBrowserPersist, NS_ERROR_FAILURE);
 
     *aOutNode = nullptr;
-    
+
     // Test whether we need to fixup the node
     uint16_t type = 0;
     aNode->GetNodeType(&type);
     if (type == nsIDOMNode::ELEMENT_NODE ||
         type == nsIDOMNode::PROCESSING_INSTRUCTION_NODE)
     {
         return mWebBrowserPersist->CloneNodeWithFixedUpAttributes(aNode, aSerializeCloneKids, aOutNode);
     }
--- a/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.h
+++ b/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.h
@@ -18,50 +18,54 @@
 #include "nsIChannel.h"
 #include "nsIStyleSheet.h"
 #include "nsIDocumentEncoder.h"
 #include "nsITransport.h"
 #include "nsIProgressEventSink.h"
 #include "nsIFile.h"
 #include "nsIWebProgressListener2.h"
 
+#include "nsClassHashtable.h"
 #include "nsHashtable.h"
+#include "nsHashKeys.h"
 #include "nsTArray.h"
 
 #include "nsCWebBrowserPersist.h"
 
 class nsEncoderNodeFixup;
 class nsIStorageStream;
 
-struct URIData;
 struct CleanupData;
 struct DocData;
+struct OutputData;
+struct UploadData;
+struct URIData;
 
 class nsWebBrowserPersist : public nsIInterfaceRequestor,
                             public nsIWebBrowserPersist,
                             public nsIStreamListener,
                             public nsIProgressEventSink,
                             public nsSupportsWeakReference
 {
     friend class nsEncoderNodeFixup;
 
 // Public members
 public:
     nsWebBrowserPersist();
-    
+
     NS_DECL_ISUPPORTS
     NS_DECL_NSIINTERFACEREQUESTOR
     NS_DECL_NSICANCELABLE
     NS_DECL_NSIWEBBROWSERPERSIST
     NS_DECL_NSIREQUESTOBSERVER
     NS_DECL_NSISTREAMLISTENER
     NS_DECL_NSIPROGRESSEVENTSINK
 
 // Protected members
-protected:    
+protected:
     virtual ~nsWebBrowserPersist();
     nsresult CloneNodeWithFixedUpAttributes(
         nsIDOMNode *aNodeIn, bool *aSerializeCloneKids, nsIDOMNode **aNodeOut);
     nsresult SaveURIInternal(
         nsIURI *aURI, nsISupports *aCacheKey, nsIURI *aReferrer,
         nsIInputStream *aPostData, const char *aExtraHeaders, nsIURI *aFile,
         bool aCalcFileExt, bool aIsPrivate);
     nsresult SaveChannelInternal(
@@ -153,26 +157,28 @@ private:
 
     void SetApplyConversionIfNeeded(nsIChannel *aChannel);
 
     // Hash table enumerators
     static bool EnumPersistURIs(
         nsHashKey *aKey, void *aData, void* closure);
     static bool EnumCleanupURIMap(
         nsHashKey *aKey, void *aData, void* closure);
-    static bool EnumCleanupOutputMap(
-        nsHashKey *aKey, void *aData, void* closure);
+    static PLDHashOperator EnumCleanupOutputMap(
+        nsISupports *aKey, OutputData *aData, void* aClosure);
     static bool EnumCleanupUploadList(
         nsHashKey *aKey, void *aData, void* closure);
-    static bool EnumCalcProgress(
-        nsHashKey *aKey, void *aData, void* closure);
-    static bool EnumCalcUploadProgress(
-        nsHashKey *aKey, void *aData, void* closure);
-    static bool EnumFixRedirect(
-        nsHashKey *aKey, void *aData, void* closure);
+    static PLDHashOperator EnumCleanupUploadList(
+        nsISupports *aKey, UploadData *aData, void* aClosure);
+    static PLDHashOperator EnumCalcProgress(
+        nsISupports *aKey, OutputData *aData, void* aClosure);
+    static PLDHashOperator EnumCalcUploadProgress(
+        nsISupports *aKey, UploadData *aData, void* aClosure);
+    static PLDHashOperator EnumFixRedirect(
+        nsISupports *aKey, OutputData *aData, void* aClosure);
     static bool EnumCountURIsToPersist(
         nsHashKey *aKey, void *aData, void* closure);
 
     nsCOMPtr<nsIURI>          mCurrentDataPath;
     bool                      mCurrentDataPathIsRelative;
     nsCString                 mCurrentRelativePathToData;
     nsCOMPtr<nsIURI>          mCurrentBaseURI;
     nsCString                 mCurrentCharset;
@@ -184,18 +190,18 @@ private:
     nsCOMPtr<nsIWebProgressListener> mProgressListener;
     /**
      * Progress listener for 64-bit values; this is the same object as
      * mProgressListener, but is a member to avoid having to qi it for each
      * progress notification.
      */
     nsCOMPtr<nsIWebProgressListener2> mProgressListener2;
     nsCOMPtr<nsIProgressEventSink> mEventSink;
-    nsHashtable               mOutputMap;
-    nsHashtable               mUploadList;
+    nsClassHashtable<nsISupportsHashKey, OutputData> mOutputMap;
+    nsClassHashtable<nsISupportsHashKey, UploadData> mUploadList;
     nsHashtable               mURIMap;
     nsTArray<DocData*>        mDocList;
     nsTArray<CleanupData*>    mCleanupList;
     nsTArray<nsCString>       mFilenameList;
     bool                      mFirstAndOnlyUse;
     bool                      mCancel;
     bool                      mJustStartedLoading;
     bool                      mCompleted;
@@ -212,19 +218,19 @@ private:
     nsString                  mContentType;
 };
 
 // Helper class does node fixup during persistence
 class nsEncoderNodeFixup : public nsIDocumentEncoderNodeFixup
 {
 public:
     nsEncoderNodeFixup();
-    
+
     NS_DECL_ISUPPORTS
     NS_IMETHOD FixupNode(nsIDOMNode *aNode, bool *aSerializeCloneKids, nsIDOMNode **aOutNode);
-    
+
     nsWebBrowserPersist *mWebBrowserPersist;
 
-protected:    
+protected:
     virtual ~nsEncoderNodeFixup();
 };
 
 #endif
--- a/extensions/auth/nsAuthFactory.cpp
+++ b/extensions/auth/nsAuthFactory.cpp
@@ -1,14 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/ModuleUtils.h"
 #include "nsAuth.h"
+#include "nsAutoPtr.h"
 
 //-----------------------------------------------------------------------------
 
 #define NS_HTTPNEGOTIATEAUTH_CID                   \
 { /* 75c80fd0-accb-432c-af59-ec60668c3990 */       \
   0x75c80fd0,                                      \
   0xaccb,                                          \
   0x432c,                                          \
@@ -107,17 +108,17 @@ nsKerbSSPIAuthConstructor(nsISupports *o
 
 #include "nsAuthSambaNTLM.h"
 static nsresult
 nsSambaNTLMAuthConstructor(nsISupports *outer, REFNSIID iid, void **result)
 {
   if (outer)
     return NS_ERROR_NO_AGGREGATION;
 
-  nsCOMPtr<nsAuthSambaNTLM> auth = new nsAuthSambaNTLM();
+  nsRefPtr<nsAuthSambaNTLM> auth = new nsAuthSambaNTLM();
   if (!auth)
     return NS_ERROR_OUT_OF_MEMORY;
 
   nsresult rv = auth->SpawnNTLMAuthHelper();
   if (NS_FAILED(rv)) {
     // Failure here probably means that cached credentials were not available
     return rv;
   }
--- a/extensions/spellcheck/src/mozInlineSpellChecker.h
+++ b/extensions/spellcheck/src/mozInlineSpellChecker.h
@@ -166,17 +166,17 @@ private:
 
   // This number is incremented each time the spell checker is disabled so that
   // pending scheduled spell checks and UpdateCurrentDictionary calls can be
   // ignored when they finish.
   uint32_t mDisabledAsyncToken;
 
   // When mPendingSpellCheck is non-null, this is the callback passed when
   // it was initialized.
-  nsCOMPtr<InitEditorSpellCheckCallback> mPendingInitEditorSpellCheckCallback;
+  nsRefPtr<InitEditorSpellCheckCallback> mPendingInitEditorSpellCheckCallback;
 
   // Set when we have spellchecked after the last edit operation. See the
   // commment at the top of the .cpp file for more info.
   bool mNeedsCheckAfterNavigation;
 
   // Set when we have a pending mozInlineSpellResume which will check
   // the whole document.
   bool mFullSpellCheckScheduled;
--- a/gfx/gl/SharedSurfaceGralloc.cpp
+++ b/gfx/gl/SharedSurfaceGralloc.cpp
@@ -69,16 +69,17 @@ SharedSurface_Gralloc::Create(GLContext*
 
     gfxImageFormat format
       = gfxPlatform::GetPlatform()->OptimalFormatForContent(type);
 
     RefPtr<GrallocTextureClientOGL> grallocTC =
       new GrallocTextureClientOGL(
           allocator,
           gfx::ImageFormatToSurfaceFormat(format),
+          gfx::BackendType::NONE, // we don't need to use it with a DrawTarget
           TEXTURE_FLAGS_DEFAULT);
 
     if (!grallocTC->AllocateForGLRendering(size)) {
       return nullptr;
     }
 
     sp<GraphicBuffer> buffer = grallocTC->GetGraphicBuffer();
 
--- a/gfx/layers/GrallocImages.cpp
+++ b/gfx/layers/GrallocImages.cpp
@@ -410,16 +410,16 @@ GrallocImage::GetTextureClient(Composita
       return nullptr;
     }
     const SurfaceDescriptorGralloc& desc = sd.get_SurfaceDescriptorGralloc();
     TextureFlags flags = desc.external() ? TEXTURE_DEALLOCATE_CLIENT : 0;
     if (desc.isRBSwapped()) {
       flags |= TEXTURE_RB_SWAPPED;
     }
     GrallocBufferActor* actor = static_cast<GrallocBufferActor*>(desc.bufferChild());
-    mTextureClient = new GrallocTextureClientOGL(actor, mSize, flags);
+    mTextureClient = new GrallocTextureClientOGL(actor, mSize, gfx::BackendType::NONE, flags);
     mTextureClient->SetGraphicBufferLocked(mGraphicBufferLocked);
   }
   return mTextureClient;
 }
 
 } // namespace layers
 } // namespace mozilla
--- a/gfx/layers/ImageContainer.cpp
+++ b/gfx/layers/ImageContainer.cpp
@@ -666,18 +666,20 @@ CairoImage::GetTextureClient(Compositabl
   RefPtr<TextureClient> textureClient = mTextureClients.Get(forwarder->GetSerial());
   if (textureClient) {
     return textureClient;
   }
 
   RefPtr<SourceSurface> surface = GetAsSourceSurface();
   MOZ_ASSERT(surface);
 
+  // gfx::BackendType::NONE means default to content backend
   textureClient = aClient->CreateTextureClientForDrawing(surface->GetFormat(),
                                                          TEXTURE_FLAGS_DEFAULT,
+                                                         gfx::BackendType::NONE,
                                                          surface->GetSize());
   MOZ_ASSERT(textureClient->AsTextureClientDrawTarget());
   if (!textureClient->AsTextureClientDrawTarget()->AllocateForSurface(surface->GetSize()) ||
       !textureClient->Lock(OPEN_WRITE_ONLY)) {
     return nullptr;
   }
 
   {
--- a/gfx/layers/ImageDataSerializer.cpp
+++ b/gfx/layers/ImageDataSerializer.cpp
@@ -135,23 +135,22 @@ ImageDataSerializerBase::GetAsThebesSurf
   IntSize size = GetSize();
   return new gfxImageSurface(GetData(),
                              gfxIntSize(size.width, size.height),
                              GetStride(),
                              SurfaceFormatToImageFormat(GetFormat()));
 }
 
 TemporaryRef<DrawTarget>
-ImageDataSerializerBase::GetAsDrawTarget()
+ImageDataSerializerBase::GetAsDrawTarget(gfx::BackendType aBackend)
 {
   MOZ_ASSERT(IsValid());
-  return gfxPlatform::GetPlatform()->CreateDrawTargetForData(GetData(),
-                                                             GetSize(),
-                                                             GetStride(),
-                                                             GetFormat());
+  return gfx::Factory::CreateDrawTargetForData(aBackend,
+                                               GetData(), GetSize(),
+                                               GetStride(), GetFormat());
 }
 
 TemporaryRef<gfx::DataSourceSurface>
 ImageDataSerializerBase::GetAsSurface()
 {
   MOZ_ASSERT(IsValid());
   return Factory::CreateWrappingDataSourceSurface(GetData(),
                                                   GetStride(),
--- a/gfx/layers/ImageDataSerializer.h
+++ b/gfx/layers/ImageDataSerializer.h
@@ -32,17 +32,17 @@ public:
   bool IsValid() const { return mIsValid; }
 
   uint8_t* GetData();
   uint32_t GetStride() const;
   gfx::IntSize GetSize() const;
   gfx::SurfaceFormat GetFormat() const;
   TemporaryRef<gfx::DataSourceSurface> GetAsSurface();
   TemporaryRef<gfxImageSurface> GetAsThebesSurface();
-  TemporaryRef<gfx::DrawTarget> GetAsDrawTarget();
+  TemporaryRef<gfx::DrawTarget> GetAsDrawTarget(gfx::BackendType aBackend);
 
   static uint32_t ComputeMinBufferSize(gfx::IntSize aSize,
                                        gfx::SurfaceFormat aFormat);
 
 protected:
 
   ImageDataSerializerBase(uint8_t* aData, size_t aDataSize)
     : mData(aData)
--- a/gfx/layers/LayerScope.cpp
+++ b/gfx/layers/LayerScope.cpp
@@ -309,17 +309,17 @@ public:
         return (mHandlers.Length() != 0) ? true : false;
     }
 
     void AppendDebugData(DebugGLData *aDebugData);
     void DispatchDebugData();
 private:
     nsTArray<nsRefPtr<LayerScopeWebSocketHandler> > mHandlers;
     nsCOMPtr<nsIThread> mDebugSenderThread;
-    nsCOMPtr<DebugDataSender> mCurrentSender;
+    nsRefPtr<DebugDataSender> mCurrentSender;
     nsCOMPtr<nsIServerSocket> mServerSocket;
 };
 
 static StaticAutoPtr<LayerScopeWebSocketManager> gLayerScopeWebSocketManager;
 
 class DebugGLData : public LinkedListElement<DebugGLData> {
 public:
     typedef enum {
--- a/gfx/layers/client/CanvasClient.cpp
+++ b/gfx/layers/client/CanvasClient.cpp
@@ -60,17 +60,19 @@ CanvasClient2D::Update(gfx::IntSize aSiz
   bool bufferCreated = false;
   if (!mBuffer) {
     bool isOpaque = (aLayer->GetContentFlags() & Layer::CONTENT_OPAQUE);
     gfxContentType contentType = isOpaque
                                                 ? gfxContentType::COLOR
                                                 : gfxContentType::COLOR_ALPHA;
     gfxImageFormat format
       = gfxPlatform::GetPlatform()->OptimalFormatForContent(contentType);
-    mBuffer = CreateBufferTextureClient(gfx::ImageFormatToSurfaceFormat(format));
+    mBuffer = CreateBufferTextureClient(gfx::ImageFormatToSurfaceFormat(format),
+                                        TEXTURE_FLAGS_DEFAULT,
+                                        gfxPlatform::GetPlatform()->GetPreferredCanvasBackend());
     MOZ_ASSERT(mBuffer->AsTextureClientSurface());
     mBuffer->AsTextureClientSurface()->AllocateForSurface(aSize);
 
     bufferCreated = true;
   }
 
   if (!mBuffer->Lock(OPEN_WRITE_ONLY)) {
     return;
--- a/gfx/layers/client/CompositableClient.cpp
+++ b/gfx/layers/client/CompositableClient.cpp
@@ -164,29 +164,33 @@ CompositableClient::CreateDeprecatedText
              "Created the wrong texture client?");
   result->SetFlags(GetTextureInfo().mTextureFlags);
 
   return result.forget();
 }
 
 TemporaryRef<BufferTextureClient>
 CompositableClient::CreateBufferTextureClient(SurfaceFormat aFormat,
-                                              TextureFlags aTextureFlags)
+                                              TextureFlags aTextureFlags,
+                                              gfx::BackendType aMoz2DBackend)
 {
   return TextureClient::CreateBufferTextureClient(GetForwarder(), aFormat,
-                                                  aTextureFlags | mTextureFlags);
+                                                  aTextureFlags | mTextureFlags,
+                                                  aMoz2DBackend);
 }
 
 TemporaryRef<TextureClient>
 CompositableClient::CreateTextureClientForDrawing(SurfaceFormat aFormat,
                                                   TextureFlags aTextureFlags,
+                                                  gfx::BackendType aMoz2DBackend,
                                                   const IntSize& aSizeHint)
 {
   return TextureClient::CreateTextureClientForDrawing(GetForwarder(), aFormat,
                                                       aTextureFlags | mTextureFlags,
+                                                      aMoz2DBackend,
                                                       aSizeHint);
 }
 
 bool
 CompositableClient::AddTextureClient(TextureClient* aClient)
 {
   return aClient->InitIPDLActor(mForwarder);
 }
--- a/gfx/layers/client/CompositableClient.h
+++ b/gfx/layers/client/CompositableClient.h
@@ -82,23 +82,25 @@ public:
   LayersBackend GetCompositorBackendType() const;
 
   TemporaryRef<DeprecatedTextureClient>
   CreateDeprecatedTextureClient(DeprecatedTextureClientType aDeprecatedTextureClientType,
                                 gfxContentType aContentType = gfxContentType::SENTINEL);
 
   TemporaryRef<BufferTextureClient>
   CreateBufferTextureClient(gfx::SurfaceFormat aFormat,
-                            TextureFlags aFlags = TEXTURE_FLAGS_DEFAULT);
+                            TextureFlags aFlags = TEXTURE_FLAGS_DEFAULT,
+                            gfx::BackendType aMoz2dBackend = gfx::BackendType::NONE);
 
   // If we return a non-null TextureClient, then AsTextureClientDrawTarget will
   // always be non-null.
   TemporaryRef<TextureClient>
   CreateTextureClientForDrawing(gfx::SurfaceFormat aFormat,
                                 TextureFlags aTextureFlags,
+                                gfx::BackendType aMoz2dBackend,
                                 const gfx::IntSize& aSizeHint);
 
   virtual void SetDescriptorFromReply(TextureIdentifier aTextureId,
                                       const SurfaceDescriptor& aDescriptor)
   {
     MOZ_CRASH("If you want to call this, you should have implemented it");
   }
 
--- a/gfx/layers/client/ContentClient.cpp
+++ b/gfx/layers/client/ContentClient.cpp
@@ -163,26 +163,29 @@ ContentClientRemoteBuffer::EndPaint()
     mTextureClientOnWhite->Unlock();
   }
 }
 
 bool
 ContentClientRemoteBuffer::CreateAndAllocateTextureClient(RefPtr<TextureClient>& aClient,
                                                           TextureFlags aFlags)
 {
+  // gfx::BackendType::NONE means fallback to the content backend
   aClient = CreateTextureClientForDrawing(mSurfaceFormat,
                                           mTextureInfo.mTextureFlags | aFlags,
+                                          gfx::BackendType::NONE,
                                           mSize);
   if (!aClient) {
     return false;
   }
 
   if (!aClient->AsTextureClientDrawTarget()->AllocateForSurface(mSize, ALLOC_CLEAR_BUFFER)) {
     aClient = CreateTextureClientForDrawing(mSurfaceFormat,
                 mTextureInfo.mTextureFlags | TEXTURE_ALLOC_FALLBACK | aFlags,
+                gfx::BackendType::NONE,
                 mSize);
     if (!aClient) {
       return false;
     }
     if (!aClient->AsTextureClientDrawTarget()->AllocateForSurface(mSize, ALLOC_CLEAR_BUFFER)) {
       NS_WARNING("Could not allocate texture client");
       aClient = nullptr;
       return false;
--- a/gfx/layers/client/ImageClient.cpp
+++ b/gfx/layers/client/ImageClient.cpp
@@ -235,17 +235,17 @@ ImageClientSingle::UpdateImageInternal(I
       mFrontBuffer = nullptr;
     }
 
     bool bufferCreated = false;
     if (!mFrontBuffer) {
       gfxImageFormat format
         = gfxPlatform::GetPlatform()->OptimalFormatForContent(gfx::ContentForFormat(surface->GetFormat()));
       mFrontBuffer = CreateTextureClientForDrawing(gfx::ImageFormatToSurfaceFormat(format),
-                                                   mTextureFlags, size);
+                                                   mTextureFlags, gfx::BackendType::NONE, size);
       MOZ_ASSERT(mFrontBuffer->AsTextureClientDrawTarget());
       if (!mFrontBuffer->AsTextureClientDrawTarget()->AllocateForSurface(size)) {
         mFrontBuffer = nullptr;
         return false;
       }
 
       bufferCreated = true;
     }
--- a/gfx/layers/client/SimpleTextureClientPool.cpp
+++ b/gfx/layers/client/SimpleTextureClientPool.cpp
@@ -65,19 +65,21 @@ SimpleTextureClientPool::GetTextureClien
   if (mAvailableTextureClients.size()) {
     textureClient = mAvailableTextureClients.top();
     mAvailableTextureClients.pop();
     RECYCLE_LOG("%s Skip allocate (%i left), returning %p\n", (mFormat == SurfaceFormat::B8G8R8A8?"poolA":"poolX"), mAvailableTextureClients.size(), textureClient.get());
 
   } else {
     // No unused clients in the pool, create one
     if (gfxPrefs::ForceShmemTiles()) {
-      textureClient = TextureClient::CreateBufferTextureClient(mSurfaceAllocator, mFormat, TEXTURE_IMMEDIATE_UPLOAD | TEXTURE_RECYCLE);
+      textureClient = TextureClient::CreateBufferTextureClient(mSurfaceAllocator,
+        mFormat, TEXTURE_IMMEDIATE_UPLOAD | TEXTURE_RECYCLE, gfx::BackendType::NONE);
     } else {
-      textureClient = TextureClient::CreateTextureClientForDrawing(mSurfaceAllocator, mFormat, TEXTURE_FLAGS_DEFAULT | TEXTURE_RECYCLE, mSize);
+      textureClient = TextureClient::CreateTextureClientForDrawing(mSurfaceAllocator,
+        mFormat, TEXTURE_FLAGS_DEFAULT | TEXTURE_RECYCLE, gfx::BackendType::NONE, mSize);
     }
     if (!textureClient->AsTextureClientDrawTarget()->AllocateForSurface(mSize, ALLOC_DEFAULT)) {
       NS_WARNING("TextureClient::AllocateForSurface failed!");
     }
     RECYCLE_LOG("%s Must allocate (0 left), returning %p\n", (mFormat == SurfaceFormat::B8G8R8A8?"poolA":"poolX"), textureClient.get());
   }
 
   if (aAutoRecycle) {
--- a/gfx/layers/client/TextureClient.cpp
+++ b/gfx/layers/client/TextureClient.cpp
@@ -274,43 +274,54 @@ DisableGralloc(SurfaceFormat aFormat)
 }
 #endif
 
 // static
 TemporaryRef<TextureClient>
 TextureClient::CreateTextureClientForDrawing(ISurfaceAllocator* aAllocator,
                                              SurfaceFormat aFormat,
                                              TextureFlags aTextureFlags,
+                                             gfx::BackendType aMoz2DBackend,
                                              const gfx::IntSize& aSizeHint)
 {
+  if (aMoz2DBackend == gfx::BackendType::NONE) {
+    aMoz2DBackend = gfxPlatform::GetPlatform()->GetContentBackend();
+  }
+
   RefPtr<TextureClient> result;
 
 #ifdef XP_WIN
   LayersBackend parentBackend = aAllocator->GetCompositorBackendType();
-  if (parentBackend == LayersBackend::LAYERS_D3D11 && gfxWindowsPlatform::GetPlatform()->GetD2DDevice() &&
+  if (parentBackend == LayersBackend::LAYERS_D3D11 &&
+      (aMoz2DBackend == gfx::BackendType::DIRECT2D ||
+        aMoz2DBackend == gfx::BackendType::DIRECT2D1_1) &&
+      gfxWindowsPlatform::GetPlatform()->GetD2DDevice() &&
+
       !(aTextureFlags & TEXTURE_ALLOC_FALLBACK)) {
     result = new TextureClientD3D11(aFormat, aTextureFlags);
   }
   if (parentBackend == LayersBackend::LAYERS_D3D9 &&
+      aMoz2DBackend == gfx::BackendType::CAIRO &&
       aAllocator->IsSameProcess() &&
       !(aTextureFlags & TEXTURE_ALLOC_FALLBACK)) {
     if (!gfxWindowsPlatform::GetPlatform()->GetD3D9Device()) {
       result = new DIBTextureClientD3D9(aFormat, aTextureFlags);
     } else {
       result = new CairoTextureClientD3D9(aFormat, aTextureFlags);
     }
   }
 #endif
 
 #ifdef MOZ_X11
   LayersBackend parentBackend = aAllocator->GetCompositorBackendType();
   gfxSurfaceType type =
     gfxPlatform::GetPlatform()->ScreenReferenceSurface()->GetType();
 
   if (parentBackend == LayersBackend::LAYERS_BASIC &&
+      aMoz2DBackend == gfx::BackendType::CAIRO &&
       type == gfxSurfaceType::Xlib &&
       !(aTextureFlags & TEXTURE_ALLOC_FALLBACK))
   {
     result = new TextureClientX11(aFormat, aTextureFlags);
   }
 #ifdef GL_PROVIDER_GLX
 #if 0
   // Bug 977963: Disabled for black layers
@@ -327,43 +338,47 @@ TextureClient::CreateTextureClientForDra
 #endif
 
 #ifdef MOZ_WIDGET_GONK
   if (!DisableGralloc(aFormat)) {
     // Don't allow Gralloc texture clients to exceed the maximum texture size.
     // BufferTextureClients have code to handle tiling the surface client-side.
     int32_t maxTextureSize = aAllocator->GetMaxTextureSize();
     if (aSizeHint.width <= maxTextureSize && aSizeHint.height <= maxTextureSize) {
-      result = new GrallocTextureClientOGL(aAllocator, aFormat, aTextureFlags);
+      result = new GrallocTextureClientOGL(aAllocator, aFormat, aMoz2DBackend,
+                                           aTextureFlags);
     }
   }
 #endif
 
   // Can't do any better than a buffer texture client.
   if (!result) {
-    result = CreateBufferTextureClient(aAllocator, aFormat, aTextureFlags);
+    result = CreateBufferTextureClient(aAllocator, aFormat, aTextureFlags, aMoz2DBackend);
   }
 
   MOZ_ASSERT(!result || result->AsTextureClientDrawTarget(),
              "Not a TextureClientDrawTarget?");
   return result;
 }
 
 // static
 TemporaryRef<BufferTextureClient>
 TextureClient::CreateBufferTextureClient(ISurfaceAllocator* aAllocator,
                                          SurfaceFormat aFormat,
-                                         TextureFlags aTextureFlags)
+                                         TextureFlags aTextureFlags,
+                                         gfx::BackendType aMoz2DBackend)
 {
   if (gfxPlatform::GetPlatform()->PreferMemoryOverShmem()) {
     RefPtr<BufferTextureClient> result = new MemoryTextureClient(aAllocator, aFormat,
+                                                                 aMoz2DBackend,
                                                                  aTextureFlags);
     return result.forget();
   }
   RefPtr<BufferTextureClient> result = new ShmemTextureClient(aAllocator, aFormat,
+                                                              aMoz2DBackend,
                                                               aTextureFlags);
   return result.forget();
 }
 
 
 class ShmemTextureClientData : public TextureClientData
 {
 public:
@@ -557,18 +572,19 @@ size_t
 ShmemTextureClient::GetBufferSize() const
 {
   MOZ_ASSERT(IsValid());
   return mShmem.Size<uint8_t>();
 }
 
 ShmemTextureClient::ShmemTextureClient(ISurfaceAllocator* aAllocator,
                                        gfx::SurfaceFormat aFormat,
+                                       gfx::BackendType aMoz2DBackend,
                                        TextureFlags aFlags)
-  : BufferTextureClient(aAllocator, aFormat, aFlags)
+  : BufferTextureClient(aAllocator, aFormat, aMoz2DBackend, aFlags)
   , mAllocated(false)
 {
   MOZ_COUNT_CTOR(ShmemTextureClient);
 }
 
 ShmemTextureClient::~ShmemTextureClient()
 {
   MOZ_COUNT_DTOR(ShmemTextureClient);
@@ -603,18 +619,19 @@ MemoryTextureClient::Allocate(uint32_t a
   }
   GfxMemoryImageReporter::DidAlloc(mBuffer);
   mBufSize = aSize;
   return true;
 }
 
 MemoryTextureClient::MemoryTextureClient(ISurfaceAllocator* aAllocator,
                                          gfx::SurfaceFormat aFormat,
+                                         gfx::BackendType aMoz2DBackend,
                                          TextureFlags aFlags)
-  : BufferTextureClient(aAllocator, aFormat, aFlags)
+  : BufferTextureClient(aAllocator, aFormat, aMoz2DBackend, aFlags)
   , mBuffer(nullptr)
   , mBufSize(0)
 {
   MOZ_COUNT_CTOR(MemoryTextureClient);
 }
 
 MemoryTextureClient::~MemoryTextureClient()
 {
@@ -624,20 +641,23 @@ MemoryTextureClient::~MemoryTextureClien
     // leak.
     GfxMemoryImageReporter::WillFree(mBuffer);
     delete mBuffer;
   }
 }
 
 BufferTextureClient::BufferTextureClient(ISurfaceAllocator* aAllocator,
                                          gfx::SurfaceFormat aFormat,
+                                         gfx::BackendType aMoz2DBackend,
                                          TextureFlags aFlags)
   : TextureClient(aFlags)
   , mAllocator(aAllocator)
   , mFormat(aFormat)
+  , mBackend(aMoz2DBackend)
+  , mOpenMode(0)
   , mUsingFallbackDrawTarget(false)
   , mLocked(false)
 {}
 
 BufferTextureClient::~BufferTextureClient()
 {}
 
 ISurfaceAllocator*
@@ -736,25 +756,25 @@ BufferTextureClient::GetAsDrawTarget()
   }
 
   ImageDataSerializer serializer(GetBuffer(), GetBufferSize());
   if (!serializer.IsValid()) {
     return nullptr;
   }
 
   MOZ_ASSERT(mUsingFallbackDrawTarget == false);
-  mDrawTarget = serializer.GetAsDrawTarget();
+  mDrawTarget = serializer.GetAsDrawTarget(mBackend);
   if (mDrawTarget) {
     return mDrawTarget;
   }
 
   // fallback path, probably because the Moz2D backend can't create a
   // DrawTarget around raw memory. This is going to be slow :(
-  mDrawTarget = gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(
-    serializer.GetSize(), serializer.GetFormat());
+  mDrawTarget = gfx::Factory::CreateDrawTarget(mBackend, serializer.GetSize(),
+                                               serializer.GetFormat());
   if (!mDrawTarget) {
     return nullptr;
   }
 
   mUsingFallbackDrawTarget = true;
   if (mOpenMode & OPEN_READ) {
     RefPtr<DataSourceSurface> surface = serializer.GetAsSurface();
     IntRect rect(0, 0, surface->GetSize().width, surface->GetSize().height);
--- a/gfx/layers/client/TextureClient.h
+++ b/gfx/layers/client/TextureClient.h
@@ -197,22 +197,24 @@ class TextureClient
 {
 public:
   TextureClient(TextureFlags aFlags = TEXTURE_FLAGS_DEFAULT);
   virtual ~TextureClient();
 
   static TemporaryRef<BufferTextureClient>
   CreateBufferTextureClient(ISurfaceAllocator* aAllocator,
                             gfx::SurfaceFormat aFormat,
-                            TextureFlags aTextureFlags);
+                            TextureFlags aTextureFlags,
+                            gfx::BackendType aMoz2dBackend);
 
   static TemporaryRef<TextureClient>
   CreateTextureClientForDrawing(ISurfaceAllocator* aAllocator,
                                 gfx::SurfaceFormat aFormat,
                                 TextureFlags aTextureFlags,
+                                gfx::BackendType aMoz2dBackend,
                                 const gfx::IntSize& aSizeHint);
 
   virtual TextureClientSurface* AsTextureClientSurface() { return nullptr; }
   virtual TextureClientDrawTarget* AsTextureClientDrawTarget() { return nullptr; }
   virtual TextureClientYCbCr* AsTextureClientYCbCr() { return nullptr; }
 
   /**
    * Locks the shared data, allowing the caller to get access to it.
@@ -388,17 +390,17 @@ protected:
  */
 class BufferTextureClient : public TextureClient
                           , public TextureClientSurface
                           , public TextureClientYCbCr
                           , public TextureClientDrawTarget
 {
 public:
   BufferTextureClient(ISurfaceAllocator* aAllocator, gfx::SurfaceFormat aFormat,
-                      TextureFlags aFlags);
+                      gfx::BackendType aBackend, TextureFlags aFlags);
 
   virtual ~BufferTextureClient();
 
   virtual bool IsAllocated() const = 0;
 
   virtual bool ToSurfaceDescriptor(SurfaceDescriptor& aDescriptor) = 0;
 
   virtual uint8_t* GetBuffer() const = 0;
@@ -452,30 +454,31 @@ public:
 
   ISurfaceAllocator* GetAllocator() const;
 
 protected:
   RefPtr<gfx::DrawTarget> mDrawTarget;
   RefPtr<ISurfaceAllocator> mAllocator;
   gfx::SurfaceFormat mFormat;
   gfx::IntSize mSize;
+  gfx::BackendType mBackend;
   OpenMode mOpenMode;
   bool mUsingFallbackDrawTarget;
   bool mLocked;
 };
 
 /**
  * TextureClient that wraps shared memory.
  * the corresponding texture on the host side is ShmemTextureHost.
  */
 class ShmemTextureClient : public BufferTextureClient
 {
 public:
   ShmemTextureClient(ISurfaceAllocator* aAllocator, gfx::SurfaceFormat aFormat,
-                     TextureFlags aFlags);
+                     gfx::BackendType aBackend, TextureFlags aFlags);
 
   ~ShmemTextureClient();
 
   virtual bool ToSurfaceDescriptor(SurfaceDescriptor& aDescriptor) MOZ_OVERRIDE;
 
   virtual bool Allocate(uint32_t aSize) MOZ_OVERRIDE;
 
   virtual uint8_t* GetBuffer() const MOZ_OVERRIDE;
@@ -499,17 +502,17 @@ protected:
  * TextureClient that wraps raw memory.
  * The corresponding texture on the host side is MemoryTextureHost.
  * Can obviously not be used in a cross process setup.
  */
 class MemoryTextureClient : public BufferTextureClient
 {
 public:
   MemoryTextureClient(ISurfaceAllocator* aAllocator, gfx::SurfaceFormat aFormat,
-                      TextureFlags aFlags);
+                      gfx::BackendType aBackend, TextureFlags aFlags);
 
   ~MemoryTextureClient();
 
   virtual bool ToSurfaceDescriptor(SurfaceDescriptor& aDescriptor) MOZ_OVERRIDE;
 
   virtual bool Allocate(uint32_t aSize) MOZ_OVERRIDE;
 
   virtual uint8_t* GetBuffer() const MOZ_OVERRIDE { return mBuffer; }
--- a/gfx/layers/client/TextureClientPool.cpp
+++ b/gfx/layers/client/TextureClientPool.cpp
@@ -44,19 +44,22 @@ TextureClientPool::GetTextureClient()
   }
 
   // We're increasing the number of outstanding TextureClients without reusing a
   // client, we may need to free a deferred-return TextureClient.
   ShrinkToMaximumSize();
 
   // No unused clients in the pool, create one
   if (gfxPrefs::ForceShmemTiles()) {
-    textureClient = TextureClient::CreateBufferTextureClient(mSurfaceAllocator, mFormat, TEXTURE_IMMEDIATE_UPLOAD);
+    // gfx::BackendType::NONE means use the content backend
+    textureClient = TextureClient::CreateBufferTextureClient(mSurfaceAllocator,
+      mFormat, TEXTURE_IMMEDIATE_UPLOAD, gfx::BackendType::NONE);
   } else {
-    textureClient = TextureClient::CreateTextureClientForDrawing(mSurfaceAllocator, mFormat, TEXTURE_IMMEDIATE_UPLOAD, mSize);
+    textureClient = TextureClient::CreateTextureClientForDrawing(mSurfaceAllocator,
+      mFormat, TEXTURE_IMMEDIATE_UPLOAD, gfx::BackendType::NONE, mSize);
   }
   textureClient->AsTextureClientDrawTarget()->AllocateForSurface(mSize, ALLOC_DEFAULT);
 
   return textureClient;
 }
 
 void
 TextureClientPool::ReturnTextureClient(TextureClient *aClient)
--- a/gfx/layers/opengl/GrallocTextureClient.cpp
+++ b/gfx/layers/opengl/GrallocTextureClient.cpp
@@ -87,28 +87,30 @@ GrallocTextureClientOGL::DropTextureData
     mGrallocActor = nullptr;
     mGraphicBuffer = nullptr;
     return result;
   }
 }
 
 GrallocTextureClientOGL::GrallocTextureClientOGL(GrallocBufferActor* aActor,
                                                  gfx::IntSize aSize,
+                                                 gfx::BackendType aMoz2dBackend,
                                                  TextureFlags aFlags)
-: BufferTextureClient(nullptr, gfx::SurfaceFormat::UNKNOWN, aFlags)
+: BufferTextureClient(nullptr, gfx::SurfaceFormat::UNKNOWN, aMoz2dBackend, aFlags)
 , mMappedBuffer(nullptr)
 {
   InitWith(aActor, aSize);
   MOZ_COUNT_CTOR(GrallocTextureClientOGL);
 }
 
 GrallocTextureClientOGL::GrallocTextureClientOGL(ISurfaceAllocator* aAllocator,
                                                  gfx::SurfaceFormat aFormat,
+                                                 gfx::BackendType aMoz2dBackend,
                                                  TextureFlags aFlags)
-: BufferTextureClient(aAllocator, aFormat, aFlags)
+: BufferTextureClient(aAllocator, aFormat, aMoz2dBackend, aFlags)
 , mMappedBuffer(nullptr)
 {
   MOZ_COUNT_CTOR(GrallocTextureClientOGL);
 }
 
 GrallocTextureClientOGL::~GrallocTextureClientOGL()
 {
   MOZ_COUNT_DTOR(GrallocTextureClientOGL);
--- a/gfx/layers/opengl/GrallocTextureClient.h
+++ b/gfx/layers/opengl/GrallocTextureClient.h
@@ -31,19 +31,21 @@ class GraphicBufferLocked;
  *
  * This is only used in Firefox OS
  */
 class GrallocTextureClientOGL : public BufferTextureClient
 {
 public:
   GrallocTextureClientOGL(GrallocBufferActor* aActor,
                           gfx::IntSize aSize,
+                          gfx::BackendType aMoz2dBackend,
                           TextureFlags aFlags = TEXTURE_FLAGS_DEFAULT);
   GrallocTextureClientOGL(ISurfaceAllocator* aAllocator,
                           gfx::SurfaceFormat aFormat,
+                          gfx::BackendType aMoz2dBackend,
                           TextureFlags aFlags = TEXTURE_FLAGS_DEFAULT);
 
   ~GrallocTextureClientOGL();
 
   virtual bool Lock(OpenMode aMode) MOZ_OVERRIDE;
 
   virtual void Unlock() MOZ_OVERRIDE;
 
--- a/gfx/skia/generate_mozbuild.py
+++ b/gfx/skia/generate_mozbuild.py
@@ -12,16 +12,21 @@ header = """
 
 footer = """
 
 # left out of UNIFIED_SOURCES for now; that's not C++ anyway, nothing else to unify it with
 if not CONFIG['INTEL_ARCHITECTURE'] and CONFIG['CPU_ARCH'] == 'arm' and CONFIG['GNU_CC']:
     SOURCES += [
         'trunk/src/opts/memset.arm.S',
     ]
+    if CONFIG['BUILD_ARM_NEON']:
+        SOURCES += [
+            'trunk/src/opts/memset16_neon.S',
+            'trunk/src/opts/memset32_neon.S',
+        ]
 
 MSVC_ENABLE_PGO = True
 
 FINAL_LIBRARY = 'gkmedias'
 LOCAL_INCLUDES += [
     'trunk/include/config',
     'trunk/include/core',
     'trunk/include/effects',
@@ -78,16 +83,19 @@ if CONFIG['INTEL_ARCHITECTURE'] and CONF
     SOURCES['trunk/src/opts/SkBitmapFilter_opts_SSE2.cpp'].flags += ['-msse2']
     SOURCES['trunk/src/opts/SkBitmapProcState_opts_SSE2.cpp'].flags += ['-msse2']
     SOURCES['trunk/src/opts/SkBitmapProcState_opts_SSSE3.cpp'].flags += ['-mssse3']
     SOURCES['trunk/src/opts/SkBlitRect_opts_SSE2.cpp'].flags += ['-msse2']
     SOURCES['trunk/src/opts/SkBlitRow_opts_SSE2.cpp'].flags += ['-msse2']
     SOURCES['trunk/src/opts/SkBlurImage_opts_SSE2.cpp'].flags += ['-msse2']
     SOURCES['trunk/src/opts/SkMorphology_opts_SSE2.cpp'].flags += ['-msse2']
     SOURCES['trunk/src/opts/SkUtils_opts_SSE2.cpp'].flags += ['-msse2']
+elif CONFIG['CPU_ARCH'] == 'arm' and CONFIG['GNU_CC'] and CONFIG['BUILD_ARM_NEON']:
+    DEFINES['__ARM_HAVE_OPTIONAL_NEON_SUPPORT'] = 1
+    DEFINES['USE_ANDROID_NDK_CPU_FEATURES'] = 0
 
 DEFINES['SKIA_IMPLEMENTATION'] = 1
 DEFINES['GR_IMPLEMENTATION'] = 1
 """
 
 import json
 
 platforms = ['linux', 'mac', 'android', 'win']
@@ -140,17 +148,16 @@ def generate_separated_sources(platform_
     'SkImageDecoder_',
     '_gif',
     'SkFontConfigParser_android',
     'SkJpeg',
     'SkXML',
     'SkCity',
     'GrGLCreateNativeInterface',
     'fontconfig',
-    '_neon',
     'SkThreadUtils_pthread_',
     'SkImage_Codec',
     'SkBitmapChecksummer',
     'SkNativeGLContext',
     'SkFontConfig',
     'SkFontHost_win_dw',
     'SkForceLinking',
     'SkMovie',
@@ -200,16 +207,20 @@ def generate_separated_sources(platform_
     'linux': {
       'trunk/src/ports/SkFontHost_cairo.cpp',
     },
     'intel': {
       'trunk/src/opts/SkXfermode_opts_none.cpp',
     },
     'arm': {
       'trunk/src/opts/SkUtils_opts_arm.cpp',
+      'trunk/src/core/SkUtilsArm.cpp',
+    },
+    'neon': {
+      'trunk/src/opts/SkBitmapProcState_arm_neon.cpp',
     },
     'none': {
       'trunk/src/opts/SkUtils_opts_none.cpp',
     }
   }
 
   for plat in platform_sources.keys():
     if not separated.has_key(plat):
@@ -218,17 +229,21 @@ def generate_separated_sources(platform_
     for value in platform_sources[plat]:
       if isblacklisted(value):
         continue
 
       if value.find('_SSE') > 0 or value.find('_SSSE') > 0: #lol
         separated['intel'].add(value)
         continue
 
-      if value.find('_arm') > 0 or value.find('_neon') > 0:
+      if value.find('_neon') > 0:
+        separated['neon'].add(value)
+        continue
+
+      if value.find('_arm') > 0:
         separated['arm'].add(value)
         continue
 
       if value.find('_none') > 0:
         separated['none'].add(value)
         continue
 
       found = True
@@ -247,33 +262,49 @@ def generate_separated_sources(platform_
 
   return separated
 
 def uniq(seq):
   seen = set()
   seen_add = seen.add
   return [ x for x in seq if x not in seen and not seen_add(x)]
 
+def write_cflags(f, values, subsearch, cflag, indent):
+  def write_indent(indent):
+    for _ in range(indent):
+        f.write(' ')
+
+  val_list = uniq(sorted(map(lambda val: val.replace('../', 'trunk/'), values), key=lambda x: x.lower()))
+
+  if len(val_list) == 0:
+    return
+
+  for val in val_list:
+    if val.find(subsearch) > 0:
+      write_indent(indent)
+      f.write("SOURCES[\'" + val + "\'].flags += [\'" + cflag + "\']\n")
+
+
 def write_list(f, name, values, indent):
   def write_indent(indent):
     for _ in range(indent):
         f.write(' ')
 
   val_list = uniq(sorted(map(lambda val: val.replace('../', 'trunk/'), values), key=lambda x: x.lower()))
 
   if len(val_list) == 0:
     return
 
   write_indent(indent)
   f.write(name + ' += [\n')
   for val in val_list:
     write_indent(indent + 4)
     f.write('\'' + val + '\',\n')
 
-  write_indent(4)
+  write_indent(indent)
   f.write(']\n')
 
 def write_mozbuild(includes, sources):
   filename = 'moz.build'
   f = open(filename, 'w')
 
   f.write(header)
 
@@ -298,16 +329,20 @@ def write_mozbuild(includes, sources):
 
   f.write("\n\n")
   f.write("if CONFIG['INTEL_ARCHITECTURE']:\n")
   write_list(f, 'SOURCES', sources['intel'], 4)
 
   f.write("elif CONFIG['CPU_ARCH'] == 'arm' and CONFIG['GNU_CC']:\n")
   write_list(f, 'SOURCES', sources['arm'], 4)
 
+  f.write("    if CONFIG['BUILD_ARM_NEON']:\n")
+  write_list(f, 'SOURCES', sources['neon'], 8)
+  write_cflags(f, sources['neon'], 'neon', '-mfpu=neon', 8)
+
   f.write("else:\n")
   write_list(f, 'SOURCES', sources['none'], 4)
 
   f.write(footer)
 
   f.close()
 
   print 'Wrote ' + filename
--- a/gfx/skia/moz.build
+++ b/gfx/skia/moz.build
@@ -1,8 +1,9 @@
+
 # Please note this file is autogenerated from generate_mozbuild.py, so do not modify it directly
 
 EXPORTS.skia += [
     'trunk/include/animator/SkAnimator.h',
     'trunk/include/animator/SkAnimatorView.h',
     'trunk/include/config/SkUserConfig.h',
     'trunk/include/core/Sk64.h',
     'trunk/include/core/SkAdvancedTypefaceMetrics.h',
@@ -309,17 +310,17 @@ EXPORTS.skia += [
     'trunk/include/xml/SkJS.h',
     'trunk/include/xml/SkXMLParser.h',
     'trunk/include/xml/SkXMLWriter.h',
     'trunk/src/ports/SkAtomics_android.h',
     'trunk/src/ports/SkAtomics_sync.h',
     'trunk/src/ports/SkAtomics_win.h',
     'trunk/src/ports/SkMutex_pthread.h',
     'trunk/src/ports/SkMutex_win.h',
-    ]
+]
 SOURCES += [
     'trunk/src/core/SkAAClip.cpp',
     'trunk/src/core/SkAdvancedTypefaceMetrics.cpp',
     'trunk/src/core/SkAlphaRuns.cpp',
     'trunk/src/core/SkAnnotation.cpp',
     'trunk/src/core/SkBBoxHierarchyRecord.cpp',
     'trunk/src/core/SkBBoxRecord.cpp',
     'trunk/src/core/SkBitmap.cpp',
@@ -689,33 +690,32 @@ SOURCES += [
     'trunk/src/utils/SkParsePath.cpp',
     'trunk/src/utils/SkPathUtils.cpp',
     'trunk/src/utils/SkPictureUtils.cpp',
     'trunk/src/utils/SkProxyCanvas.cpp',
     'trunk/src/utils/SkRTConf.cpp',
     'trunk/src/utils/SkSHA1.cpp',
     'trunk/src/utils/SkThreadPool.cpp',
     'trunk/src/utils/SkUnitMappers.cpp',
-    ]
+]
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gonk'):
     SOURCES += [
         'trunk/src/images/SkImageRef_ashmem.cpp',
         'trunk/src/ports/SkDebug_android.cpp',
         'trunk/src/ports/SkFontHost_android_old.cpp',
         'trunk/src/ports/SkFontHost_cairo.cpp',
         'trunk/src/ports/SkFontHost_FreeType.cpp',
         'trunk/src/ports/SkFontHost_FreeType_common.cpp',
         'trunk/src/ports/SkOSFile_posix.cpp',
         'trunk/src/ports/SkPurgeableMemoryBlock_android.cpp',
         'trunk/src/ports/SkTime_Unix.cpp',
         'trunk/src/ports/SkTLS_pthread.cpp',
         'trunk/src/utils/android/ashmem.cpp',
         'trunk/src/utils/SkThreadUtils_pthread.cpp',
     ]
-    DEFINES['SK_FONTHOST_CAIRO_STANDALONE'] = 0
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     SOURCES += [
         'trunk/src/ports/SkDebug_stdio.cpp',
         'trunk/src/ports/SkFontHost_mac.cpp',
         'trunk/src/ports/SkOSFile_posix.cpp',
         'trunk/src/ports/SkPurgeableMemoryBlock_mac.cpp',
         'trunk/src/ports/SkTime_Unix.cpp',
         'trunk/src/ports/SkTLS_pthread.cpp',
@@ -772,24 +772,42 @@ if CONFIG['INTEL_ARCHITECTURE']:
         'trunk/src/opts/SkBlitRow_opts_SSE2.cpp',
         'trunk/src/opts/SkBlurImage_opts_SSE2.cpp',
         'trunk/src/opts/SkMorphology_opts_SSE2.cpp',
         'trunk/src/opts/SkUtils_opts_SSE2.cpp',
         'trunk/src/opts/SkXfermode_opts_none.cpp',
     ]
 elif CONFIG['CPU_ARCH'] == 'arm' and CONFIG['GNU_CC']:
     SOURCES += [
+        'trunk/src/core/SkUtilsArm.cpp',
         'trunk/src/opts/SkBitmapProcState_opts_arm.cpp',
         'trunk/src/opts/SkBlitMask_opts_arm.cpp',
         'trunk/src/opts/SkBlitRow_opts_arm.cpp',
         'trunk/src/opts/SkBlurImage_opts_arm.cpp',
         'trunk/src/opts/SkMorphology_opts_arm.cpp',
         'trunk/src/opts/SkUtils_opts_arm.cpp',
         'trunk/src/opts/SkXfermode_opts_arm.cpp',
     ]
+    if CONFIG['BUILD_ARM_NEON']:
+        SOURCES += [
+            'trunk/src/opts/SkBitmapProcState_arm_neon.cpp',
+            'trunk/src/opts/SkBitmapProcState_matrixProcs_neon.cpp',
+            'trunk/src/opts/SkBlitMask_opts_arm_neon.cpp',
+            'trunk/src/opts/SkBlitRow_opts_arm_neon.cpp',
+            'trunk/src/opts/SkBlurImage_opts_neon.cpp',
+            'trunk/src/opts/SkMorphology_opts_neon.cpp',
+            'trunk/src/opts/SkXfermode_opts_arm_neon.cpp',
+        ]
+        SOURCES['trunk/src/opts/SkBitmapProcState_arm_neon.cpp'].flags += ['-mfpu=neon']
+        SOURCES['trunk/src/opts/SkBitmapProcState_matrixProcs_neon.cpp'].flags += ['-mfpu=neon']
+        SOURCES['trunk/src/opts/SkBlitMask_opts_arm_neon.cpp'].flags += ['-mfpu=neon']
+        SOURCES['trunk/src/opts/SkBlitRow_opts_arm_neon.cpp'].flags += ['-mfpu=neon']
+        SOURCES['trunk/src/opts/SkBlurImage_opts_neon.cpp'].flags += ['-mfpu=neon']
+        SOURCES['trunk/src/opts/SkMorphology_opts_neon.cpp'].flags += ['-mfpu=neon']
+        SOURCES['trunk/src/opts/SkXfermode_opts_arm_neon.cpp'].flags += ['-mfpu=neon']
 else:
     SOURCES += [
         'trunk/src/opts/SkBitmapProcState_opts_none.cpp',
         'trunk/src/opts/SkBlitMask_opts_none.cpp',
         'trunk/src/opts/SkBlitRow_opts_none.cpp',
         'trunk/src/opts/SkBlurImage_opts_none.cpp',
         'trunk/src/opts/SkMorphology_opts_none.cpp',
         'trunk/src/opts/SkUtils_opts_none.cpp',
@@ -799,16 +817,21 @@ else:
     ]
 
 
 # left out of UNIFIED_SOURCES for now; that's not C++ anyway, nothing else to unify it with
 if not CONFIG['INTEL_ARCHITECTURE'] and CONFIG['CPU_ARCH'] == 'arm' and CONFIG['GNU_CC']:
     SOURCES += [
         'trunk/src/opts/memset.arm.S',
     ]
+    if CONFIG['BUILD_ARM_NEON']:
+        SOURCES += [
+            'trunk/src/opts/memset16_neon.S',
+            'trunk/src/opts/memset32_neon.S',
+        ]
 
 MSVC_ENABLE_PGO = True
 
 FINAL_LIBRARY = 'gkmedias'
 LOCAL_INCLUDES += [
     'trunk/include/config',
     'trunk/include/core',
     'trunk/include/effects',
@@ -842,27 +865,33 @@ DEFINES['SK_G32_SHIFT'] = 8
 DEFINES['SK_B32_SHIFT'] = 0
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk2', 'gtk3', 'qt', 'gonk', 'cocoa'):
     DEFINES['SK_USE_POSIX_THREADS'] = 1
 
 if CONFIG['INTEL_ARCHITECTURE'] and CONFIG['HAVE_TOOLCHAIN_SUPPORT_MSSSE3']:
     DEFINES['SK_BUILD_SSSE3'] = 1
 
-if (CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android') or (CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk') or    (CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa') or    CONFIG['MOZ_WIDGET_GTK'] or    CONFIG['MOZ_WIDGET_QT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gonk'):
+    DEFINES['SK_FONTHOST_CAIRO_STANDALONE'] = 0
+
+if (CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android') or    (CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa') or    (CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk') or    CONFIG['MOZ_WIDGET_QT'] or    CONFIG['MOZ_WIDGET_GTK']:
     DEFINES['SK_FONTHOST_DOES_NOT_USE_FONTMGR'] = 1
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     DEFINES['SKIA_DLL'] = 1
     DEFINES['GR_DLL'] = 1
 
 if CONFIG['INTEL_ARCHITECTURE'] and CONFIG['GNU_CC']:
     SOURCES['trunk/src/opts/SkBitmapFilter_opts_SSE2.cpp'].flags += ['-msse2']
     SOURCES['trunk/src/opts/SkBitmapProcState_opts_SSE2.cpp'].flags += ['-msse2']
     SOURCES['trunk/src/opts/SkBitmapProcState_opts_SSSE3.cpp'].flags += ['-mssse3']
     SOURCES['trunk/src/opts/SkBlitRect_opts_SSE2.cpp'].flags += ['-msse2']
     SOURCES['trunk/src/opts/SkBlitRow_opts_SSE2.cpp'].flags += ['-msse2']
     SOURCES['trunk/src/opts/SkBlurImage_opts_SSE2.cpp'].flags += ['-msse2']
     SOURCES['trunk/src/opts/SkMorphology_opts_SSE2.cpp'].flags += ['-msse2']
     SOURCES['trunk/src/opts/SkUtils_opts_SSE2.cpp'].flags += ['-msse2']
+elif CONFIG['CPU_ARCH'] == 'arm' and CONFIG['GNU_CC'] and CONFIG['BUILD_ARM_NEON']:
+    DEFINES['__ARM_HAVE_OPTIONAL_NEON_SUPPORT'] = 1
+    DEFINES['USE_ANDROID_NDK_CPU_FEATURES'] = 0
 
 DEFINES['SKIA_IMPLEMENTATION'] = 1
 DEFINES['GR_IMPLEMENTATION'] = 1
--- a/gfx/skia/trunk/src/core/SkUtilsArm.cpp
+++ b/gfx/skia/trunk/src/core/SkUtilsArm.cpp
@@ -15,20 +15,22 @@
 #include <errno.h>
 #include <string.h>
 #include <pthread.h>
 
 // Set USE_ANDROID_NDK_CPU_FEATURES to use the Android NDK's
 // cpu-features helper library to detect NEON at runtime. See
 // http://crbug.com/164154 to see why this is needed in Chromium
 // for Android.
-#if defined(SK_BUILD_FOR_ANDROID)
-#  define USE_ANDROID_NDK_CPU_FEATURES 1
-#else
-#  define USE_ANDROID_NDK_CPU_FEATURES 0
+#if !defined(USE_ANDROID_NDK_CPU_FEATURES)
+#  if defined(SK_BUILD_FOR_ANDROID)
+#    define USE_ANDROID_NDK_CPU_FEATURES 1
+#  else
+#    define USE_ANDROID_NDK_CPU_FEATURES 0
+#  endif
 #endif
 
 #if USE_ANDROID_NDK_CPU_FEATURES
 #  include <cpu-features.h>
 #endif
 
 // Set NEON_DEBUG to 1 to allow debugging of the CPU features probing.
 // For now, we always set it for SK_DEBUG builds.
--- a/gfx/tests/gtest/TestTextures.cpp
+++ b/gfx/tests/gtest/TestTextures.cpp
@@ -214,16 +214,17 @@ TEST(Layers, TextureSerialization) {
   for (int f = 0; f < 3; ++f) {
     RefPtr<gfxImageSurface> surface = new gfxImageSurface(gfxIntSize(400,300), formats[f]);
     SetupSurface(surface.get());
     AssertSurfacesEqual(surface, surface);
 
     RefPtr<TextureClient> client
       = new MemoryTextureClient(nullptr,
                                 mozilla::gfx::ImageFormatToSurfaceFormat(surface->Format()),
+                                gfx::BackendType::CAIRO,
                                 TEXTURE_DEALLOCATE_CLIENT);
 
     TestTextureClientSurface(client, surface);
 
     // XXX - Test more texture client types.
   }
 }
 
@@ -250,14 +251,15 @@ TEST(Layers, TextureYCbCrSerialization) 
   clientData.mCrSkip = 0;
   clientData.mCrSkip = 0;
   clientData.mPicX = 0;
   clientData.mPicX = 0;
 
   RefPtr<TextureClient> client
     = new MemoryTextureClient(nullptr,
                               mozilla::gfx::SurfaceFormat::YUV,
+                              gfx::BackendType::CAIRO,
                               TEXTURE_DEALLOCATE_CLIENT);
 
   TestTextureClientYCbCr(client, clientData);
 
   // XXX - Test more texture client types.
 }
--- a/gfx/thebes/gfxPlatform.h
+++ b/gfx/thebes/gfxPlatform.h
@@ -288,16 +288,20 @@ public:
 
     void GetAzureBackendInfo(mozilla::widget::InfoObject &aObj) {
       aObj.DefineProperty("AzureCanvasBackend", GetBackendName(mPreferredCanvasBackend));
       aObj.DefineProperty("AzureSkiaAccelerated", UseAcceleratedSkiaCanvas());
       aObj.DefineProperty("AzureFallbackCanvasBackend", GetBackendName(mFallbackCanvasBackend));
       aObj.DefineProperty("AzureContentBackend", GetBackendName(mContentBackend));
     }
 
+    mozilla::gfx::BackendType GetContentBackend() {
+      return mContentBackend;
+    }
+
     mozilla::gfx::BackendType GetPreferredCanvasBackend() {
       return mPreferredCanvasBackend;
     }
 
     /*
      * Font bits
      */
 
@@ -646,20 +650,16 @@ protected:
      */
     static mozilla::gfx::BackendType GetBackendPref(const char* aBackendPrefName,
                                                     uint32_t &aBackendBitmask);
     /**
      * Decode the backend enumberation from a string.
      */
     static mozilla::gfx::BackendType BackendTypeForName(const nsCString& aName);
 
-    mozilla::gfx::BackendType GetContentBackend() {
-      return mContentBackend;
-    }
-
     static mozilla::TemporaryRef<mozilla::gfx::ScaledFont>
       GetScaledFontForFontWithCairoSkia(mozilla::gfx::DrawTarget* aTarget, gfxFont* aFont);
 
     int8_t  mAllowDownloadableFonts;
     int8_t  mGraphiteShapingEnabled;
     int8_t  mOpenTypeSVGEnabled;
 
     int8_t  mBidiNumeralOption;
--- a/ipc/glue/BackgroundImpl.cpp
+++ b/ipc/glue/BackgroundImpl.cpp
@@ -1516,17 +1516,17 @@ ChildImpl::GetOrCreateForCurrentThread(
   if (NS_IsMainThread()) {
     if (NS_WARN_IF(!OpenProtocolOnMainThread(NS_GetCurrentThread()))) {
       return false;
     }
 
     return true;
   }
 
-  nsCOMPtr<CreateActorRunnable> runnable = new CreateActorRunnable();
+  nsRefPtr<CreateActorRunnable> runnable = new CreateActorRunnable();
   if (NS_FAILED(NS_DispatchToMainThread(runnable, NS_DISPATCH_NORMAL))) {
     CRASH_IN_CHILD_PROCESS("Failed to dispatch to main thread!");
     return false;
   }
 
   return true;
 }
 
--- a/ipc/testshell/XPCShellEnvironment.cpp
+++ b/ipc/testshell/XPCShellEnvironment.cpp
@@ -160,18 +160,17 @@ Load(JSContext *cx,
         if (!file) {
             JS_ReportError(cx, "cannot open file '%s' for reading", filename.ptr());
             return false;
         }
         Rooted<JSObject*> global(cx, JS::CurrentGlobalOrNull(cx));
         JS::CompileOptions options(cx);
         options.setUTF8(true)
                .setFileAndLine(filename.ptr(), 1);
-        JS::RootedObject rootedObj(cx, obj);
-        JSScript *script = JS::Compile(cx, rootedObj, options, file);
+        JS::Rooted<JSScript*> script(cx, JS::Compile(cx, obj, options, file));
         fclose(file);
         if (!script)
             return false;
 
         JS::Rooted<JS::Value> result(cx);
         if (!JS_ExecuteScript(cx, obj, script, result.address())) {
             return false;
         }
@@ -293,17 +292,16 @@ void
 XPCShellEnvironment::ProcessFile(JSContext *cx,
                                  JS::Handle<JSObject*> obj,
                                  const char *filename,
                                  FILE *file,
                                  bool forceTTY)
 {
     XPCShellEnvironment* env = this;
 
-    JSScript *script;
     JS::Rooted<JS::Value> result(cx);
     int lineno, startline;
     bool ok, hitEOF;
     char *bufp, buffer[4096];
     JSString *str;
 
     if (forceTTY) {
         file = stdin;
@@ -328,17 +326,17 @@ XPCShellEnvironment::ProcessFile(JSConte
         ungetc(ch, file);
 
         JSAutoRequest ar(cx);
         JSAutoCompartment ac(cx, obj);
 
         JS::CompileOptions options(cx);
         options.setUTF8(true)
                .setFileAndLine(filename, 1);
-        JSScript* script = JS::Compile(cx, obj, options, file);
+        JS::Rooted<JSScript*> script(cx, JS::Compile(cx, obj, options, file));
         if (script)
             (void)JS_ExecuteScript(cx, obj, script, result.address());
 
         return;
     }
 
     /* It's an interactive filehandle; drop into read-eval-print loop. */
     lineno = 1;
@@ -365,17 +363,18 @@ XPCShellEnvironment::ProcessFile(JSConte
             bufp += strlen(bufp);
             lineno++;
         } while (!JS_BufferIsCompilableUnit(cx, obj, buffer, strlen(buffer)));
 
         /* Clear any pending exception from previous failed compiles.  */
         JS_ClearPendingException(cx);
         JS::CompileOptions options(cx);
         options.setFileAndLine("typein", startline);
-        script = JS_CompileScript(cx, obj, buffer, strlen(buffer), options);
+        JS::Rooted<JSScript*> script(cx,
+                                     JS_CompileScript(cx, obj, buffer, strlen(buffer), options));
         if (script) {
             JSErrorReporter older;
 
             ok = JS_ExecuteScript(cx, obj, script, result.address());
             if (ok && result != JSVAL_VOID) {
                 /* Suppress error reports from JS::ToString(). */
                 older = JS_SetErrorReporter(cx, nullptr);
                 str = JS::ToString(cx, result);
@@ -573,18 +572,18 @@ XPCShellEnvironment::EvaluateString(cons
                                     nsString* aResult)
 {
   AutoSafeJSContext cx;
   JS::Rooted<JSObject*> global(cx, GetGlobalObject());
   JSAutoCompartment ac(cx, global);
 
   JS::CompileOptions options(cx);
   options.setFileAndLine("typein", 0);
-  JSScript* script = JS_CompileUCScript(cx, global, aString.get(),
-                                        aString.Length(), options);
+  JS::Rooted<JSScript*> script(cx, JS_CompileUCScript(cx, global, aString.get(),
+                                                      aString.Length(), options));
   if (!script) {
      return false;
   }
 
   if (aResult) {
       aResult->Truncate();
   }
 
--- a/js/jsd/jsd_val.cpp
+++ b/js/jsd/jsd_val.cpp
@@ -673,27 +673,26 @@ jsd_GetValueClassName(JSDContext* jsdc, 
     return jsdval->className;
 }
 
 JSDScript*
 jsd_GetScriptForValue(JSDContext* jsdc, JSDValue* jsdval)
 {
     AutoSafeJSContext cx;
     JS::RootedValue val(cx, jsdval->val);
-    JSFunction* fun = nullptr;
     JS::RootedScript script(cx);
     JSDScript* jsdscript;
 
     if (!jsd_IsValueFunction(jsdc, jsdval))
         return nullptr;
 
     {
         JSAutoCompartment ac(cx, JSVAL_TO_OBJECT(val));
         AutoSaveExceptionState as(cx);
-        fun = JSD_GetValueFunction(jsdc, jsdval);
+        JS::RootedFunction fun(cx, JSD_GetValueFunction(jsdc, jsdval));
         if (fun)
             script = JS_GetFunctionScript(cx, fun);
     }
 
     if (!script)
         return nullptr;
 
     JSD_LOCK_SCRIPTS(jsdc);
--- a/js/public/MemoryMetrics.h
+++ b/js/public/MemoryMetrics.h
@@ -176,17 +176,18 @@ struct CodeSizes
 #undef FOR_EACH_SIZE
 };
 
 // Data for tracking GC memory usage.
 struct GCSizes
 {
 #define FOR_EACH_SIZE(macro) \
     macro(_, _, marker) \
-    macro(_, _, nursery) \
+    macro(_, _, nurseryCommitted) \
+    macro(_, _, nurseryDecommitted) \
     macro(_, _, storeBufferVals) \
     macro(_, _, storeBufferCells) \
     macro(_, _, storeBufferSlots) \</