Auto merge of #26697 - utsavoza:ugo/issue-11681/22-05-2020, r=jdm

Implement CanvasRenderingContext2d.fillText

The PR consists of broadly two main changes:
- Implementation of Canvas2dRenderingContext.font
- Basic implementation of Canvas2dRenderingContext.fillText

Although I am not fully sure about the long term goals for the canvas backend in Servo, I assumed limited scope for font and text handling (should support simple text drawing with font selection) in the current implementation as I believe a more complete implementation would eventually be brought in as a part of #22957.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #11681
- [x] There are tests for these changes
This commit is contained in:
bors-servo 2020-06-12 13:43:51 -04:00 committed by GitHub
commit 721271dcd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
57 changed files with 928 additions and 183 deletions

View file

@ -0,0 +1,2 @@
[canvas_text_font_001.htm]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.text.align.default.html]
[Canvas test: 2d.text.align.default]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.text.align.invalid.html]
[Canvas test: 2d.text.align.invalid]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.text.baseline.default.html]
[Canvas test: 2d.text.baseline.default]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.text.baseline.invalid.html]
[Canvas test: 2d.text.baseline.invalid]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.text.font.default.html]
[Canvas test: 2d.text.font.default]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.text.font.parse.basic.html]
[Canvas test: 2d.text.font.parse.basic]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.text.font.parse.size.percentage.default.html]
[Canvas test: 2d.text.font.parse.size.percentage.default]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.text.font.parse.size.percentage.html]
[Canvas test: 2d.text.font.parse.size.percentage]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.text.font.parse.system.html]
[System fonts must be computed to explicit values]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.text.font.relative_size.html]
[Canvas test: 2d.text.font.relative_size]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.state.saverestore.font.html]
[save()/restore() works for font]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.state.saverestore.textAlign.html]
[save()/restore() works for textAlign]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.state.saverestore.textBaseline.html]
[save()/restore() works for textBaseline]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.text.align.default.html]
[OffscreenCanvas test: 2d.text.align.default]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.text.align.default.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.text.align.invalid.html]
[OffscreenCanvas test: 2d.text.align.invalid]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.text.align.invalid.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.text.baseline.default.html]
[OffscreenCanvas test: 2d.text.baseline.default]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.text.baseline.default.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.text.baseline.invalid.html]
[OffscreenCanvas test: 2d.text.baseline.invalid]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.text.baseline.invalid.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.text.font.default.html]
[OffscreenCanvas test: 2d.text.font.default]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.text.font.default.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.text.font.parse.system.html]
[System fonts must be computed to explicit values]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.text.font.parse.system.worker.html]
[System fonts must be computed to explicit values]
expected: FAIL

View file

@ -0,0 +1,4 @@
[2d.text.font.parse.tiny.html]
[OffscreenCanvas test: 2d.text.font.parse.tiny]
expected: FAIL

View file

@ -0,0 +1,4 @@
[2d.text.font.parse.tiny.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.text.font.relative_size.html]
[OffscreenCanvas test: 2d.text.font.relative_size]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.text.font.relative_size.worker.html]
[2d]
expected: FAIL

View file

@ -110,9 +110,6 @@
[History interface: window.history must inherit property "scrollRestoration" with the proper type]
expected: FAIL
[CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "direction" with the proper type]
expected: FAIL
[ApplicationCache interface: constant UPDATEREADY on interface prototype object]
expected: FAIL
@ -152,9 +149,6 @@
[Navigator interface: attribute hardwareConcurrency]
expected: FAIL
[CanvasRenderingContext2D interface: attribute textAlign]
expected: FAIL
[OffscreenCanvasRenderingContext2D interface: operation restore()]
expected: FAIL
@ -341,9 +335,6 @@
[DataTransfer interface: existence and properties of interface prototype object]
expected: FAIL
[CanvasRenderingContext2D interface: attribute direction]
expected: FAIL
[DataTransferItemList interface: existence and properties of interface object]
expected: FAIL
@ -419,9 +410,6 @@
[SVGElement interface: attribute onsecuritypolicyviolation]
expected: FAIL
[CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "font" with the proper type]
expected: FAIL
[OffscreenCanvasRenderingContext2D interface: operation quadraticCurveTo(unrestricted double, unrestricted double, unrestricted double, unrestricted double)]
expected: FAIL
@ -899,9 +887,6 @@
[ApplicationCache interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[CanvasRenderingContext2D interface: attribute font]
expected: FAIL
[OffscreenCanvas interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
@ -1076,9 +1061,6 @@
[OffscreenCanvasRenderingContext2D interface: operation closePath()]
expected: FAIL
[CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "textAlign" with the proper type]
expected: FAIL
[Path2D interface: operation arcTo(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double)]
expected: FAIL
@ -1136,9 +1118,6 @@
[SVGElement interface: attribute onvolumechange]
expected: FAIL
[CanvasRenderingContext2D interface: attribute textBaseline]
expected: FAIL
[ImageBitmapRenderingContext interface object length]
expected: FAIL
@ -1259,9 +1238,6 @@
[ElementInternals interface: attribute validity]
expected: FAIL
[CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "textBaseline" with the proper type]
expected: FAIL
[SVGElement interface: attribute autofocus]
expected: FAIL

View file

@ -1,5 +0,0 @@
[initial.reset.2dstate.html]
type: testharness
[Resetting the canvas state resets 2D state variables]
expected: FAIL