[2dcontext-tests] Modify some tests under 2dcontext (#4234)

There are some tests under 2dcontext/ that doesn't reflect the specs.

1. 2d.composite.operation.clear.html
    'clear' is a valid globalCompositeOperation, so assign that should change ctx.globalCompositeOperation to be 'clear'.
    spec for clear mode is here: https://drafts.fxtf.org/compositing/#porterduffcompositingoperators_clear

2. 2d.drawImage.zerocanvas.html
    The spec here: https://html.spec.whatwg.org/multipage/scripting.html#drawing-images, says in step 1, that when source canvas size is 0, "returns bad, then abort these steps without drawing anything", so no exception should be thrown.

3. 2d.drawImage.zerosource.html
    The spec link is the same as the above one. In step 3, it states "If one of the sw or sh arguments is zero, abort these steps. Nothing is painted.", so no exception should be thrown.

Notice that Firefox and Edge is likely to fail under this change.

Please see more detailed discussion here:
https://bugs.chromium.org/p/chromium/issues/detail?id=651741

@RByers @foolip Please review since @junov is on vacation.

View on GitHub: https://github.com/w3c/web-platform-tests/pull/4234

Received on Monday, 21 November 2016 20:45:17 UTC