mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Partial fix for #12415: expose Canvas interfaces
This commit is contained in:
parent
1a3287bef7
commit
df8030c50d
6 changed files with 15 additions and 36 deletions
|
@ -3,7 +3,6 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#canvasgradient
|
||||
[Exposed=(Window,Worker)]
|
||||
interface CanvasGradient {
|
||||
// opaque object
|
||||
[Throws]
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#canvaspattern
|
||||
|
||||
[Exposed=(Window,Worker)]
|
||||
interface CanvasPattern {
|
||||
//void setTransform(SVGMatrix matrix);
|
||||
};
|
||||
|
|
|
@ -12,7 +12,6 @@ typedef (HTMLImageElement or
|
|||
ImageBitmap */) CanvasImageSource;
|
||||
|
||||
//[Constructor(optional unsigned long width, unsigned long height)]
|
||||
[Exposed=(Window,Worker)]
|
||||
interface CanvasRenderingContext2D {
|
||||
|
||||
// back-reference to the canvas
|
||||
|
@ -42,14 +41,14 @@ CanvasRenderingContext2D implements CanvasPathDrawingStyles;
|
|||
CanvasRenderingContext2D implements CanvasTextDrawingStyles;
|
||||
CanvasRenderingContext2D implements CanvasPath;
|
||||
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
[NoInterfaceObject]
|
||||
interface CanvasState {
|
||||
// state
|
||||
void save(); // push state on state stack
|
||||
void restore(); // pop state stack and restore state
|
||||
};
|
||||
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
[NoInterfaceObject]
|
||||
interface CanvasTransform {
|
||||
// transformations (default transform is the identity matrix)
|
||||
void scale(unrestricted double x, unrestricted double y);
|
||||
|
@ -73,21 +72,21 @@ interface CanvasTransform {
|
|||
void resetTransform();
|
||||
};
|
||||
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
[NoInterfaceObject]
|
||||
interface CanvasCompositing {
|
||||
// compositing
|
||||
attribute unrestricted double globalAlpha; // (default 1.0)
|
||||
attribute DOMString globalCompositeOperation; // (default source-over)
|
||||
};
|
||||
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
[NoInterfaceObject]
|
||||
interface CanvasImageSmoothing {
|
||||
// image smoothing
|
||||
attribute boolean imageSmoothingEnabled; // (default true)
|
||||
// attribute ImageSmoothingQuality imageSmoothingQuality; // (default low)
|
||||
};
|
||||
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
[NoInterfaceObject]
|
||||
interface CanvasFillStrokeStyles {
|
||||
|
||||
// colours and styles (see also the CanvasDrawingStyles interface)
|
||||
|
@ -100,7 +99,7 @@ interface CanvasFillStrokeStyles {
|
|||
CanvasPattern createPattern(CanvasImageSource image, [TreatNullAs=EmptyString] DOMString repetition);
|
||||
};
|
||||
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
[NoInterfaceObject]
|
||||
interface CanvasShadowStyles {
|
||||
// shadows
|
||||
attribute unrestricted double shadowOffsetX; // (default 0)
|
||||
|
@ -109,7 +108,7 @@ interface CanvasShadowStyles {
|
|||
attribute DOMString shadowColor; // (default transparent black)
|
||||
};
|
||||
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
[NoInterfaceObject]
|
||||
interface CanvasRect {
|
||||
// rects
|
||||
//[LenientFloat]
|
||||
|
@ -120,7 +119,7 @@ interface CanvasRect {
|
|||
void strokeRect(unrestricted double x, unrestricted double y, unrestricted double w, unrestricted double h);
|
||||
};
|
||||
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
[NoInterfaceObject]
|
||||
interface CanvasDrawPath {
|
||||
// path API (see also CanvasPathMethods)
|
||||
void beginPath();
|
||||
|
@ -143,12 +142,12 @@ interface CanvasDrawPath {
|
|||
//boolean isPointInStroke(Path2D path, unrestricted double x, unrestricted double y);
|
||||
};
|
||||
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
[NoInterfaceObject]
|
||||
interface CanvasUserInterface {
|
||||
// TODO?
|
||||
};
|
||||
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
[NoInterfaceObject]
|
||||
interface CanvasText {
|
||||
// text (see also the CanvasDrawingStyles interface)
|
||||
//void fillText(DOMString text, unrestricted double x, unrestricted double y,
|
||||
|
@ -158,7 +157,7 @@ interface CanvasText {
|
|||
//TextMetrics measureText(DOMString text);
|
||||
};
|
||||
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
[NoInterfaceObject]
|
||||
interface CanvasDrawImage {
|
||||
// drawing images
|
||||
[Throws]
|
||||
|
@ -173,7 +172,7 @@ interface CanvasDrawImage {
|
|||
unrestricted double dw, unrestricted double dh);
|
||||
};
|
||||
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
[NoInterfaceObject]
|
||||
interface CanvasHitRegion {
|
||||
// hit regions
|
||||
//void addHitRegion(optional HitRegionOptions options);
|
||||
|
@ -181,7 +180,7 @@ interface CanvasHitRegion {
|
|||
//void clearHitRegions();
|
||||
};
|
||||
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
[NoInterfaceObject]
|
||||
interface CanvasImageData {
|
||||
// pixel manipulation
|
||||
[Throws]
|
||||
|
@ -206,7 +205,7 @@ enum CanvasTextAlign { "start", "end", "left", "right", "center" };
|
|||
enum CanvasTextBaseline { "top", "hanging", "middle", "alphabetic", "ideographic", "bottom" };
|
||||
enum CanvasDirection { "ltr", "rtl", "inherit" };
|
||||
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
[NoInterfaceObject]
|
||||
interface CanvasPathDrawingStyles {
|
||||
// line caps/joins
|
||||
attribute unrestricted double lineWidth; // (default 1)
|
||||
|
@ -220,7 +219,7 @@ interface CanvasPathDrawingStyles {
|
|||
//attribute unrestricted double lineDashOffset;
|
||||
};
|
||||
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
[NoInterfaceObject]
|
||||
interface CanvasTextDrawingStyles {
|
||||
// text
|
||||
//attribute DOMString font; // (default 10px sans-serif)
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
// https://html.spec.whatwg.org/multipage/#htmlcanvaselement
|
||||
typedef (CanvasRenderingContext2D or WebGLRenderingContext) RenderingContext;
|
||||
|
||||
[Exposed=(Window,Worker)]
|
||||
interface HTMLCanvasElement : HTMLElement {
|
||||
[Pure]
|
||||
attribute unsigned long width;
|
||||
|
|
|
@ -9,21 +9,9 @@
|
|||
[The DOMImplementation interface object should not be exposed.]
|
||||
expected: FAIL
|
||||
|
||||
[The HTMLCanvasElement interface object should not be exposed.]
|
||||
expected: FAIL
|
||||
|
||||
[The MouseEvent interface object should not be exposed.]
|
||||
expected: FAIL
|
||||
|
||||
[The CanvasRenderingContext2D interface object should not be exposed.]
|
||||
expected: FAIL
|
||||
|
||||
[The CanvasGradient interface object should not be exposed.]
|
||||
expected: FAIL
|
||||
|
||||
[The CanvasPattern interface object should not be exposed.]
|
||||
expected: FAIL
|
||||
|
||||
[The PopStateEvent interface object should not be exposed.]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -10,9 +10,6 @@ test_interfaces([
|
|||
"Attr",
|
||||
"BeforeUnloadEvent",
|
||||
"Blob",
|
||||
"CanvasGradient",
|
||||
"CanvasRenderingContext2D",
|
||||
"CanvasPattern",
|
||||
"CharacterData",
|
||||
"CloseEvent",
|
||||
"CSS",
|
||||
|
@ -45,7 +42,6 @@ test_interfaces([
|
|||
"HashChangeEvent",
|
||||
"Headers",
|
||||
"History",
|
||||
"HTMLCanvasElement",
|
||||
"HTMLCollection",
|
||||
"HTMLElement",
|
||||
"HTMLFormControlsCollection",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue