In the method WebGL<T>Array.set(WebGL<T>Array, offset) it is possible for the source and destination arrays to overlap the same region in the WebGLArrayBuffer. Per the revised spec, we need to implement memmove semantics for this case and write tests for it.
Created attachment 51544 [details] patch
Created attachment 51546 [details] revised patch: tiny fix
Comment on attachment 51546 [details] revised patch: tiny fix Your ChangeLog should really explain *why* this is a good idea.
Created attachment 51655 [details] revised patch: add explanation in the changeLog.
Comment on attachment 51655 [details] revised patch: add explanation in the changeLog. Looks good overall. One comment on the test case. > Index: LayoutTests/fast/canvas/webgl/array-setters.html > =================================================================== > --- LayoutTests/fast/canvas/webgl/array-setters.html (revision 56446) > +++ LayoutTests/fast/canvas/webgl/array-setters.html (working copy) > @@ -39,6 +39,29 @@ function testSetters(typeName, low, high > webGLArray.set(1, array[1]); > shouldBe("webGLArray[1]", "array[1]"); > shouldBe("webGLArray.get(1)", "array[1]"); > + > + // Verify set() behaves correctly with shared underlying buffer. > + array = [0, 1, 2, 3, 4, 5]; > + webGLArray = new type(6); > + webGLArray.set(array); > + array = webGLArray.slice(2, 4); > + array[0] = 88; > + array[1] = 99; > + shouldBe("webGLArray[2]", "88"); > + shouldBe("webGLArray[3]", "99"); > + // pre-overlap > + webGLArray.set(array, 1); > + shouldBe("webGLArray[1]", "88"); > + shouldBe("webGLArray[2]", "99"); > + shouldBe("array[0]", "99"); > + shouldBe("array[1]", "99"); > + array[1] = 77; > + // post-overlap > + webGLArray.set(array, 3); > + shouldBe("webGLArray[3]", "99"); > + shouldBe("webGLArray[4]", "77"); > + shouldBe("array[0]", "99"); > + shouldBe("array[0]", "99"); The line above looks like a typo. Should it be verifying array[1]?
Created attachment 52113 [details] revised patch : fixed the typo Ken Russell pointed out
Comment on attachment 52113 [details] revised patch : fixed the typo Ken Russell pointed out Looks good.
Comment on attachment 52113 [details] revised patch : fixed the typo Ken Russell pointed out r=me
Comment on attachment 52113 [details] revised patch : fixed the typo Ken Russell pointed out Clearing flags on attachment: 52113 Committed r56833: <http://trac.webkit.org/changeset/56833>
All reviewed patches have been landed. Closing bug.