Index: Source/platform/fonts/Font.cpp |
diff --git a/Source/platform/fonts/Font.cpp b/Source/platform/fonts/Font.cpp |
index da2d97d73f3d537852b1944d48a89215ad415429..e468bfd0472d61195dfbffcb59f969a3756e7d1f 100644 |
--- a/Source/platform/fonts/Font.cpp |
+++ b/Source/platform/fonts/Font.cpp |
@@ -256,8 +256,12 @@ float Font::width(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFo |
return result; |
} |
-static bool requiresRecomputingBounds(const Font& font) |
+static bool requiresRecomputingBounds(const Font& font, const FloatRect& bounds) |
{ |
+ // Blobs should never have empty bounds, but see http://crbug.com/445527 |
+ if (bounds.isEmpty()) |
+ return true; |
+ |
const FontDescription& fontDescription = font.fontDescription(); |
return fontDescription.letterSpacing() < 0 || fontDescription.wordSpacing() < 0; |
} |
@@ -271,7 +275,7 @@ PassTextBlobPtr Font::buildTextBlob(const GlyphBuffer& glyphBuffer, const FloatR |
SkRect skBounds = bounds; |
// FIXME: Identify these cases earlier on and avoid using bounds that are |
// not visually correct in other places. |
- const SkRect* skBoundsPtr = requiresRecomputingBounds(*this) ? nullptr : &skBounds; |
+ const SkRect* skBoundsPtr = requiresRecomputingBounds(*this, bounds) ? nullptr : &skBounds; |
bool hasVerticalOffsets = glyphBuffer.hasVerticalOffsets(); |
unsigned i = 0; |