Skip to content

Commit 638e7c8

Browse files
Closure Teamcopybara-github
Closure Team
authored andcommitted
Update TextMetrics and add CanvasPath.roundRect externs.
PiperOrigin-RevId: 572012068
1 parent d0c9d3d commit 638e7c8

File tree

1 file changed

+66
-7
lines changed

1 file changed

+66
-7
lines changed

externs/browser/html5.js

Lines changed: 66 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,17 @@ CanvasPathMethods.prototype.arcTo = function(x1, y1, x2, y2, radius) {};
277277
*/
278278
CanvasPathMethods.prototype.rect = function(x, y, w, h) {};
279279

280+
/**
281+
* https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/roundRect
282+
* @param {number} x
283+
* @param {number} y
284+
* @param {number} w
285+
* @param {number} h
286+
* @param {(number|!DOMPointInit|!Array<number|!DOMPointInit>)=} radii
287+
* @return {undefined}
288+
*/
289+
CanvasPathMethods.prototype.roundRect = function(x, y, w, h, radii) {};
290+
280291
/**
281292
* @param {number} x
282293
* @param {number} y
@@ -362,6 +373,18 @@ Path2D.prototype.arcTo = function(x1, y1, x2, y2, radius) {};
362373
*/
363374
Path2D.prototype.rect = function(x, y, w, h) {};
364375

376+
/**
377+
* https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/roundRect
378+
* @param {number} x
379+
* @param {number} y
380+
* @param {number} w
381+
* @param {number} h
382+
* @param {(number|!DOMPointInit|!Array<number|!DOMPointInit>)=} radii
383+
* @return {undefined}
384+
* @override
385+
*/
386+
Path2D.prototype.roundRect = function(x, y, w, h, radii) {};
387+
365388
/**
366389
* @param {number} x
367390
* @param {number} y
@@ -660,6 +683,18 @@ BaseRenderingContext2D.prototype.arcTo = function(x1, y1, x2, y2, radius) {};
660683
*/
661684
BaseRenderingContext2D.prototype.rect = function(x, y, w, h) {};
662685

686+
/**
687+
* https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/roundRect
688+
* @param {number} x
689+
* @param {number} y
690+
* @param {number} w
691+
* @param {number} h
692+
* @param {(number|!DOMPointInit|!Array<number|!DOMPointInit>)=} radii
693+
* @return {undefined}
694+
* @override
695+
*/
696+
BaseRenderingContext2D.prototype.roundRect = function(x, y, w, h, radii) {};
697+
663698
/**
664699
* @param {number} x
665700
* @param {number} y
@@ -982,6 +1017,7 @@ function CanvasPattern() {}
9821017

9831018
/**
9841019
* @constructor
1020+
* https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics
9851021
*/
9861022
function TextMetrics() {}
9871023

@@ -1000,6 +1036,27 @@ TextMetrics.prototype.actualBoundingBoxLeft;
10001036
/** @const {number|undefined} */
10011037
TextMetrics.prototype.actualBoundingBoxRight;
10021038

1039+
/** @const {number|undefined} */
1040+
TextMetrics.prototype.fontBoundingBoxAscent;
1041+
1042+
/** @const {number|undefined} */
1043+
TextMetrics.prototype.fontBoundingBoxDescent;
1044+
1045+
/** @const {number|undefined} */
1046+
TextMetrics.prototype.emHeightAscent;
1047+
1048+
/** @const {number|undefined} */
1049+
TextMetrics.prototype.emHeightDescent;
1050+
1051+
/** @const {number|undefined} */
1052+
TextMetrics.prototype.hangingBaseline;
1053+
1054+
/** @const {number|undefined} */
1055+
TextMetrics.prototype.alphabeticBaseline;
1056+
1057+
/** @const {number|undefined} */
1058+
TextMetrics.prototype.ideographicBaseline;
1059+
10031060
/**
10041061
* @param {!Uint8ClampedArray|number} dataOrWidth In the first form, this is the
10051062
* array of pixel data. In the second form, this is the image width.
@@ -6182,15 +6239,17 @@ ElementInternals.prototype.validationMessage;
61826239
/**
61836240
* @return {boolean}
61846241
*/
6185-
ElementInternals.prototype.checkValidity = function() {}
6242+
ElementInternals.prototype.checkValidity =
6243+
function() {}
61866244

6187-
/**
6188-
* @return {boolean}
6189-
*/
6190-
ElementInternals.prototype.reportValidity = function() {}
6245+
/**
6246+
* @return {boolean}
6247+
*/
6248+
ElementInternals.prototype.reportValidity =
6249+
function() {}
61916250

6192-
/** @type {!NodeList<!HTMLLabelElement>} */
6193-
ElementInternals.prototype.labels;
6251+
/** @type {!NodeList<!HTMLLabelElement>} */
6252+
ElementInternals.prototype.labels;
61946253

61956254
/**
61966255
* @see https://html.spec.whatwg.org/multipage/custom-elements.html#the-elementinternals-interface

0 commit comments

Comments
 (0)