Bug 655877 - Part 44: Fix some bidi tests whose rendering behavior has changed a bit with the new SVG text support. r=smontagu
☠☠ backed out by c1b8d9b1b7f0 ☠ ☠
authorCameron McCormack <cam@mcc.id.au>
Fri, 28 Sep 2012 17:17:29 +1000
changeset 114718 6786b5f4ee4a79d22df9cc6931a36f1f99ca81be
parent 114717 a2a509184b0779808ec305b64b321bda419a1b2b
child 114719 96faff88d7928f0c85de918de6a5e1b8677fc31c
push id1708
push userakeybl@mozilla.com
push dateMon, 19 Nov 2012 21:10:21 +0000
treeherdermozilla-beta@27b14fe50103 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmontagu
bugs655877
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 655877 - Part 44: Fix some bidi tests whose rendering behavior has changed a bit with the new SVG text support. r=smontagu
layout/reftests/bidi/bidiMirroring-ref.svg
layout/reftests/bidi/bidiMirroring.js
layout/reftests/bidi/bidiMirroring.svg
layout/reftests/bidi/bidiSVG-03-ref.svg
layout/reftests/bidi/bidiSVG-03.svg
layout/reftests/bidi/bidiSVG-04-ref.svg
layout/reftests/bidi/reftest.list
layout/reftests/fonts/BitPattern.woff
layout/reftests/fonts/generate-bitpattern-font.pl
--- a/layout/reftests/bidi/bidiMirroring-ref.svg
+++ b/layout/reftests/bidi/bidiMirroring-ref.svg
@@ -1,14 +1,8 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="520">
-  <text x="100" y="40" direction="ltr" unicode-bidi="embed">&#x169B;&#x169C;&#x0F3C;&#x0F3D;&#x0F3A;&#x0F3B;&#x00AB;&#x00BB;&#x007B;&#x007D;&#x005B;&#x005D;&#x003C;&#x003E;&#x0028;&#x0029;</text>
-  <text x="100" y="80" direction="ltr" unicode-bidi="embed">&#x208D;&#x208E;&#x207D;&#x207E;&#x2045;&#x2046;&#x2039;&#x203A;</text>
-  <text x="100" y="120" direction="ltr" unicode-bidi="embed">&#x227E;&#x227F;&#x227C;&#x227D;&#x227A;&#x227B;&#x2278;&#x2279;&#x2276;&#x2277;&#x2274;&#x2275;&#x2272;&#x2273;&#x2270;&#x2271;&#x226E;&#x226F;&#x226A;&#x226B;&#x2268;&#x2269;&#x2266;&#x2267;&#x2264;&#x2265;&#x2254;&#x2255;&#x2252;&#x2253;&#x22CD;&#x223C;&#x223D;&#x29F5;&#x220A;&#x2209;&#x2208;&#x220D;&#x220C;&#x220B;</text>
-  <text x="100" y="160" direction="ltr" unicode-bidi="embed">&#x22F7;&#x22F6;&#x22F4;&#x22F3;&#x22F2;&#x22FE;&#x22FD;&#x22FC;&#x22FB;&#x22FA;&#x22F0;&#x22F1;&#x22EC;&#x22ED;&#x22EA;&#x22EB;&#x22E8;&#x22E9;&#x22E6;&#x22E7;&#x22E4;&#x22E5;&#x22E2;&#x22E3;&#x22E0;&#x22E1;&#x22DE;&#x22DF;&#x22DC;&#x22DD;&#x22DA;&#x22DB;&#x22D8;&#x22D9;&#x22D6;&#x22D7;&#x22D0;&#x22D1;&#x2243;&#x22CB;&#x22CC;&#x22C9;&#x22CA;&#x22B6;&#x22B7;&#x22B4;&#x22B5;&#x22B2;&#x22B3;&#x22B0;&#x22B1;&#x2AE5;&#x2AE3;&#x2AE4;&#x2ADE;&#x22A2;&#x22A3;&#x29B8;&#x2291;&#x2292;&#x228F;&#x2290;&#x228A;&#x228B;&#x2288;&#x2289;&#x2286;&#x2287;&#x2284;&#x2285;&#x2282;&#x2283;&#x2280;&#x2281;</text>
-  <text x="100" y="200" direction="ltr" unicode-bidi="embed">&#x2329;&#x232A;&#x230A;&#x230B;&#x2308;&#x2309;</text>
-  <text x="100" y="240" direction="ltr" unicode-bidi="embed">&#x27EE;&#x27EF;&#x27EC;&#x27ED;&#x27EA;&#x27EB;&#x27E8;&#x27E9;&#x27E6;&#x27E7;&#x27E4;&#x27E5;&#x27E2;&#x27E3;&#x27DD;&#x27DE;&#x27D5;&#x27D6;&#x27CB;&#x27CD;&#x27C8;&#x27C9;&#x27C5;&#x27C6;&#x27C3;&#x27C4;&#x2774;&#x2775;&#x2772;&#x2773;&#x2770;&#x2771;&#x276E;&#x276F;&#x276C;&#x276D;&#x276A;&#x276B;&#x2768;&#x2769;</text>
-  <text x="100" y="280" direction="ltr" unicode-bidi="embed">&#x29FC;&#x29FD;&#x29F8;&#x29F9;&#x2215;&#x29DA;&#x29DB;&#x29D8;&#x29D9;&#x29D4;&#x29D5;&#x29D1;&#x29D2;&#x29CF;&#x29D0;&#x29C4;&#x29C5;&#x29C0;&#x29C1;&#x2298;&#x2997;&#x2998;&#x2995;&#x2996;&#x2993;&#x2994;&#x2991;&#x2992;&#x298D;&#x298E;&#x298F;&#x2990;&#x298B;&#x298C;&#x2989;&#x298A;&#x2987;&#x2988;&#x2985;&#x2986;&#x2983;&#x2984;</text>
-  <text x="100" y="320" direction="ltr" unicode-bidi="embed">&#x2AF9;&#x2AFA;&#x2AF7;&#x2AF8;&#x2AEC;&#x2AED;&#x22AB;&#x22A8;&#x22A9;&#x22A6;&#x2AD5;&#x2AD6;&#x2AD3;&#x2AD4;&#x2AD1;&#x2AD2;&#x2ACF;&#x2AD0;&#x2ACD;&#x2ACE;&#x2AC5;&#x2AC6;&#x2AC3;&#x2AC4;&#x2AC1;&#x2AC2;&#x2ABF;&#x2AC0;&#x2ABD;&#x2ABE;&#x2ABB;&#x2ABC;&#x2AB3;&#x2AB4;&#x2AAF;&#x2AB0;&#x2AAC;&#x2AAD;&#x2AAA;&#x2AAB;&#x2AA8;&#x2AA9;&#x2AA6;&#x2AA7;&#x2AA1;&#x2AA2;&#x2A9B;&#x2A9C;&#x2A99;&#x2A9A;&#x2A97;&#x2A98;&#x2A95;&#x2A96;&#x2A93;&#x2A94;&#x2A91;&#x2A92;&#x2A8B;&#x2A8C;&#x2A83;&#x2A84;&#x2A81;&#x2A82;&#x2A7F;&#x2A80;&#x2A7D;&#x2A7E;&#x2A79;&#x2A7A;&#x2A64;&#x2A65;&#x2A3C;&#x2A3D;&#x2A34;&#x2A35;&#x2A2D;&#x2A2E;&#x2A2B;&#x2A2C;</text>
-  <text x="100" y="360" direction="ltr" unicode-bidi="embed">&#x2E28;&#x2E29;&#x2E26;&#x2E27;&#x2E24;&#x2E25;&#x2E22;&#x2E23;&#x2E20;&#x2E21;&#x2E1C;&#x2E1D;&#x2E0C;&#x2E0D;&#x2E09;&#x2E0A;&#x2E04;&#x2E05;&#x2E02;&#x2E03;</text>
-  <text x="100" y="400" direction="ltr" unicode-bidi="embed">&#x301A;&#x301B;&#x3018;&#x3019;&#x3016;&#x3017;&#x3014;&#x3015;&#x3010;&#x3011;&#x300E;&#x300F;&#x300C;&#x300D;&#x300A;&#x300B;&#x3008;&#x3009;</text>
-  <text x="100" y="440" direction="ltr" unicode-bidi="embed">&#xFE64;&#xFE65;&#xFE5D;&#xFE5E;&#xFE5B;&#xFE5C;&#xFE59;&#xFE5A;</text>
-  <text x="100" y="480" direction="ltr" unicode-bidi="embed">&#xFF62;&#xFF63;&#xFF5F;&#xFF60;&#xFF5B;&#xFF5D;&#xFF3B;&#xFF3D;&#xFF1C;&#xFF1E;&#xFF08;&#xFF09;</text>
+<svg xmlns="http://www.w3.org/2000/svg"
+     xmlns:xlink="http://www.w3.org/1999/xlink"
+     width="800" height="800" class="reftest-wait" onload="reference()">
+  <style>
+    @font-face { font-family: BitPattern; src: url(../fonts/BitPattern.woff); }
+  </style>
+  <script xlink:href="bidiMirroring.js"/>
 </svg>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bidi/bidiMirroring.js
@@ -0,0 +1,407 @@
+// Pairs of mirrored characters from
+// http://www.unicode.org/Public/6.1.0/ucd/BidiMirroring.txt
+var mirrors = [
+  [0x0028, 0x0029],
+  [0x0029, 0x0028],
+  [0x003C, 0x003E],
+  [0x003E, 0x003C],
+  [0x005B, 0x005D],
+  [0x005D, 0x005B],
+  [0x007B, 0x007D],
+  [0x007D, 0x007B],
+  [0x00AB, 0x00BB],
+  [0x00BB, 0x00AB],
+// These four are disabled as on Mac earlier than 10.7, Tibetan characters will
+// not be used from the BitPattern.woff font due to lack of platform support.
+//
+//   [0x0F3A, 0x0F3B],
+//   [0x0F3B, 0x0F3A],
+//   [0x0F3C, 0x0F3D],
+//   [0x0F3D, 0x0F3C],
+  [0x169B, 0x169C],
+  [0x169C, 0x169B],
+  [0x2039, 0x203A],
+  [0x203A, 0x2039],
+  [0x2045, 0x2046],
+  [0x2046, 0x2045],
+  [0x207D, 0x207E],
+  [0x207E, 0x207D],
+  [0x208D, 0x208E],
+  [0x208E, 0x208D],
+  [0x2208, 0x220B],
+  [0x2209, 0x220C],
+  [0x220A, 0x220D],
+  [0x220B, 0x2208],
+  [0x220C, 0x2209],
+  [0x220D, 0x220A],
+  [0x2215, 0x29F5],
+  [0x223C, 0x223D],
+  [0x223D, 0x223C],
+  [0x2243, 0x22CD],
+  [0x2252, 0x2253],
+  [0x2253, 0x2252],
+  [0x2254, 0x2255],
+  [0x2255, 0x2254],
+  [0x2264, 0x2265],
+  [0x2265, 0x2264],
+  [0x2266, 0x2267],
+  [0x2267, 0x2266],
+  [0x2268, 0x2269],
+  [0x2269, 0x2268],
+  [0x226A, 0x226B],
+  [0x226B, 0x226A],
+  [0x226E, 0x226F],
+  [0x226F, 0x226E],
+  [0x2270, 0x2271],
+  [0x2271, 0x2270],
+  [0x2272, 0x2273],
+  [0x2273, 0x2272],
+  [0x2274, 0x2275],
+  [0x2275, 0x2274],
+  [0x2276, 0x2277],
+  [0x2277, 0x2276],
+  [0x2278, 0x2279],
+  [0x2279, 0x2278],
+  [0x227A, 0x227B],
+  [0x227B, 0x227A],
+  [0x227C, 0x227D],
+  [0x227D, 0x227C],
+  [0x227E, 0x227F],
+  [0x227F, 0x227E],
+  [0x2280, 0x2281],
+  [0x2281, 0x2280],
+  [0x2282, 0x2283],
+  [0x2283, 0x2282],
+  [0x2284, 0x2285],
+  [0x2285, 0x2284],
+  [0x2286, 0x2287],
+  [0x2287, 0x2286],
+  [0x2288, 0x2289],
+  [0x2289, 0x2288],
+  [0x228A, 0x228B],
+  [0x228B, 0x228A],
+  [0x228F, 0x2290],
+  [0x2290, 0x228F],
+  [0x2291, 0x2292],
+  [0x2292, 0x2291],
+  [0x2298, 0x29B8],
+  [0x22A2, 0x22A3],
+  [0x22A3, 0x22A2],
+  [0x22A6, 0x2ADE],
+  [0x22A8, 0x2AE4],
+  [0x22A9, 0x2AE3],
+  [0x22AB, 0x2AE5],
+  [0x22B0, 0x22B1],
+  [0x22B1, 0x22B0],
+  [0x22B2, 0x22B3],
+  [0x22B3, 0x22B2],
+  [0x22B4, 0x22B5],
+  [0x22B5, 0x22B4],
+  [0x22B6, 0x22B7],
+  [0x22B7, 0x22B6],
+  [0x22C9, 0x22CA],
+  [0x22CA, 0x22C9],
+  [0x22CB, 0x22CC],
+  [0x22CC, 0x22CB],
+  [0x22CD, 0x2243],
+  [0x22D0, 0x22D1],
+  [0x22D1, 0x22D0],
+  [0x22D6, 0x22D7],
+  [0x22D7, 0x22D6],
+  [0x22D8, 0x22D9],
+  [0x22D9, 0x22D8],
+  [0x22DA, 0x22DB],
+  [0x22DB, 0x22DA],
+  [0x22DC, 0x22DD],
+  [0x22DD, 0x22DC],
+  [0x22DE, 0x22DF],
+  [0x22DF, 0x22DE],
+  [0x22E0, 0x22E1],
+  [0x22E1, 0x22E0],
+  [0x22E2, 0x22E3],
+  [0x22E3, 0x22E2],
+  [0x22E4, 0x22E5],
+  [0x22E5, 0x22E4],
+  [0x22E6, 0x22E7],
+  [0x22E7, 0x22E6],
+  [0x22E8, 0x22E9],
+  [0x22E9, 0x22E8],
+  [0x22EA, 0x22EB],
+  [0x22EB, 0x22EA],
+  [0x22EC, 0x22ED],
+  [0x22ED, 0x22EC],
+  [0x22F0, 0x22F1],
+  [0x22F1, 0x22F0],
+  [0x22F2, 0x22FA],
+  [0x22F3, 0x22FB],
+  [0x22F4, 0x22FC],
+  [0x22F6, 0x22FD],
+  [0x22F7, 0x22FE],
+  [0x22FA, 0x22F2],
+  [0x22FB, 0x22F3],
+  [0x22FC, 0x22F4],
+  [0x22FD, 0x22F6],
+  [0x22FE, 0x22F7],
+  [0x2308, 0x2309],
+  [0x2309, 0x2308],
+  [0x230A, 0x230B],
+  [0x230B, 0x230A],
+  [0x2329, 0x232A],
+  [0x232A, 0x2329],
+  [0x2768, 0x2769],
+  [0x2769, 0x2768],
+  [0x276A, 0x276B],
+  [0x276B, 0x276A],
+  [0x276C, 0x276D],
+  [0x276D, 0x276C],
+  [0x276E, 0x276F],
+  [0x276F, 0x276E],
+  [0x2770, 0x2771],
+  [0x2771, 0x2770],
+  [0x2772, 0x2773],
+  [0x2773, 0x2772],
+  [0x2774, 0x2775],
+  [0x2775, 0x2774],
+  [0x27C3, 0x27C4],
+  [0x27C4, 0x27C3],
+  [0x27C5, 0x27C6],
+  [0x27C6, 0x27C5],
+  [0x27C8, 0x27C9],
+  [0x27C9, 0x27C8],
+  [0x27CB, 0x27CD],
+  [0x27CD, 0x27CB],
+  [0x27D5, 0x27D6],
+  [0x27D6, 0x27D5],
+  [0x27DD, 0x27DE],
+  [0x27DE, 0x27DD],
+  [0x27E2, 0x27E3],
+  [0x27E3, 0x27E2],
+  [0x27E4, 0x27E5],
+  [0x27E5, 0x27E4],
+  [0x27E6, 0x27E7],
+  [0x27E7, 0x27E6],
+  [0x27E8, 0x27E9],
+  [0x27E9, 0x27E8],
+  [0x27EA, 0x27EB],
+  [0x27EB, 0x27EA],
+  [0x27EC, 0x27ED],
+  [0x27ED, 0x27EC],
+  [0x27EE, 0x27EF],
+  [0x27EF, 0x27EE],
+  [0x2983, 0x2984],
+  [0x2984, 0x2983],
+  [0x2985, 0x2986],
+  [0x2986, 0x2985],
+  [0x2987, 0x2988],
+  [0x2988, 0x2987],
+  [0x2989, 0x298A],
+  [0x298A, 0x2989],
+  [0x298B, 0x298C],
+  [0x298C, 0x298B],
+  [0x298D, 0x2990],
+  [0x298E, 0x298F],
+  [0x298F, 0x298E],
+  [0x2990, 0x298D],
+  [0x2991, 0x2992],
+  [0x2992, 0x2991],
+  [0x2993, 0x2994],
+  [0x2994, 0x2993],
+  [0x2995, 0x2996],
+  [0x2996, 0x2995],
+  [0x2997, 0x2998],
+  [0x2998, 0x2997],
+  [0x29B8, 0x2298],
+  [0x29C0, 0x29C1],
+  [0x29C1, 0x29C0],
+  [0x29C4, 0x29C5],
+  [0x29C5, 0x29C4],
+  [0x29CF, 0x29D0],
+  [0x29D0, 0x29CF],
+  [0x29D1, 0x29D2],
+  [0x29D2, 0x29D1],
+  [0x29D4, 0x29D5],
+  [0x29D5, 0x29D4],
+  [0x29D8, 0x29D9],
+  [0x29D9, 0x29D8],
+  [0x29DA, 0x29DB],
+  [0x29DB, 0x29DA],
+  [0x29F5, 0x2215],
+  [0x29F8, 0x29F9],
+  [0x29F9, 0x29F8],
+  [0x29FC, 0x29FD],
+  [0x29FD, 0x29FC],
+  [0x2A2B, 0x2A2C],
+  [0x2A2C, 0x2A2B],
+  [0x2A2D, 0x2A2E],
+  [0x2A2E, 0x2A2D],
+  [0x2A34, 0x2A35],
+  [0x2A35, 0x2A34],
+  [0x2A3C, 0x2A3D],
+  [0x2A3D, 0x2A3C],
+  [0x2A64, 0x2A65],
+  [0x2A65, 0x2A64],
+  [0x2A79, 0x2A7A],
+  [0x2A7A, 0x2A79],
+  [0x2A7D, 0x2A7E],
+  [0x2A7E, 0x2A7D],
+  [0x2A7F, 0x2A80],
+  [0x2A80, 0x2A7F],
+  [0x2A81, 0x2A82],
+  [0x2A82, 0x2A81],
+  [0x2A83, 0x2A84],
+  [0x2A84, 0x2A83],
+  [0x2A8B, 0x2A8C],
+  [0x2A8C, 0x2A8B],
+  [0x2A91, 0x2A92],
+  [0x2A92, 0x2A91],
+  [0x2A93, 0x2A94],
+  [0x2A94, 0x2A93],
+  [0x2A95, 0x2A96],
+  [0x2A96, 0x2A95],
+  [0x2A97, 0x2A98],
+  [0x2A98, 0x2A97],
+  [0x2A99, 0x2A9A],
+  [0x2A9A, 0x2A99],
+  [0x2A9B, 0x2A9C],
+  [0x2A9C, 0x2A9B],
+  [0x2AA1, 0x2AA2],
+  [0x2AA2, 0x2AA1],
+  [0x2AA6, 0x2AA7],
+  [0x2AA7, 0x2AA6],
+  [0x2AA8, 0x2AA9],
+  [0x2AA9, 0x2AA8],
+  [0x2AAA, 0x2AAB],
+  [0x2AAB, 0x2AAA],
+  [0x2AAC, 0x2AAD],
+  [0x2AAD, 0x2AAC],
+  [0x2AAF, 0x2AB0],
+  [0x2AB0, 0x2AAF],
+  [0x2AB3, 0x2AB4],
+  [0x2AB4, 0x2AB3],
+  [0x2ABB, 0x2ABC],
+  [0x2ABC, 0x2ABB],
+  [0x2ABD, 0x2ABE],
+  [0x2ABE, 0x2ABD],
+  [0x2ABF, 0x2AC0],
+  [0x2AC0, 0x2ABF],
+  [0x2AC1, 0x2AC2],
+  [0x2AC2, 0x2AC1],
+  [0x2AC3, 0x2AC4],
+  [0x2AC4, 0x2AC3],
+  [0x2AC5, 0x2AC6],
+  [0x2AC6, 0x2AC5],
+  [0x2ACD, 0x2ACE],
+  [0x2ACE, 0x2ACD],
+  [0x2ACF, 0x2AD0],
+  [0x2AD0, 0x2ACF],
+  [0x2AD1, 0x2AD2],
+  [0x2AD2, 0x2AD1],
+  [0x2AD3, 0x2AD4],
+  [0x2AD4, 0x2AD3],
+  [0x2AD5, 0x2AD6],
+  [0x2AD6, 0x2AD5],
+  [0x2ADE, 0x22A6],
+  [0x2AE3, 0x22A9],
+  [0x2AE4, 0x22A8],
+  [0x2AE5, 0x22AB],
+  [0x2AEC, 0x2AED],
+  [0x2AED, 0x2AEC],
+  [0x2AF7, 0x2AF8],
+  [0x2AF8, 0x2AF7],
+  [0x2AF9, 0x2AFA],
+  [0x2AFA, 0x2AF9],
+  [0x2E02, 0x2E03],
+  [0x2E03, 0x2E02],
+  [0x2E04, 0x2E05],
+  [0x2E05, 0x2E04],
+  [0x2E09, 0x2E0A],
+  [0x2E0A, 0x2E09],
+  [0x2E0C, 0x2E0D],
+  [0x2E0D, 0x2E0C],
+  [0x2E1C, 0x2E1D],
+  [0x2E1D, 0x2E1C],
+  [0x2E20, 0x2E21],
+  [0x2E21, 0x2E20],
+  [0x2E22, 0x2E23],
+  [0x2E23, 0x2E22],
+  [0x2E24, 0x2E25],
+  [0x2E25, 0x2E24],
+  [0x2E26, 0x2E27],
+  [0x2E27, 0x2E26],
+  [0x2E28, 0x2E29],
+  [0x2E29, 0x2E28],
+  [0x3008, 0x3009],
+  [0x3009, 0x3008],
+  [0x300A, 0x300B],
+  [0x300B, 0x300A],
+  [0x300C, 0x300D],
+  [0x300D, 0x300C],
+  [0x300E, 0x300F],
+  [0x300F, 0x300E],
+  [0x3010, 0x3011],
+  [0x3011, 0x3010],
+  [0x3014, 0x3015],
+  [0x3015, 0x3014],
+  [0x3016, 0x3017],
+  [0x3017, 0x3016],
+  [0x3018, 0x3019],
+  [0x3019, 0x3018],
+  [0x301A, 0x301B],
+  [0x301B, 0x301A],
+  [0xFE59, 0xFE5A],
+  [0xFE5A, 0xFE59],
+  [0xFE5B, 0xFE5C],
+  [0xFE5C, 0xFE5B],
+  [0xFE5D, 0xFE5E],
+  [0xFE5E, 0xFE5D],
+  [0xFE64, 0xFE65],
+  [0xFE65, 0xFE64],
+  [0xFF08, 0xFF09],
+  [0xFF09, 0xFF08],
+  [0xFF1C, 0xFF1E],
+  [0xFF1E, 0xFF1C],
+  [0xFF3B, 0xFF3D],
+  [0xFF3D, 0xFF3B],
+  [0xFF5B, 0xFF5D],
+  [0xFF5D, 0xFF5B],
+  [0xFF5F, 0xFF60],
+  [0xFF60, 0xFF5F],
+  [0xFF62, 0xFF63],
+  [0xFF63, 0xFF62]
+];
+
+function show(attributes, text) {
+  var e = document.createElementNS("http://www.w3.org/2000/svg", "text");
+  for (var name in attributes) {
+    e.setAttribute(name, attributes[name]);
+  }
+  e.textContent = text;
+  document.documentElement.appendChild(e);
+}
+
+function showCharacters(isReference) {
+  var row = 0, col = 0;
+  for (var i = 0; i < mirrors.length; i++) {
+    show({ x: col * 50 + 30,
+           y: row * 30 + 30,
+           direction: isReference ? "ltr" : "rtl",
+           "unicode-bidi": "embed",
+           "text-anchor": "middle",
+           "font-family": "BitPattern",
+           "font-size": "40px" },
+         String.fromCharCode(mirrors[i][isReference ? 0 : 1]));
+    if (++col == 16) {
+      col = 0;
+      row++;
+    }
+  }
+  document.documentElement.removeAttribute("class");
+}
+
+function test() {
+  showCharacters(false);
+}
+
+function reference() {
+  showCharacters(true);
+}
--- a/layout/reftests/bidi/bidiMirroring.svg
+++ b/layout/reftests/bidi/bidiMirroring.svg
@@ -1,14 +1,22 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="520">
-  <text x="100" y="40" direction="rtl" unicode-bidi="embed">&#x0028;&#x0029;&#x003C;&#x003E;&#x005B;&#x005D;&#x007B;&#x007D;&#x00AB;&#x00BB;&#x0F3A;&#x0F3B;&#x0F3C;&#x0F3D;&#x169B;&#x169C;</text>
-  <text x="100" y="80" direction="rtl" unicode-bidi="embed">&#x2039;&#x203A;&#x2045;&#x2046;&#x207D;&#x207E;&#x208D;&#x208E;</text>
-  <text x="100" y="120" direction="rtl" unicode-bidi="embed">&#x2208;&#x2209;&#x220A;&#x220B;&#x220C;&#x220D;&#x2215;&#x223C;&#x223D;&#x2243;&#x2252;&#x2253;&#x2254;&#x2255;&#x2264;&#x2265;&#x2266;&#x2267;&#x2268;&#x2269;&#x226A;&#x226B;&#x226E;&#x226F;&#x2270;&#x2271;&#x2272;&#x2273;&#x2274;&#x2275;&#x2276;&#x2277;&#x2278;&#x2279;&#x227A;&#x227B;&#x227C;&#x227D;&#x227E;&#x227F;</text>
-  <text x="100" y="160" direction="rtl" unicode-bidi="embed">&#x2280;&#x2281;&#x2282;&#x2283;&#x2284;&#x2285;&#x2286;&#x2287;&#x2288;&#x2289;&#x228A;&#x228B;&#x228F;&#x2290;&#x2291;&#x2292;&#x2298;&#x22A2;&#x22A3;&#x22A6;&#x22A8;&#x22A9;&#x22AB;&#x22B0;&#x22B1;&#x22B2;&#x22B3;&#x22B4;&#x22B5;&#x22B6;&#x22B7;&#x22C9;&#x22CA;&#x22CB;&#x22CC;&#x22CD;&#x22D0;&#x22D1;&#x22D6;&#x22D7;&#x22D8;&#x22D9;&#x22DA;&#x22DB;&#x22DC;&#x22DD;&#x22DE;&#x22DF;&#x22E0;&#x22E1;&#x22E2;&#x22E3;&#x22E4;&#x22E5;&#x22E6;&#x22E7;&#x22E8;&#x22E9;&#x22EA;&#x22EB;&#x22EC;&#x22ED;&#x22F0;&#x22F1;&#x22F2;&#x22F3;&#x22F4;&#x22F6;&#x22F7;&#x22FA;&#x22FB;&#x22FC;&#x22FD;&#x22FE;</text>
-  <text x="100" y="200" direction="rtl" unicode-bidi="embed">&#x2308;&#x2309;&#x230A;&#x230B;&#x2329;&#x232A;</text>
-  <text x="100" y="240" direction="rtl" unicode-bidi="embed">&#x2768;&#x2769;&#x276A;&#x276B;&#x276C;&#x276D;&#x276E;&#x276F;&#x2770;&#x2771;&#x2772;&#x2773;&#x2774;&#x2775;&#x27C3;&#x27C4;&#x27C5;&#x27C6;&#x27C8;&#x27C9;&#x27CB;&#x27CD;&#x27D5;&#x27D6;&#x27DD;&#x27DE;&#x27E2;&#x27E3;&#x27E4;&#x27E5;&#x27E6;&#x27E7;&#x27E8;&#x27E9;&#x27EA;&#x27EB;&#x27EC;&#x27ED;&#x27EE;&#x27EF;</text>
-  <text x="100" y="280" direction="rtl" unicode-bidi="embed">&#x2983;&#x2984;&#x2985;&#x2986;&#x2987;&#x2988;&#x2989;&#x298A;&#x298B;&#x298C;&#x298D;&#x298E;&#x298F;&#x2990;&#x2991;&#x2992;&#x2993;&#x2994;&#x2995;&#x2996;&#x2997;&#x2998;&#x29B8;&#x29C0;&#x29C1;&#x29C4;&#x29C5;&#x29CF;&#x29D0;&#x29D1;&#x29D2;&#x29D4;&#x29D5;&#x29D8;&#x29D9;&#x29DA;&#x29DB;&#x29F5;&#x29F8;&#x29F9;&#x29FC;&#x29FD;</text>
-  <text x="100" y="320" direction="rtl" unicode-bidi="embed">&#x2A2B;&#x2A2C;&#x2A2D;&#x2A2E;&#x2A34;&#x2A35;&#x2A3C;&#x2A3D;&#x2A64;&#x2A65;&#x2A79;&#x2A7A;&#x2A7D;&#x2A7E;&#x2A7F;&#x2A80;&#x2A81;&#x2A82;&#x2A83;&#x2A84;&#x2A8B;&#x2A8C;&#x2A91;&#x2A92;&#x2A93;&#x2A94;&#x2A95;&#x2A96;&#x2A97;&#x2A98;&#x2A99;&#x2A9A;&#x2A9B;&#x2A9C;&#x2AA1;&#x2AA2;&#x2AA6;&#x2AA7;&#x2AA8;&#x2AA9;&#x2AAA;&#x2AAB;&#x2AAC;&#x2AAD;&#x2AAF;&#x2AB0;&#x2AB3;&#x2AB4;&#x2ABB;&#x2ABC;&#x2ABD;&#x2ABE;&#x2ABF;&#x2AC0;&#x2AC1;&#x2AC2;&#x2AC3;&#x2AC4;&#x2AC5;&#x2AC6;&#x2ACD;&#x2ACE;&#x2ACF;&#x2AD0;&#x2AD1;&#x2AD2;&#x2AD3;&#x2AD4;&#x2AD5;&#x2AD6;&#x2ADE;&#x2AE3;&#x2AE4;&#x2AE5;&#x2AEC;&#x2AED;&#x2AF7;&#x2AF8;&#x2AF9;&#x2AFA;</text>
-  <text x="100" y="360" direction="rtl" unicode-bidi="embed">&#x2E02;&#x2E03;&#x2E04;&#x2E05;&#x2E09;&#x2E0A;&#x2E0C;&#x2E0D;&#x2E1C;&#x2E1D;&#x2E20;&#x2E21;&#x2E22;&#x2E23;&#x2E24;&#x2E25;&#x2E26;&#x2E27;&#x2E28;&#x2E29;</text>
-  <text x="100" y="400" direction="rtl" unicode-bidi="embed">&#x3008;&#x3009;&#x300A;&#x300B;&#x300C;&#x300D;&#x300E;&#x300F;&#x3010;&#x3011;&#x3014;&#x3015;&#x3016;&#x3017;&#x3018;&#x3019;&#x301A;&#x301B;</text>
-  <text x="100" y="440" direction="rtl" unicode-bidi="embed">&#xFE59;&#xFE5A;&#xFE5B;&#xFE5C;&#xFE5D;&#xFE5E;&#xFE64;&#xFE65;</text>
-  <text x="100" y="480" direction="rtl" unicode-bidi="embed">&#xFF08;&#xFF09;&#xFF1C;&#xFF1E;&#xFF3B;&#xFF3D;&#xFF5B;&#xFF5D;&#xFF5F;&#xFF60;&#xFF62;&#xFF63;</text>
+<svg xmlns="http://www.w3.org/2000/svg"
+     xmlns:xlink="http://www.w3.org/1999/xlink"
+     width="800" height="800" class="reftest-wait" onload="test()">
+  <!--
+    BitPattern.woff is a font with a glyph for each mirrored character.
+    (The glyph is a bit pattern of the character's code point, hence the
+    font name.)  The font was generated by:
+    
+      1. Creating an input file that consisted of a four-hex-digit code
+         point per line, for each glyph to be included in the font.
+         (For this test, that would be the 360-odd mirrored characters.)
+
+      2. Running ./generate-bitpattern-font.pl on that input file, which
+         generates an SVG Font file.
+
+      3. Using FontForge to convert that SVG Font file into a WOFF file.
+  -->
+  <style>
+    @font-face { font-family: BitPattern; src: url(../fonts/BitPattern.woff); }
+  </style>
+  <script xlink:href="bidiMirroring.js"/>
 </svg>
