Bug 608721 Between CJK full-stop and open parenthesis should be breakable r=roc, a=roc
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 17 Dec 2010 00:17:02 +0900
changeset 59401 25fc0d97436f8c65409f00d219e418545e838c47
parent 59400 d386e59d2c7283bcd889a8fafc4f659ae2306b0e
child 59402 6d62c9b35eb2293a8a245542f79fe8291e1bd626
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersroc, roc
bugs608721
milestone2.0b9pre
Bug 608721 Between CJK full-stop and open parenthesis should be breakable r=roc, a=roc
intl/lwbrk/src/nsJISx4501LineBreaker.cpp
layout/reftests/line-breaking/punctuation-open-1-ref.html
layout/reftests/line-breaking/punctuation-open-1.html
layout/reftests/line-breaking/punctuation-open-2-ref.html
layout/reftests/line-breaking/punctuation-open-2.html
layout/reftests/line-breaking/punctuation-open-3-ref.html
layout/reftests/line-breaking/punctuation-open-3.html
layout/reftests/line-breaking/punctuation-open-4-ref.html
layout/reftests/line-breaking/punctuation-open-4.html
layout/reftests/line-breaking/reftest.list
--- a/intl/lwbrk/src/nsJISx4501LineBreaker.cpp
+++ b/intl/lwbrk/src/nsJISx4501LineBreaker.cpp
@@ -214,17 +214,17 @@
 
    Class of
    Leading    Class of Trailing Char Class
    Char
 
               1 [a] 7  8  9 [b]15 18 COMPLEX [c] [d] [e]
 
         1     X  X  X  X  X  X  X  X  X       X    X   X
-      [a]        X                            X    X   X
+      [a]        X                                 X   X
         7        X  X                                  X
         8        X              X                      X
         9        X                                     X
       [b]        X                                 X   X
        15        X        X     X  X          X    X   X
        18        X              X  X          X    X   X
   COMPLEX        X                    T                X
       [c]     X  X  X  X  X  X  X  X  X       X    X   X
@@ -233,34 +233,34 @@
 
 
    7. Now we use one bit to encode weather it is breakable, and use 2 bytes
       for one row, then the bit table will look like:
 
                  18    <-   1
 
        1  0000 1111 1111 1111  = 0x0FFF
