Add U+2029 PARAGRAPH SEPARATOR and other characters with bidi type Segment Separator and Paragraph Separator to the characters we convert to whitespace before passing text to the Bidi engine. Bug 847242, r=roc

This commit is contained in:
Simon Montagu 2014-03-05 21:04:36 +02:00
parent 70187840ba
commit 1028613ce4
6 changed files with 63 additions and 1 deletions

View File

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<style>
.f { unicode-bidi: bidi-override; width: 1px; white-space: pre-line; }
.f:first-letter { font-size: 200% }
</style>
</head>
<body>
<div class="f">&#x2029;&#x062a;&#x8401;
x</div>
</body>
</html>

View File

@ -415,6 +415,7 @@ load 826163.html
load 833604-1.html load 833604-1.html
load 835056.html load 835056.html
load 836990-1.html load 836990-1.html
load 847242.html
load 852293.html load 852293.html
load 860579-1.html load 860579-1.html
pref(layers.force-active,true) load 859526-1.html pref(layers.force-active,true) load 859526-1.html

View File

@ -35,6 +35,20 @@ static const char16_t kRLE = 0x202B;
static const char16_t kLRO = 0x202D; static const char16_t kLRO = 0x202D;
static const char16_t kRLO = 0x202E; static const char16_t kRLO = 0x202E;
static const char16_t kPDF = 0x202C; static const char16_t kPDF = 0x202C;
static const char16_t kSeparators[] = {
// All characters with Bidi type Segment Separator or Block Separator
char16_t('\t'),
char16_t('\r'),
char16_t('\n'),
char16_t(0xb),
char16_t(0x1c),
char16_t(0x1d),
char16_t(0x1e),
char16_t(0x1f),
char16_t(0x85),
char16_t(0x2029),
char16_t(0)
};
#define NS_BIDI_CONTROL_FRAME ((nsIFrame*)0xfffb1d1) #define NS_BIDI_CONTROL_FRAME ((nsIFrame*)0xfffb1d1)
@ -631,7 +645,7 @@ nsBidiPresUtils::ResolveParagraph(nsBlockFrame* aBlockFrame,
if (aBpd->BufferLength() < 1) { if (aBpd->BufferLength() < 1) {
return NS_OK; return NS_OK;
} }
aBpd->mBuffer.ReplaceChar("\t\r\n", kSpace); aBpd->mBuffer.ReplaceChar(kSeparators, kSpace);
int32_t runCount; int32_t runCount;

View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
div {
font-family: monospace;
font-size: 24px;
}
</style>
</head>
<body>
<div>PASS&#x2029;</div>
</body>
</html>

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
div {
unicode-bidi: bidi-override;
direction: rtl;
text-align: left;
font-family: monospace;
font-size: 24px;
}
</style>
</head>
<body>
<div>&#x2029;SSAP</div>
</body>
</html>

View File

@ -138,6 +138,7 @@ skip-if(B2G) == 726420-1.html 726420-1-ref.html
== 746987-4.html 746987-4-ref.html == 746987-4.html 746987-4-ref.html
== 779003-1.html 779003-1-ref.html == 779003-1.html 779003-1-ref.html
== 779003-1-dynamic.html 779003-1-ref.html == 779003-1-dynamic.html 779003-1-ref.html
== 847242-1.html 847242-1-ref.html
== 869833-1.xul 869833-1-ref.xul == 869833-1.xul 869833-1-ref.xul
== 922530-1.html 922530-1-ref.html == 922530-1.html 922530-1-ref.html
== 922550-1.html 922550-1-ref.html == 922550-1.html 922550-1-ref.html