--- a/layout/reftests/bidi/bidiSVG-03-ref.svg
+++ b/layout/reftests/bidi/bidiSVG-03-ref.svg
@@ -1,3 +1,3 @@
 <svg xmlns="http://www.w3.org/2000/svg" width="800" height="200">
-  <text x="100" y="20" direction="ltr" unicode-bidi="bidi-override">in right-to-left element תירבע םע left-to-right text</text>
+  <text x="400" y="20" direction="ltr" unicode-bidi="bidi-override" text-anchor="end">in right-to-left element תירבע םע left-to-right text</text>
 </svg>
--- a/layout/reftests/bidi/bidiSVG-03.svg
+++ b/layout/reftests/bidi/bidiSVG-03.svg
@@ -1,3 +1,3 @@
 <svg xmlns="http://www.w3.org/2000/svg" width="800" height="200">
-  <text x="100" y="20" direction="rtl" unicode-bidi="embed">left-to-right text עם עברית in right-to-left element</text>
+  <text x="400" y="20" direction="rtl" unicode-bidi="embed">left-to-right text עם עברית in right-to-left element</text>
 </svg>
--- a/layout/reftests/bidi/bidiSVG-04-ref.svg
+++ b/layout/reftests/bidi/bidiSVG-04-ref.svg
@@ -1,3 +1,3 @@
 <svg xmlns="http://www.w3.org/2000/svg" width="800" height="200">
