diff options
8 files changed, 89 insertions, 1 deletions
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-context-gc-custom-properties-expected.txt b/third_party/WebKit/LayoutTests/fast/canvas/canvas-context-gc-custom-properties-expected.txt new file mode 100644 index 0000000..c702309 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-context-gc-custom-properties-expected.txt @@ -0,0 +1,11 @@ +Verify that the custom properties on a Canvas 2D rendering context object are retained across GCs. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS context.customProperty is "value" +PASS context.customProperty is "value" +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-context-gc-custom-properties.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-context-gc-custom-properties.html new file mode 100644 index 0000000..2ec7253 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-context-gc-custom-properties.html @@ -0,0 +1,31 @@ +<html> +<head> +<script src="../../resources/js-test.js"></script> +</head> +<body> +<script> +description("Verify that the custom properties on a Canvas 2D rendering context object are retained across GCs."); + +window.jsTestIsAsync = true; + +if (window.testRunner) { + testRunner.dumpAsText(); + testRunner.waitUntilDone(); +} + +function runTest() { + canvas = document.createElement("canvas"); + context = canvas.getContext("2d"); + context.customProperty = "value"; + shouldBeEqualToString("context.customProperty", "value"); + context = null; + gc(); + context = canvas.getContext("2d"); + shouldBeEqualToString("context.customProperty", "value"); + finishJSTest(); +} + +window.onload = runTest; +</script> +</body> +</html> diff --git a/third_party/WebKit/LayoutTests/fast/canvas/webgl/context-gc-custom-properties-expected.txt b/third_party/WebKit/LayoutTests/fast/canvas/webgl/context-gc-custom-properties-expected.txt new file mode 100644 index 0000000..8824f50 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/canvas/webgl/context-gc-custom-properties-expected.txt @@ -0,0 +1,11 @@ +Verify that the custom properties on a WebGL rendering context object are retained across GCs. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS context.customProperty is "value" +PASS context.customProperty is "value" +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/third_party/WebKit/LayoutTests/fast/canvas/webgl/context-gc-custom-properties.html b/third_party/WebKit/LayoutTests/fast/canvas/webgl/context-gc-custom-properties.html new file mode 100644 index 0000000..590de61 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/canvas/webgl/context-gc-custom-properties.html @@ -0,0 +1,32 @@ +<html> +<head> +<script src="../../../resources/js-test.js"></script> +<script src="resources/webgl-test.js"></script> +</head> +<body> +<script> +description("Verify that the custom properties on a WebGL rendering context object are retained across GCs."); + +window.jsTestIsAsync = true; + +if (window.testRunner) { + testRunner.dumpAsText(); + testRunner.waitUntilDone(); +} + +function runTest() { + canvas = document.createElement("canvas"); + context = create3DContext(canvas); + context.customProperty = "value"; + shouldBeEqualToString("context.customProperty", "value"); + context = null; + gc(); + context = create3DContext(canvas); + shouldBeEqualToString("context.customProperty", "value"); + finishJSTest(); +} + +window.onload = runTest; +</script> +</body> +</html> diff --git a/third_party/WebKit/LayoutTests/fast/dom/gc-9-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/gc-9-expected.txt index 6f49beb..2170e139 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/gc-9-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/gc-9-expected.txt @@ -45,7 +45,7 @@ PASS: document.myCustomProperty should be 1 and is. PASS: document.body.myCustomProperty should be 1 and is. PASS: document.body.attributes.myCustomProperty should be 1 and is. PASS: document.getElementsByTagName('body').myCustomProperty should be 1 and is. -FAIL: document.getElementsByTagName('canvas')[0].getContext('2d').myCustomProperty should be 1 but instead is undefined. +PASS: document.getElementsByTagName('canvas')[0].getContext('2d').myCustomProperty should be 1 and is. PASS: document.getElementsByTagName('canvas')[0].getContext('2d').createLinearGradient(0, 0, 0, 0).myCustomProperty should be undefined and is. PASS: document.getElementsByTagName('canvas')[0].getContext('2d').createPattern(document.getElementsByTagName('canvas')[0], 'no-repeat').myCustomProperty should be undefined and is. PASS: document.getElementsByTagName('select')[0].options.myCustomProperty should be 1 and is. diff --git a/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext2D.idl b/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext2D.idl index 1c9b1a4..9be618e 100644 --- a/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext2D.idl +++ b/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext2D.idl @@ -35,6 +35,7 @@ typedef (HTMLImageElement or enum CanvasFillRule { "nonzero", "evenodd" }; [ + SetWrapperReferenceFrom=canvas, TypeChecking=Interface, WillBeGarbageCollected, ] interface CanvasRenderingContext2D { diff --git a/third_party/WebKit/Source/core/html/canvas/WebGL2RenderingContext.idl b/third_party/WebKit/Source/core/html/canvas/WebGL2RenderingContext.idl index 5a7862b..164b8b7 100644 --- a/third_party/WebKit/Source/core/html/canvas/WebGL2RenderingContext.idl +++ b/third_party/WebKit/Source/core/html/canvas/WebGL2RenderingContext.idl @@ -5,6 +5,7 @@ [ RuntimeEnabled=UnsafeES3APIs, DoNotCheckConstants, + SetWrapperReferenceFrom=canvas, TypeChecking=Interface, WillBeGarbageCollected, ] interface WebGL2RenderingContext { }; diff --git a/third_party/WebKit/Source/core/html/canvas/WebGLRenderingContext.idl b/third_party/WebKit/Source/core/html/canvas/WebGLRenderingContext.idl index 6c12783b..f0eb42f 100644 --- a/third_party/WebKit/Source/core/html/canvas/WebGLRenderingContext.idl +++ b/third_party/WebKit/Source/core/html/canvas/WebGLRenderingContext.idl @@ -27,6 +27,7 @@ [ DoNotCheckConstants, + SetWrapperReferenceFrom=canvas, TypeChecking=Interface, WillBeGarbageCollected, ] interface WebGLRenderingContext { }; |