mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 15:28:39 +09:00
Issue #2087 - Don't throw on lacking PresShell in SetFontInternal
In CanvasRenderingContext2D::SetFontInternal, we should not throw if there is no PresShell due to (sandboxed/hidden) iframe use that has not initialized its presentation yet at the time of property manipulation. This removes the throwing of the error and just silently fails. Resolves #2087
This commit is contained in:
parent
2f7f622cd4
commit
efeb0e3e97
1 changed files with 5 additions and 1 deletions
|
|
@ -3758,7 +3758,11 @@ CanvasRenderingContext2D::SetFontInternal(const nsAString& aFont,
|
|||
|
||||
nsCOMPtr<nsIPresShell> presShell = GetPresShell();
|
||||
if (!presShell) {
|
||||
aError.Throw(NS_ERROR_FAILURE);
|
||||
// Do not throw here. We may be in a situation where we're loading in an iframe
|
||||
// that is sandboxed, and/or initially hidden with display:none, in which case
|
||||
// we don't want to throw an error but silently fail.
|
||||
// If we don't do this, JS trying to set context.font to something will abort,
|
||||
// breaking e.g. third party serviced graphs.
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue