Auto merge of #24261 - paulrouget:fakeMeasureTExt, r=jdm

Temporary implementation of Canvas.MeasureText

@jdm: that will help with the babylonjs demos. Another approach is to implement that in JS and add it to the demos.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24261)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-09-25 11:38:36 -04:00 committed by GitHub
commit cf725fc3f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 207 additions and 122 deletions

View file

@ -140,9 +140,6 @@
[ApplicationCache interface: attribute onprogress]
expected: FAIL
[CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "measureText(DOMString)" with the proper type]
expected: FAIL
[SVGElement interface: attribute ondragleave]
expected: FAIL
@ -233,12 +230,6 @@
[ElementInternals interface: operation setFormValue([object Object\],[object Object\],[object Object\], [object Object\],[object Object\],[object Object\])]
expected: FAIL
[TextMetrics interface object length]
expected: FAIL
[CanvasRenderingContext2D interface: operation measureText(DOMString)]
expected: FAIL
[CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "strokeText(DOMString, unrestricted double, unrestricted double, unrestricted double)" with the proper type]
expected: FAIL
@ -254,9 +245,6 @@
[SVGElement interface: operation blur()]
expected: FAIL
[TextMetrics interface: attribute ideographicBaseline]
expected: FAIL
[OffscreenCanvasRenderingContext2D interface: operation beginPath()]
expected: FAIL
@ -305,9 +293,6 @@
[MessageEvent interface: new MessageEvent("message", { data: 5 }) must inherit property "ports" with the proper type]
expected: FAIL
[TextMetrics interface: attribute emHeightDescent]
expected: FAIL
[Location interface: window.location must have own property "ancestorOrigins"]
expected: FAIL
@ -428,9 +413,6 @@
[MessageChannel interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[TextMetrics interface: attribute actualBoundingBoxAscent]
expected: FAIL
[ValidityState interface: document.createElement("input").validity must inherit property "tooShort" with the proper type]
expected: FAIL
@ -446,9 +428,6 @@
[ImageBitmap interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[TextMetrics interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[DataTransfer interface: attribute items]
expected: FAIL
@ -689,9 +668,6 @@
[Path2D interface: operation rect(unrestricted double, unrestricted double, unrestricted double, unrestricted double)]
expected: FAIL
[TextMetrics interface: attribute actualBoundingBoxDescent]
expected: FAIL
[DataTransferItem interface object name]
expected: FAIL
@ -707,9 +683,6 @@
[OffscreenCanvasRenderingContext2D interface: operation isPointInPath(unrestricted double, unrestricted double, CanvasFillRule)]
expected: FAIL
[TextMetrics interface: attribute actualBoundingBoxLeft]
expected: FAIL
[DataTransfer interface: attribute dropEffect]
expected: FAIL
@ -890,9 +863,6 @@
[Navigator interface: operation unregisterProtocolHandler(DOMString, USVString)]
expected: FAIL
[TextMetrics interface: existence and properties of interface object]
expected: FAIL
[ValidityState interface: document.createElement("input").validity must inherit property "customError" with the proper type]
expected: FAIL
@ -1010,9 +980,6 @@
[ApplicationCache interface: window.applicationCache must inherit property "onprogress" with the proper type]
expected: FAIL
[TextMetrics interface: attribute hangingBaseline]
expected: FAIL
[CanvasRenderingContext2D interface: operation setTransform(DOMMatrix2DInit)]
expected: FAIL
@ -1031,9 +998,6 @@
[SVGElement interface: attribute onselect]
expected: FAIL
[TextMetrics interface: attribute width]
expected: FAIL
[ApplicationCache interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
@ -1058,9 +1022,6 @@
[External interface: operation IsSearchProviderInstalled()]
expected: FAIL
[TextMetrics interface: attribute actualBoundingBoxRight]
expected: FAIL
[SVGElement interface: attribute onkeydown]
expected: FAIL
@ -1082,9 +1043,6 @@
[SharedWorker interface: existence and properties of interface prototype object]
expected: FAIL
[TextMetrics interface: attribute fontBoundingBoxAscent]
expected: FAIL
[MessageChannel interface: existence and properties of interface prototype object]
expected: FAIL
@ -1100,9 +1058,6 @@
[History interface: attribute scrollRestoration]
expected: FAIL
[CanvasRenderingContext2D interface: calling measureText(DOMString) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError]
expected: FAIL
[ImageBitmap interface: attribute height]
expected: FAIL
@ -1127,9 +1082,6 @@
[OffscreenCanvasRenderingContext2D interface: operation strokeText(DOMString, unrestricted double, unrestricted double, unrestricted double)]
expected: FAIL
[TextMetrics interface: attribute alphabeticBaseline]
expected: FAIL
[OffscreenCanvasRenderingContext2D interface: operation stroke(Path2D)]
expected: FAIL
@ -1151,9 +1103,6 @@
[SVGElement interface: operation focus(FocusOptions)]
expected: FAIL
[TextMetrics interface: existence and properties of interface prototype object]
expected: FAIL
[ApplicationCache interface: window.applicationCache must inherit property "UNCACHED" with the proper type]
expected: FAIL
@ -1208,9 +1157,6 @@
[WebSocket interface: new WebSocket("wss://nonexistent.web-platform.test") must inherit property "extensions" with the proper type]
expected: FAIL
[TextMetrics interface: attribute fontBoundingBoxDescent]
expected: FAIL
[ApplicationCache must be primary interface of window.applicationCache]
expected: FAIL
@ -1313,9 +1259,6 @@
[ImageBitmapRenderingContext interface: existence and properties of interface prototype object]
expected: FAIL
[TextMetrics interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[DataTransfer interface: attribute effectAllowed]
expected: FAIL
@ -1490,12 +1433,6 @@
[OffscreenCanvasRenderingContext2D interface: operation clip(CanvasFillRule)]
expected: FAIL
[TextMetrics interface: attribute emHeightAscent]
expected: FAIL
[TextMetrics interface object name]
expected: FAIL
[External interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL

View file

@ -98,12 +98,6 @@
[SharedWorker interface: existence and properties of interface object]
expected: FAIL
[TextMetrics interface object length]
expected: FAIL
[TextMetrics interface: attribute emHeightAscent]
expected: FAIL
[WorkerGlobalScope interface: self must inherit property "ononline" with the proper type]
expected: FAIL
@ -116,9 +110,6 @@
[DedicatedWorkerGlobalScope interface: calling requestAnimationFrame(FrameRequestCallback) on self with too few arguments must throw TypeError]
expected: FAIL
[TextMetrics interface: attribute ideographicBaseline]
expected: FAIL
[OffscreenCanvasRenderingContext2D interface: operation beginPath()]
expected: FAIL
@ -173,9 +164,6 @@
[MessageChannel interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[TextMetrics interface: attribute actualBoundingBoxAscent]
expected: FAIL
[OffscreenCanvasRenderingContext2D interface: operation bezierCurveTo(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double)]
expected: FAIL
@ -191,9 +179,6 @@
[ImageBitmap interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[TextMetrics interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[MessagePort interface: existence and properties of interface object]
expected: FAIL
@ -236,9 +221,6 @@
[Path2D interface object length]
expected: FAIL
[TextMetrics interface: attribute emHeightDescent]
expected: FAIL
[WorkerGlobalScope interface: operation createImageBitmap(ImageBitmapSource, ImageBitmapOptions)]
expected: FAIL
@ -311,9 +293,6 @@
[Path2D interface: operation rect(unrestricted double, unrestricted double, unrestricted double, unrestricted double)]
expected: FAIL
[TextMetrics interface: attribute actualBoundingBoxDescent]
expected: FAIL
[Path2D interface: operation arc(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, boolean)]
expected: FAIL
@ -323,9 +302,6 @@
[OffscreenCanvasRenderingContext2D interface: existence and properties of interface prototype object]
expected: FAIL
[TextMetrics interface: attribute actualBoundingBoxLeft]
expected: FAIL
[DedicatedWorkerGlobalScope interface: internal [[SetPrototypeOf\]\] method of interface prototype object - setting to a new value via __proto__ should throw a TypeError]
expected: FAIL
@ -392,9 +368,6 @@
[OffscreenCanvasRenderingContext2D interface: operation isPointInPath(Path2D, unrestricted double, unrestricted double, CanvasFillRule)]
expected: FAIL
[TextMetrics interface: existence and properties of interface object]
expected: FAIL
[DedicatedWorkerGlobalScope interface: self must inherit property "name" with the proper type]
expected: FAIL
@ -440,9 +413,6 @@
[OffscreenCanvas interface object length]
expected: FAIL
[TextMetrics interface: attribute hangingBaseline]
expected: FAIL
[ImageBitmapRenderingContext interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
@ -452,18 +422,9 @@
[WorkerGlobalScope interface: attribute onoffline]
expected: FAIL
[TextMetrics interface: attribute width]
expected: FAIL
[Path2D interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[TextMetrics interface: attribute actualBoundingBoxRight]
expected: FAIL
[TextMetrics interface: attribute fontBoundingBoxAscent]
expected: FAIL
[MessageChannel interface: existence and properties of interface prototype object]
expected: FAIL
@ -485,9 +446,6 @@
[SharedWorker interface: existence and properties of interface prototype object]
expected: FAIL
[TextMetrics interface: attribute alphabeticBaseline]
expected: FAIL
[DedicatedWorkerGlobalScope interface: internal [[SetPrototypeOf\]\] method of interface prototype object - setting to a new value via Object.setPrototypeOf should throw a TypeError]
expected: FAIL
@ -497,9 +455,6 @@
[ImageBitmap interface: operation close()]
expected: FAIL
[TextMetrics interface: existence and properties of interface prototype object]
expected: FAIL
[OffscreenCanvasRenderingContext2D interface: operation fill(Path2D, CanvasFillRule)]
expected: FAIL
@ -527,9 +482,6 @@
[MessageEvent interface: new MessageEvent("message", { data: 5 }) must inherit property "ports" with the proper type]
expected: FAIL
[TextMetrics interface: attribute fontBoundingBoxDescent]
expected: FAIL
[WorkerGlobalScope interface: attribute ononline]
expected: FAIL
@ -587,9 +539,6 @@
[OffscreenCanvasRenderingContext2D interface: operation arc(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, boolean)]
expected: FAIL
[TextMetrics interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[SharedWorker interface: attribute onerror]
expected: FAIL
@ -683,9 +632,6 @@
[OffscreenCanvasRenderingContext2D interface: operation clip(CanvasFillRule)]
expected: FAIL
[TextMetrics interface object name]
expected: FAIL
[MessageEvent interface: new MessageEvent("message", { data: 5 }) must inherit property "source" with the proper type]
expected: FAIL

View file

@ -66,6 +66,3 @@
[The IDBTransaction interface object should be exposed.]
expected: FAIL
[The TextMetrics interface object should be exposed.]
expected: FAIL

View file

@ -18960,7 +18960,7 @@
"testharness"
],
"mozilla/interfaces.js": [
"6f2a54524ef317a48d758f7e50f742fd9b3a93e4",
"26db0c23e544d38f02b9573ffaa44bf5dee8370a",
"support"
],
"mozilla/interfaces.worker.js": [

View file

@ -38,6 +38,7 @@ function test_interfaces(interfaceNamesInGlobalScope) {
"String",
"Symbol",
"SyntaxError",
"TextMetrics",
"TypeError",
"URIError",
"Uint16Array",