-      [a] 0000 1110 0000 0010  = 0x0E02
+      [a] 0000 1100 0000 0010  = 0x0C02
        7  0000 1000 0000 0110  = 0x0806
        8  0000 1000 0100 0010  = 0x0842
        9  0000 1000 0000 0010  = 0x0802
       [b] 0000 1100 0000 0010  = 0x0C02
       15  0000 1110 1101 0010  = 0x0ED2
       18  0000 1110 1100 0010  = 0x0EC2
  COMPLEX  0000 1001 0000 0010  = 0x0902
       [c] 0000 1111 1111 1111  = 0x0FFF
       [d] 0000 1100 1100 0010  = 0x0CC2
       [e] 0000 1111 1111 1111  = 0x0FFF
 */
 
 #define MAX_CLASSES 12
 
 static const PRUint16 gPair[MAX_CLASSES] = {
   0x0FFF,
-  0x0E02,
+  0x0C02,
   0x0806,
   0x0842,
   0x0802,
   0x0C02,
   0x0ED2,
   0x0EC2,
   0x0902,
   0x0FFF,
new file mode 100644
--- /dev/null
+++ b/layout/reftests/line-breaking/punctuation-open-1-ref.html
@@ -0,0 +1,27 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } </style>
+</head>
+<body>
+
+<p>abcdef,<br>(abcdef</p>
+<p>abcdef,<br>[abcdef</p>
+<p>abcdef,<br>{abcdef</p>
+<p>abcdef,<br>{abcdef</p>
+<p>abcdef,<br>&#xFF62;abcdef</p>
+<p>abcdef,<br>&#xFF08;abcdef</p>
+<p>abcdef,<br>&#xFF3B;abcdef</p>
+<p>abcdef,<br>&#xFF5B;abcdef</p>
+<p>abcdef,<br>&#x300C;abcdef</p>
+
+<p>abcdef.<br>(abcdef</p>
+<p>abcdef.<br>[abcdef</p>
+<p>abcdef.<br>{abcdef</p>
+<p>abcdef.<br>&#xFF62;abcdef</p>
+<p>abcdef.<br>&#xFF08;abcdef</p>
+<p>abcdef.<br>&#xFF3B;abcdef</p>
+<p>abcdef.<br>&#xFF5B;abcdef</p>
+<p>abcdef.<br>&#x300C;abcdef</p>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/line-breaking/punctuation-open-1.html
@@ -0,0 +1,27 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; } </style>
+</head>
+<body>
+
+<p>abcdef,(abcdef</p>
+<p>abcdef,[abcdef</p>
+<p>abcdef,{abcdef</p>
+<p>abcdef,{abcdef</p>
+<p>abcdef,&#xFF62;abcdef</p>
+<p>abcdef,&#xFF08;abcdef</p>
+<p>abcdef,&#xFF3B;abcdef</p>
+<p>abcdef,&#xFF5B;abcdef</p>
+<p>abcdef,&#x300C;abcdef</p>
+
+<p>abcdef.(abcdef</p>
+<p>abcdef.[abcdef</p>
+<p>abcdef.{abcdef</p>
+<p>abcdef.&#xFF62;abcdef</p>
+<p>abcdef.&#xFF08;abcdef</p>
+<p>abcdef.&#xFF3B;abcdef</p>
+<p>abcdef.&#xFF5B;abcdef</p>
+<p>abcdef.&#x300C;abcdef</p>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/line-breaking/punctuation-open-2-ref.html
@@ -0,0 +1,27 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } </style>
+</head>
+<body>
+
+<p>abcdef&#xFF64;<br>(abcdef</p>
+<p>abcdef&#xFF64;<br>[abcdef</p>
+<p>abcdef&#xFF64;<br>{abcdef</p>
+<p>abcdef&#xFF64;<br>{abcdef</p>
+<p>abcdef&#xFF64;<br>&#xFF62;abcdef</p>
+<p>abcdef&#xFF64;<br>&#xFF08;abcdef</p>
+<p>abcdef&#xFF64;<br>&#xFF3B;abcdef</p>
+<p>abcdef&#xFF64;<br>&#xFF5B;abcdef</p>
+<p>abcdef&#xFF64;<br>&#x300C;abcdef</p>
+
+<p>abcdef&#xFF61;<br>(abcdef</p>
+<p>abcdef&#xFF61;<br>[abcdef</p>
+<p>abcdef&#xFF61;<br>{abcdef</p>
+<p>abcdef&#xFF61;<br>&#xFF62;abcdef</p>
+<p>abcdef&#xFF61;<br>&#xFF08;abcdef</p>
+<p>abcdef&#xFF61;<br>&#xFF3B;abcdef</p>
+<p>abcdef&#xFF61;<br>&#xFF5B;abcdef</p>
+<p>abcdef&#xFF61;<br>&#x300C;abcdef</p>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/line-breaking/punctuation-open-2.html
@@ -0,0 +1,27 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; } </style>
+</head>
+<body>
+
+<p>abcdef&#xFF64;(abcdef</p>
+<p>abcdef&#xFF64;[abcdef</p>
+<p>abcdef&#xFF64;{abcdef</p>
+<p>abcdef&#xFF64;{abcdef</p>
+<p>abcdef&#xFF64;&#xFF62;abcdef</p>
+<p>abcdef&#xFF64;&#xFF08;abcdef</p>
+<p>abcdef&#xFF64;&#xFF3B;abcdef</p>
+<p>abcdef&#xFF64;&#xFF5B;abcdef</p>
+<p>abcdef&#xFF64;&#x300C;abcdef</p>
+
+<p>abcdef&#xFF61;(abcdef</p>
+<p>abcdef&#xFF61;[abcdef</p>
+<p>abcdef&#xFF61;{abcdef</p>
+<p>abcdef&#xFF61;&#xFF62;abcdef</p>
+<p>abcdef&#xFF61;&#xFF08;abcdef</p>
+<p>abcdef&#xFF61;&#xFF3B;abcdef</p>
+<p>abcdef&#xFF61;&#xFF5B;abcdef</p>
+<p>abcdef&#xFF61;&#x300C;abcdef</p>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/line-breaking/punctuation-open-3-ref.html
@@ -0,0 +1,27 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } </style>
+</head>
+<body>
+
+<p>abcdef&#xFF0C;<br>(abcdef</p>
+<p>abcdef&#xFF0C;<br>[abcdef</p>
+<p>abcdef&#xFF0C;<br>{abcdef</p>
+<p>abcdef&#xFF0C;<br>{abcdef</p>
+<p>abcdef&#xFF0C;<br>&#xFF62;abcdef</p>
+<p>abcdef&#xFF0C;<br>&#xFF08;abcdef</p>
+<p>abcdef&#xFF0C;<br>&#xFF3B;abcdef</p>
+<p>abcdef&#xFF0C;<br>&#xFF5B;abcdef</p>
+<p>abcdef&#xFF0C;<br>&#x300C;abcdef</p>
+
+<p>abcdef&#xFF0E;<br>(abcdef</p>
+<p>abcdef&#xFF0E;<br>[abcdef</p>
+<p>abcdef&#xFF0E;<br>{abcdef</p>
+<p>abcdef&#xFF0E;<br>&#xFF62;abcdef</p>
+<p>abcdef&#xFF0E;<br>&#xFF08;abcdef</p>
+<p>abcdef&#xFF0E;<br>&#xFF3B;abcdef</p>
+<p>abcdef&#xFF0E;<br>&#xFF5B;abcdef</p>
+<p>abcdef&#xFF0E;<br>&#x300C;abcdef</p>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/line-breaking/punctuation-open-3.html
@@ -0,0 +1,27 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; } </style>
+</head>
+<body>
+
+<p>abcdef&#xFF0C;(abcdef</p>
+<p>abcdef&#xFF0C;[abcdef</p>
+<p>abcdef&#xFF0C;{abcdef</p>
+<p>abcdef&#xFF0C;{abcdef</p>
+<p>abcdef&#xFF0C;&#xFF62;abcdef</p>
+<p>abcdef&#xFF0C;&#xFF08;abcdef</p>
+<p>abcdef&#xFF0C;&#xFF3B;abcdef</p>
+<p>abcdef&#xFF0C;&#xFF5B;abcdef</p>
+<p>abcdef&#xFF0C;&#x300C;abcdef</p>
+
+<p>abcdef&#xFF0E;(abcdef</p>
+<p>abcdef&#xFF0E;[abcdef</p>
+<p>abcdef&#xFF0E;{abcdef</p>
+<p>abcdef&#xFF0E;&#xFF62;abcdef</p>
+<p>abcdef&#xFF0E;&#xFF08;abcdef</p>
+<p>abcdef&#xFF0E;&#xFF3B;abcdef</p>
+<p>abcdef&#xFF0E;&#xFF5B;abcdef</p>
+<p>abcdef&#xFF0E;&#x300C;abcdef</p>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/line-breaking/punctuation-open-4-ref.html
@@ -0,0 +1,27 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } </style>
+</head>
+<body>
+
+<p>abcdef&#x3001;<br>(abcdef</p>
+<p>abcdef&#x3001;<br>[abcdef</p>
+<p>abcdef&#x3001;<br>{abcdef</p>
+<p>abcdef&#x3001;<br>{abcdef</p>
+<p>abcdef&#x3001;<br>&#xFF62;abcdef</p>
+<p>abcdef&#x3001;<br>&#xFF08;abcdef</p>
+<p>abcdef&#x3001;<br>&#xFF3B;abcdef</p>
+<p>abcdef&#x3001;<br>&#xFF5B;abcdef</p>
+<p>abcdef&#x3001;<br>&#x300C;abcdef</p>
+
+<p>abcdef&#x3002;<br>(abcdef</p>
+<p>abcdef&#x3002;<br>[abcdef</p>
+<p>abcdef&#x3002;<br>{abcdef</p>
+<p>abcdef&#x3002;<br>&#xFF62;abcdef</p>
+<p>abcdef&#x3002;<br>&#xFF08;abcdef</p>
+<p>abcdef&#x3002;<br>&#xFF3B;abcdef</p>
+<p>abcdef&#x3002;<br>&#xFF5B;abcdef</p>
+<p>abcdef&#x3002;<br>&#x300C;abcdef</p>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/line-breaking/punctuation-open-4.html
@@ -0,0 +1,27 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; } </style>
+</head>
+<body>
+
+<p>abcdef&#x3001;(abcdef</p>
+<p>abcdef&#x3001;[abcdef</p>
+<p>abcdef&#x3001;{abcdef</p>
+<p>abcdef&#x3001;{abcdef</p>
+<p>abcdef&#x3001;&#xFF62;abcdef</p>
+<p>abcdef&#x3001;&#xFF08;abcdef</p>
+<p>abcdef&#x3001;&#xFF3B;abcdef</p>
+<p>abcdef&#x3001;&#xFF5B;abcdef</p>
+<p>abcdef&#x3001;&#x300C;abcdef</p>
+
+<p>abcdef&#x3002;(abcdef</p>
+<p>abcdef&#x3002;[abcdef</p>
+<p>abcdef&#x3002;{abcdef</p>
+<p>abcdef&#x3002;&#xFF62;abcdef</p>
+<p>abcdef&#x3002;&#xFF08;abcdef</p>
+<p>abcdef&#x3002;&#xFF3B;abcdef</p>
+<p>abcdef&#x3002;&#xFF5B;abcdef</p>
+<p>abcdef&#x3002;&#x300C;abcdef</p>
+
+</body>
+</html>
--- a/layout/reftests/line-breaking/reftest.list
+++ b/layout/reftests/line-breaking/reftest.list
@@ -10,16 +10,20 @@ random-if(cocoaWidget) == ja-1.html ja-1
 random-if(cocoaWidget) == ja-2.html ja-2-ref.html
 random-if(cocoaWidget) == ja-3.html ja-3-ref.html
 == leaders-1.html leaders-1-ref.html
 == markup-src-1.html markup-src-1-ref.html
 == non-breakable-1.html non-breakable-1-ref.html
 == non-breakable-2.html non-breakable-2-ref.html
 == numerics-1.html numerics-1-ref.html
 == parentheses-1.html parentheses-1-ref.html
+== punctuation-open-1.html punctuation-open-1-ref.html
+== punctuation-open-2.html punctuation-open-2-ref.html
+== punctuation-open-3.html punctuation-open-3-ref.html
+== punctuation-open-4.html punctuation-open-4-ref.html
 == quotationmarks-1.html quotationmarks-1-ref.html
 # The following is currently disabled on Linux because of a rendering issue with missing-glyph
 # representations on the test boxes. See bug #450088 for discussion.
 skip-if(gtk2Widget) == quotationmarks-cjk-1.html quotationmarks-cjk-1-ref.html
 == smileys-1.html smileys-1-ref.html
 == smileys-2.html smileys-2-ref.html
 == url-1.html url-1-ref.html
 == url-2.html url-2-ref.html