You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Symptom:
A blank page after the initial loading screen with Uncaught TypeError: CanvasRenderingContext2D.createLinearGradient: Argument 2 is not a finite floating-point value.
in the console.
Root cause CanvasFont's top and bottom attribute are determined by TextMetrics.fontBoundingBoxAscend/Descend.
This is an experimental feature that is disabled by default for some browsers (e.g. Waterfox). If they are disabled, the Javascript-Structure for TextMetrics does not contain fontBoundingBoxAscend/Descend properties.
As a result top and bottom are populated with NaNs. These values are eventually used to set the y-bounds on a CanvasLabel which will be passed to createLinearGradient.
Workaround
Set dom.textMetrics.fontBoundingBox.enabled in about:config to true.
Comments
The easiest solution would be to set top and bottom to 0 if they are NaN. Optionally, fall back on actualBoundingBoxAscend/Descend beforehand which seem to be enabled by default on a lot more browsers. The FIXME above these calls suggests that it shouldn't be done like that anyway. Let me know if I should proceed with the simple fix as a PR or if a more elaborate fix is preferred.
The text was updated successfully, but these errors were encountered:
Symptom:
A blank page after the initial loading screen with
Uncaught TypeError: CanvasRenderingContext2D.createLinearGradient: Argument 2 is not a finite floating-point value.
in the console.
Steps to reproduce
Using Waterfox as the browser, open https://one.livesplit.org/
Alternatively, disable
dom.textMetrics.fontBoundingBox.enabled
inabout:config
and open https://one.livesplit.org/Root cause
CanvasFont
'stop
andbottom
attribute are determined by TextMetrics.fontBoundingBoxAscend/Descend.This is an experimental feature that is disabled by default for some browsers (e.g. Waterfox). If they are disabled, the Javascript-Structure for TextMetrics does not contain
fontBoundingBoxAscend/Descend
properties.As a result
top
andbottom
are populated withNaN
s. These values are eventually used to set the y-bounds on a CanvasLabel which will be passed to createLinearGradient.Workaround
Set
dom.textMetrics.fontBoundingBox.enabled
inabout:config
totrue
.Comments
The easiest solution would be to set
top
andbottom
to 0 if they are NaN. Optionally, fall back onactualBoundingBoxAscend/Descend
beforehand which seem to be enabled by default on a lot more browsers. The FIXME above these calls suggests that it shouldn't be done like that anyway. Let me know if I should proceed with the simple fix as a PR or if a more elaborate fix is preferred.The text was updated successfully, but these errors were encountered: