GraphicsLayer: add destructor calling teardown method.

Fix some crashes, memory leaks, and asserts in debug mode.
Avoid re-parsing URL.

We already did it earlier in that function.
Remove name of unused parameter.

Avoids a warning.
Add a TODO about handling different gradient types.

The gradient may pad (first and last colors extend infinitely), repeat,
or reflect. We only handle the first case.
ImageBuffer: don't crash on null size.

The ImageBufferData constructor can be called with an empty size (0,0).
This leads to creating an invalid bitmap, and attempts to draw to it
would crash. Replace asserts with runtime checks where appropriate.

Thanks Diver for reporting a reproductible test case!
Early web inspector support.

Not working, yet, it just opens a white page.