-  <text x="100" y="20" direction="ltr" unicode-bidi="bidi-override">&#x0628;&gt;&#x0627;</text>
+  <text x="100" y="20" direction="ltr" unicode-bidi="bidi-override" text-anchor="end">&#x0628;&gt;&#x0627;</text>
 </svg>
--- a/layout/reftests/bidi/reftest.list
+++ b/layout/reftests/bidi/reftest.list
@@ -7,20 +7,20 @@
 fails-if(Android) == bidi-003.html bidi-003-ref.html # bug 736726
 == bidi-004.html bidi-004-ref.html
 == bidi-004-j.html bidi-004-ref.html
 == bidi-005.html bidi-005-ref.html
 random-if(cocoaWidget) == bidi-006.html bidi-006-ref.html # bug 734313
 random-if(cocoaWidget) == bidi-006-j.html bidi-006-ref.html # bug 734313
 == bidiSVG-01.svg bidiSVG-01-ref.svg
 == bidiSVG-02.svg bidiSVG-02-ref.svg
-== bidiSVG-03.svg bidiSVG-03-ref.svg
-== bidiSVG-04.svg bidiSVG-04-ref.svg
+pref(svg.text.css-frames.enabled,true) == bidiSVG-03.svg bidiSVG-03-ref.svg
+pref(svg.text.css-frames.enabled,true) == bidiSVG-04.svg bidiSVG-04-ref.svg
 == bidiSVG-05.svg bidiSVG-05-ref.svg
