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