summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.idl
blob: 29a3d061aea81e5ce9aa443ad42cd5e90da8b8cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Note: The official spec is WIP at wiki.whatwg.org/wiki/OffscreenCanvas.

[
    GarbageCollected,
    Exposed=(Window,Worker),
    RuntimeEnabled=ExperimentalCanvasFeatures,
] interface OffscreenCanvasRenderingContext2D {
    // back-reference to the canvas
    [ImplementedAs=getOffscreenCanvas] readonly attribute OffscreenCanvas offscreenCanvas;

    // colors and styles (see also the CanvasDrawingStyles interface)
    attribute (DOMString or CanvasGradient or CanvasPattern) strokeStyle; // (default black)
    attribute (DOMString or CanvasGradient or CanvasPattern) fillStyle; // (default black)

    //CanvasRect interface
    void clearRect(unrestricted double x, unrestricted double y, unrestricted double width, unrestricted double height);
    void fillRect(unrestricted double x, unrestricted double y, unrestricted double width, unrestricted double height);
    void strokeRect(unrestricted double x, unrestricted double y, unrestricted double width, unrestricted double height);
};

OffscreenCanvasRenderingContext2D implements CanvasPathMethods;