-== bidiMirroring.svg bidiMirroring-ref.svg
+fails-if(/^Windows\x20NT\x205\.1/.test(http.oscpu)) HTTP(..) == bidiMirroring.svg bidiMirroring-ref.svg
 random-if(layersGPUAccelerated) == visualmarquee.html marquee-ref.html
 random-if(layersGPUAccelerated) == logicalmarquee.html marquee-ref.html
 == visualmarquee.html logicalmarquee.html
 # 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
 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rYCE%<hI4+A8Kq5+Gd8?4F@?KcfqL*)5WniUUHqo}wFti!Deu-o_GxOo3xmoOd#h
zv3+|DFvp3$ON&lgAuBe-88L!4tlpnS^c?r*9UZRG#h+UYpbtd!nz~nVSq%5fq_^!_
z6?MxV`T|3RuBo_I<Wc33z8ZUp)54~%cMpRjiv`nqIvLRijGTM=3_f;ro4z3W)2Y-R
z&d7`GlXQc9l2vvSn--V!qzlEug7?!}mq`>tG1CWj!z=IV1hc7Bl2nJ>G<mrs;&};3
zdtb3~#iDsgQxjbe0&(MwwHR*_Fq;%I6N<_}?Yxy^g2PKAn4d(;HnF8c=ah}rr&zVs
zy&MF6v<~2}5pRdG<w&PHzQWqD-&r`QR9>f$#xoB$jStzQzRs^Y^q$s%o1CAzg#ub2
zfOWuszEvAbOTbR0fU?fco$F^lcm6&=JWrw3H~M5%{!1PgByDPJReD+gUh~Tj|DC^r
zJgf!h4r6-3kM}|mg@OkOAk>A7^PhSl1O5H?5!)!lm68lE`-d%ETs(n1-s$M*jPy%>
zk*HfKY2oO(j^H3gCIG-#L9_2UOA~<P`cH0jGOzj&4>7o})lm!UoizOSU^eTFW(|#~
z&AV#yF8jtZMLiDKZ;DQ&u`S{g>c|)FNRMbL9ExpM_Y!YILqhs#-rJb!kEV|e6S+0U
zRf(PFgK{p@{6{%0;tn`kqTw7C)fYUUyUwBl^`A#ulnSRlXo$@>6vrJvLR&roo2wRS
zJy6hAu06hw9!A{CjU@9cut_N_7p2sf45%bo<ML61^V5|-)ZR9npC&CjpgPNOt~*to
z%eVv`7S>Enx=eouh^(kJaUD%gc8mP7;`ms8cm7sXeRv>R=M>#~>L?(C4pJ#i{_p=m
P5-kz?pA-6I0P6n$+<c~!
new file mode 100644
--- /dev/null
+++ b/layout/reftests/fonts/generate-bitpattern-font.pl
@@ -0,0 +1,35 @@
+#!/usr/bin/perl -w
+
+# Generates an SVG Font where each glyph (identified on stdin by four
+# hex characters) consists of a bit pattern representing the Unicode
+# code point it is the glyph for.
+
+use strict;
+
+print <<EOF;
+<svg xmlns="http://www.w3.org/2000/svg">
+<font id="BitPattern" horiz-adv-x="1000">
+  <font-face font-family="BitPattern" units-per-em="1000" ascent="800"/>
+EOF
+
+while (<>) {
+  chomp;
+  next if /^\s*$/;
+  die unless /^[0-9A-Fa-f]{4}$/;
+  my $c = hex;
+  my $s = "  <glyph unicode='&#x$_;' d='";
+  for (my $i = 0; $i < 32; $i++) {
+    if ($c & (1 << $i)) {
+      my $x = 100 * (7 - ($i % 8));
+      my $y = 100 * int($i / 8);
+      $s .= "M$x,$y v80h80v-80z ";
+    }
+  }
+  $s .= "'/>\n";
+  print $s;
+}
+
+print <<EOF;
+</font>
+</svg>
+EOF