mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 745699 - canvas2d rendering context needs to call gfxFontGroup::UpdateFontList() before MakeTextRun() to ensure user font generation is up to date. r=roc a=blassey
This commit is contained in:
parent
231fe37109
commit
4ae6a27c36
25
content/canvas/crashtests/745699-1.html
Normal file
25
content/canvas/crashtests/745699-1.html
Normal file
@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: "z";
|
||||
src: url(invalid);
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
function boom()
|
||||
{
|
||||
var ctx = document.querySelector("canvas").getContext('2d');
|
||||
ctx.font = "10px serif";
|
||||
document.querySelector("style").appendChild(document.createTextNode(" "));
|
||||
ctx.measureText("123");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="boom();">
|
||||
<canvas width="100" height="100"></canvas>
|
||||
</body>
|
||||
</html>
|
@ -5,3 +5,4 @@ load 647480.html
|
||||
load 0px-size-font-667225.html
|
||||
load texImage2D.html
|
||||
load 729116.html
|
||||
load 745699-1.html
|
||||
|
@ -2753,6 +2753,7 @@ struct NS_STACK_CLASS nsCanvasBidiProcessor : public nsBidiPresUtils::BidiProces
|
||||
{
|
||||
virtual void SetText(const PRUnichar* text, PRInt32 length, nsBidiDirection direction)
|
||||
{
|
||||
mFontgrp->UpdateFontList(); // ensure user font generation is current
|
||||
mTextRun = mFontgrp->MakeTextRun(text,
|
||||
length,
|
||||
mThebes,
|
||||
@ -3149,6 +3150,7 @@ nsCanvasRenderingContext2D::MakeTextRun(const PRUnichar* aText,
|
||||
gfxFontGroup* currentFontStyle = GetCurrentFontStyle();
|
||||
if (!currentFontStyle)
|
||||
return nsnull;
|
||||
currentFontStyle->UpdateFontList(); // ensure user font generation is current
|
||||
return currentFontStyle->MakeTextRun(aText, aLength,
|
||||
mThebes, aAppUnitsPerDevUnit, aFlags);
|
||||
}
|
||||
|
@ -2970,6 +2970,7 @@ struct NS_STACK_CLASS nsCanvasBidiProcessorAzure : public nsBidiPresUtils::BidiP
|
||||
|
||||
virtual void SetText(const PRUnichar* text, PRInt32 length, nsBidiDirection direction)
|
||||
{
|
||||
mFontgrp->UpdateFontList(); // ensure user font generation is current
|
||||
mTextRun = mFontgrp->MakeTextRun(text,
|
||||
length,
|
||||
mThebes,
|
||||
|
Loading…
Reference in New Issue
Block a user