mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Implement CanvasRenderingContext2d.fillText's "unimplemented" message
This commit is contained in:
parent
1c9c0334ba
commit
2af828485f
6 changed files with 35 additions and 3 deletions
|
@ -800,6 +800,13 @@ impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D {
|
|||
receiver.recv().unwrap()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-filltext
|
||||
fn FillText(&self, text: DOMString, x: f64, y: f64, max_width: Option<f64>) {
|
||||
let parsed_text: String = text.into();
|
||||
self.ipc_renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::FillText(parsed_text, x, y, max_width))).unwrap();
|
||||
self.mark_as_dirty();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-drawimage
|
||||
fn DrawImage(&self,
|
||||
image: CanvasImageSource,
|
||||
|
|
|
@ -153,8 +153,9 @@ interface CanvasUserInterface {
|
|||
[NoInterfaceObject]
|
||||
interface CanvasText {
|
||||
// text (see also the CanvasDrawingStyles interface)
|
||||
//void fillText(DOMString text, unrestricted double x, unrestricted double y,
|
||||
// optional unrestricted double maxWidth);
|
||||
[Pref="dom.canvas-text.enabled"]
|
||||
void fillText(DOMString text, unrestricted double x, unrestricted double y,
|
||||
optional unrestricted double maxWidth);
|
||||
//void strokeText(DOMString text, unrestricted double x, unrestricted double y,
|
||||
// optional unrestricted double maxWidth);
|
||||
//TextMetrics measureText(DOMString text);
|
||||
|
@ -264,4 +265,3 @@ interface CanvasPath {
|
|||
// double rotation, double startAngle, double endAngle,
|
||||
// boolean anticlockwise);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue