Make zwnj-02.html reftest more tolerant of font anti-aliasing. (Bug 465140) r=smontagu a=tests

--HG--
rename : layout/reftests/text/zwnj-02-ref.html => layout/reftests/text/zwnj-01-notref.html
rename : layout/reftests/text/zwnj-02-ref.html => layout/reftests/text/zwnj-02-ref.xhtml
rename : layout/reftests/text/zwnj-02.html => layout/reftests/text/zwnj-02.xhtml
This commit is contained in:
L. David Baron 2008-11-25 13:27:53 -08:00
parent 0dd791554f
commit 3c30b8af4d
10 changed files with 188 additions and 5 deletions

View File

@ -0,0 +1,36 @@
<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<defs>
<!-- so that other documents can svg:use this one and force it to
load before onload -->
<g id="empty" />
<!-- Keep all black pixels black, and change any others to white. -->
<filter id="NonBlackToWhite" x="0%" y="0%" width="100%" height="100%">
<feColorMatrix type="matrix" values="255 255 255 0 0
255 255 255 0 0
255 255 255 0 0
0 0 0 1 0" />
</filter>
<!-- Keep all white pixels white, and change any others to black. -->
<filter id="NonWhiteToBlack" x="0%" y="0%" width="100%" height="100%">
<feComponentTransfer>
<feFuncR type="linear" slope="-1" intercept="1" />
<feFuncG type="linear" slope="-1" intercept="1" />
<feFuncB type="linear" slope="-1" intercept="1" />
</feComponentTransfer>
<feColorMatrix type="matrix" values="255 255 255 0 0
255 255 255 0 0
255 255 255 0 0
0 0 0 1 0" />
<feComponentTransfer>
<feFuncR type="linear" slope="-1" intercept="1" />
<feFuncG type="linear" slope="-1" intercept="1" />
<feFuncB type="linear" slope="-1" intercept="1" />
</feComponentTransfer>
</filter>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,20 @@
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Filter sanity-check</title>
<style type="text/css">
html, body { margin: 0; background: white; height: 100%; width: 100%; }
body { position: relative; }
</style>
</head>
<body>
<div style="position: absolute; top: 10px; left: 10px; width: 100px; height: 10px; background: black"></div>
<div style="position: absolute; top: 30px; left: 10px; width: 94px; height: 4px; border: 3px solid #000;"></div>
<div style="position: absolute; top: 50px; left: 10px; width: 100px; height: 10px; background: black"></div>
<div style="position: absolute; top: 70px; left: 10px; width: 94px; height: 4px; border: 3px solid #000;"></div>
</body>
</html>

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="1.1">
<!-- use an empty g to force filters.svg to load before onload -->
<use xlink:href="../filters.svg#empty" />
<foreignObject filter="url(../filters.svg#NonWhiteToBlack)"
x="0" y="0" height="100%" width="100%">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Filter sanity-check</title>
<style type="text/css">
html, body { margin: 0; background: white; height: 100%; width: 100%; }
body { position: relative; }
</style>
</head>
<body>
<div style="position: absolute; top: 10px; left: 10px; width: 100px; height: 10px; background: green"></div>
<div style="position: absolute; top: 30px; left: 10px; width: 94px; height: 4px; border: 3px solid #c90;"></div>
<div style="position: absolute; top: 50px; left: 10px; width: 100px; height: 10px; background: black"></div>
<div style="position: absolute; top: 70px; left: 10px; width: 94px; height: 4px; border: 3px solid #000;"></div>
</body>
</html>
</foreignObject>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,16 @@
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Filter sanity-check</title>
<style type="text/css">
html, body { margin: 0; background: white; height: 100%; width: 100%; }
body { position: relative; }
</style>
</head>
<body>
<div style="position: absolute; top: 50px; left: 10px; width: 100px; height: 10px; background: black"></div>
<div style="position: absolute; top: 70px; left: 10px; width: 94px; height: 4px; border: 3px solid #000;"></div>
</body>
</html>

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="1.1">
<!-- use an empty g to force filters.svg to load before onload -->
<use xlink:href="../filters.svg#empty" />
<foreignObject filter="url(../filters.svg#NonBlackToWhite)"
x="0" y="0" height="100%" width="100%">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Filter sanity-check</title>
<style type="text/css">
html, body { margin: 0; background: white; height: 100%; width: 100%; }
body { position: relative; }
</style>
</head>
<body>
<div style="position: absolute; top: 10px; left: 10px; width: 100px; height: 10px; background: green"></div>
<div style="position: absolute; top: 30px; left: 10px; width: 94px; height: 4px; border: 3px solid #c90;"></div>
<div style="position: absolute; top: 50px; left: 10px; width: 100px; height: 10px; background: black"></div>
<div style="position: absolute; top: 70px; left: 10px; width: 94px; height: 4px; border: 3px solid #000;"></div>
</body>
</html>
</foreignObject>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -32,3 +32,6 @@ HTTP == default.html data:text/html,<div>Text</div>
HTTP == data:text/html,<div>Text</div> default.html
!= blank.html default.html
HTTP != blank.html default.html
HTTP(..) == filter-1.xhtml filter-1-ref.xhtml
HTTP(..) == filter-2.xhtml filter-2-ref.xhtml

View File

@ -25,8 +25,8 @@ random-if(MOZ_WIDGET_TOOLKIT=="gtk2") == wordwrap-03.html wordwrap-03-ref.html #
!= wordwrap-09.html wordwrap-01-ref.html
== wordwrap-09.html wordwrap-09-ref.html
== zwnj-01.html zwnj-01-ref.html
== zwnj-02.html zwnj-02-ref.html
random-if(MOZ_WIDGET_TOOLKIT=="gtk2") != zwnj-01.html zwnj-02-ref.html # Bad fonts on the tinderbox -- works locally
HTTP(..) == zwnj-02.xhtml zwnj-02-ref.xhtml # HTTP(..) for ../filters.svg
random-if(MOZ_WIDGET_TOOLKIT=="gtk2") != zwnj-01.html zwnj-01-notref.html # Bad fonts on the tinderbox -- works locally
fails-if(MOZ_WIDGET_TOOLKIT=="windows") == cgj-01.html cgj-01-ref.html # bug 455455
== 444656.html 444656-ref.html
== 449555-1.html 449555-1-ref.html

View File

@ -1,6 +1,7 @@
<!DOCTYPE html>
<!-- Reference rendering for zwnj-02.html. No spans, no ZWNJs. Everything
should connect -->
<html>
<head>
<title>ZWNJ test</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="1.1">
<!-- use an empty g to force filters.svg to load before onload -->
<use xlink:href="../filters.svg#empty" />
<foreignObject filter="url(../filters.svg#NonWhiteToBlack)"
x="0" y="0" height="100%" width="100%">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- Reference rendering for zwnj-02.html. No spans, no ZWNJs. Everything
should connect -->
<head>
<title>ZWNJ test</title>
<style type="text/css">
html, body { margin: 0; background: white; color: black; height: 100%; width: 100%; }
body {
font-size: 36px;
}
</style>
</head>
<body lang="ar">
<p>&#x647;&#x641;&#x62A;&#x647;&#x647;&#x627;</p>
<p>&#x645;&#x648;&#x632;&#x647;&#x647;&#x627;</p>
<p>&#x633;&#x647;&#x634;&#x646;&#x628;&#x647;</p>
<p>&#x631;&#x627;&#x647;&#x622;&#x647;&#x646;</p>
<p>&#x646;&#x631;&#x645;&#x627;&#x641;&#x632;&#x627;&#x631;</p>
</body>
</html>
</foreignObject>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -1,12 +1,21 @@
<!DOCTYPE html>
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="1.1">
<!-- use an empty g to force filters.svg to load before onload -->
<use xlink:href="../filters.svg#empty" />
<foreignObject filter="url(../filters.svg#NonWhiteToBlack)"
x="0" y="0" height="100%" width="100%">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- ZWNJ test #2. The words from zwnj-01.html with the ZWNJs replaced by
span boundaries. Correct behaviour is for the letters to connect across the
spans -->
<html>
<head>
<title>ZWNJ test</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style type="text/css">
html, body { margin: 0; background: white; color: black; height: 100%; width: 100%; }
body {
font-size: 36px;
}
@ -20,3 +29,5 @@
<p><span>&#x646;&#x631;&#x645;</span><span>&#x627;&#x641;&#x632;&#x627;&#x631;</span></p>
</body>
</html>
</foreignObject>
</svg>

Before

Width:  |  Height:  |  Size: 812 B

After

Width:  |  Height:  |  Size: 1.2 KiB