diff --git a/components/gfx/text/glyph.rs b/components/gfx/text/glyph.rs index 5ebd33916e8..c5f803ca673 100644 --- a/components/gfx/text/glyph.rs +++ b/components/gfx/text/glyph.rs @@ -156,8 +156,11 @@ fn is_simple_glyph_id(id: GlyphId) -> bool { } fn is_simple_advance(advance: Au) -> bool { - let unsigned_au = advance.to_u32().unwrap(); - (unsigned_au & (GLYPH_ADVANCE_MASK >> GLYPH_ADVANCE_SHIFT as uint)) == unsigned_au + match advance.to_u32() { + Some(unsigned_au) => + (unsigned_au & (GLYPH_ADVANCE_MASK >> GLYPH_ADVANCE_SHIFT as uint)) == unsigned_au, + None => false + } } type DetailedGlyphCount = u16; diff --git a/tests/ref/basic.list b/tests/ref/basic.list index c66e6750ad5..3bbfc9c52d3 100644 --- a/tests/ref/basic.list +++ b/tests/ref/basic.list @@ -102,6 +102,7 @@ flaky_cpu == append_style_a.html append_style_b.html == floated_generated_content_a.html floated_generated_content_b.html == floated_list_item_a.html floated_list_item_ref.html == floated_table_with_margin_a.html floated_table_with_margin_ref.html +== font_advance.html font_advance_ref.html == font_size.html font_size_ref.html == font_style.html font_style_ref.html == height_compute_reset.html height_compute.html diff --git a/tests/ref/font_advance.html b/tests/ref/font_advance.html new file mode 100644 index 00000000000..91d871a656e --- /dev/null +++ b/tests/ref/font_advance.html @@ -0,0 +1,2 @@ + +a