b=617231 ensure-direction before doing any complex work, and handle mirroring (from harfbuzz ee8aaf976a6e) r=jfkthame a=roc
authorBehdad Esfahbod <behdad@behdad.org>
Thu, 09 Dec 2010 19:46:01 +1300
changeset 58935 0bd4cd152565778060d85170c9eb5e1289df9ef2
parent 58934 b2aeaf724c8d1fa3665074470ef9ff93261dbd85
child 58936 4861b72cc66d76bde7fa0e5ec4ed396b2d9487b0
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersjfkthame, roc
bugs617231
milestone2.0b8pre
b=617231 ensure-direction before doing any complex work, and handle mirroring (from harfbuzz ee8aaf976a6e) r=jfkthame a=roc
gfx/harfbuzz/src/hb-ot-shape.cc
layout/reftests/bidi/reftest.list
--- a/gfx/harfbuzz/src/hb-ot-shape.cc
+++ b/gfx/harfbuzz/src/hb-ot-shape.cc
@@ -188,17 +188,17 @@ hb_reset_glyph_infos (hb_ot_shape_contex
 
 /* Substitute */
 
 static void
 hb_mirror_chars (hb_ot_shape_context_t *c)
 {
   hb_unicode_get_mirroring_func_t get_mirroring = c->buffer->unicode->v.get_mirroring;
 
-  if (HB_DIRECTION_IS_FORWARD (c->buffer->props.direction))
+  if (HB_DIRECTION_IS_FORWARD (c->original_direction))
     return;
 
   hb_mask_t rtlm_mask = c->plan->map.get_1_mask (HB_TAG ('r','t','l','m'));
 
   unsigned int count = c->buffer->len;
   for (unsigned int i = 0; i < count; i++) {
     hb_codepoint_t codepoint = get_mirroring (c->buffer->info[i].codepoint);
     if (likely (codepoint == c->buffer->info[i].codepoint))
@@ -295,27 +295,27 @@ hb_ot_shape_execute_internal (hb_ot_shap
 {
   /* Save the original direction, we use it later. */
   c->original_direction = c->buffer->props.direction;
 
   hb_reset_glyph_infos (c); /* BUFFER: Clear buffer var1 and var2 */
 
   hb_set_unicode_props (c); /* BUFFER: Set general_category and combining_class in var1 */
 
+  hb_ensure_native_direction (c);
+
   hb_form_clusters (c);
 
   hb_ot_shape_setup_masks (c); /* BUFFER: Clobbers var2 */
 
   /* SUBSTITUTE */
   {
     /* Mirroring needs to see the original direction */
     hb_mirror_chars (c);
 
-    hb_ensure_native_direction (c);
-
     hb_substitute_default (c);
 
     hb_ot_substitute_complex (c);
 
     if (!c->applied_substitute_complex)
       hb_substitute_complex_fallback (c);
   }
 
--- a/layout/reftests/bidi/reftest.list
+++ b/layout/reftests/bidi/reftest.list
@@ -15,18 +15,18 @@ random-if(layersGPUAccelerated) == logic
 # test for glyph mirroring in right-to-left text
 == mirroring-01.html mirroring-01-ref.html
 # quote marks are not supposed to mirror, but Unicode 5.0 said they should, so some systems do it
 random-if(cocoaWidget) == mirroring-02.html mirroring-02-ref.html
 == mixedChartype-00.html mixedChartype-00-ref.html
 == mixedChartype-00-j.html mixedChartype-00-ref.html
 == mixedChartype-01.html mixedChartype-01-ref.html
 == mixedChartype-01-j.html mixedChartype-01-ref.html
-random-if(winWidget) == mixedChartype-02.html mixedChartype-02-ref.html
-random-if(winWidget) == mixedChartype-02-j.html mixedChartype-02-ref.html
+== mixedChartype-02.html mixedChartype-02-ref.html
+== mixedChartype-02-j.html mixedChartype-02-ref.html
 == mixedChartype-03.html mixedChartype-03-ref.html
 == mixedChartype-03-j.html mixedChartype-03-ref.html
 == with-first-letter-1a.html with-first-letter-1-ref.html
 == with-first-letter-1b.html with-first-letter-1-ref.html
 == with-first-letter-2a.html with-first-letter-2-ref.html
 == with-first-letter-2b.html with-first-letter-2-ref.html
 == 115921-1.html 115921-1-ref.html
 == 115921-2.html 115921-2-ref.html