Bug 658949 patch 0: Fix existing tests that use "#" in data URIs to use %23 instead. rs=bz

This commit is contained in:
Daniel Holbert 2011-05-24 03:36:31 -07:00
Родитель e8d76cf510
Коммит 945bf1e21d
6 изменённых файлов: 17 добавлений и 16 удалений

Просмотреть файл

@ -31,7 +31,7 @@ function test() {
content.location =
"data:text/html," +
"<style type='text/css'>#test-image,#not-test-image {background-image: url('about:logo?c');}</style>" +
"<style type='text/css'>%23test-image,%23not-test-image {background-image: url('about:logo?c');}</style>" +
"<img src='about:logo?b' height=300 width=350 alt=2 id='not-test-image'>" +
"<img src='about:logo?b' height=300 width=350 alt=2>" +
"<img src='about:logo?a' height=200 width=250>" +

Просмотреть файл

@ -15,12 +15,12 @@ function test() {
}
// very long page that produces black bars at the right
let html1 = '<html><body style="background-color: #00f;">' +
'<div style="background: #fff; width: 95%; height: 10000px; ' +
let html1 = '<html><body style="background-color: %2300f;">' +
'<div style="background: %23fff; width: 95%; height: 10000px; ' +
' margin: 0 auto;"></div></body></html>';
// very short page that produces black bars at the bottom
let html2 = '<html><body style="background-color: #00f;"></body></html>';
let html2 = '<html><body style="background-color: %2300f;"></body></html>';
let tests = [{
url: 'data:text/html,' + html1,

Просмотреть файл

@ -189,7 +189,7 @@ SimpleTest.waitForFocus(runTest);
<button id="b2" label="Button"/>
<button id="b3" label="Button"/>
<iframe id="child" src="data:text/html,&lt;html&gt;&lt;style&gt;* { outline: none; -moz-appearance: none; } #elem:focus { outline: 2px solid red; } #elem:-moz-focusring { outline: 1px solid blue; }&lt;/style&gt;&lt;div id='container'&gt;&lt;/html&gt;"/>
<iframe id="child" src="data:text/html,&lt;html&gt;&lt;style&gt;* { outline: none; -moz-appearance: none; } %23elem:focus { outline: 2px solid red; } %23elem:-moz-focusring { outline: 1px solid blue; }&lt;/style&gt;&lt;div id='container'&gt;&lt;/html&gt;"/>
<body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>

Просмотреть файл

@ -7,7 +7,7 @@
* 我听见 我忘记; 我看见 我记住; 我做 我了解
*/
const sample = "~{NJK{K-JGI59OAK~}5~{7VVS!#5+JG#,K{K-2;R*GsHTH;JGR;8vI59OS@T6!#~} ~{NRL}<{~} ~{NRM|<G~}; ~{NR?4<{~} ~{NR<GW!~}; ~{NRWv~} ~{NRAK=b!#~}";
const sample = "~{NJK{K-JGI59OAK~}5~{7VVS!%235+JG%23,K{K-2;R*GsHTH;JGR;8vI59OS@T6!%23~} ~{NRL}<{~} ~{NRM|<G~}; ~{NR?4<{~} ~{NR<GW!~}; ~{NRWv~} ~{NRAK=b!%23~}";
const expected = "\u95EE\u4ED6\u8C01\u662F\u50BB\u74DC\u4E865\u5206\u949F\u3002\u4F46\u662F\uFF0C\u4ED6\u8C01\u4E0D\u8981\u6C42\u4ECD\u7136\u662F\u4E00\u4E2A\u50BB\u74DC\u6C38\u8FDC\u3002 \u6211\u542C\u89C1 \u6211\u5FD8\u8BB0; \u6211\u770B\u89C1 \u6211\u8BB0\u4F4F; \u6211\u505A \u6211\u4E86\u89E3\u3002";

Просмотреть файл

@ -46,9 +46,10 @@ function run()
function test_document_rule(urltests, shouldapply)
{
var zIndex = ++zIndexCounter;
var rule = "@-moz-document " + urltests +
" { #display { z-index: " + zIndex + " } }";
var sheeturi = "data:text/css," + encodeURI(rule);
var encodedRule = encodeURI("@-moz-document " + urltests + " { ") +
"%23" + // encoded hash character for "#display"
encodeURI("display { z-index: " + zIndex + " } }");
var sheeturi = "data:text/css," + encodedRule;
set_user_sheet(sheeturi);
if (shouldapply) {
is(cs.zIndex, zIndex,

Просмотреть файл

@ -104,13 +104,13 @@ base + "#6ident, #a {color: red }",
".\\--ident, .a { color: green; }",
// CSS2.1 section 4.1.5 and 4.2
"@import 'data:text/css,#a{color:green}';",
"@import \"data:text/css,#a{color:green}\";",
"@import url(data:text/css,#a{color:green});",
"@import 'data:text/css,#a{color:green}' screen;",
base + "@import 'data:text/css,#a{color:red}' blahblahblah;",
"@import 'data:text/css,#a{color:green}'",
"@import 'data:text/css,#a{color:green}",
"@import 'data:text/css,%23a{color:green}';",
"@import \"data:text/css,%23a{color:green}\";",
"@import url(data:text/css,%23a{color:green});",
"@import 'data:text/css,%23a{color:green}' screen;",
base + "@import 'data:text/css,%23a{color:red}' blahblahblah;",
"@import 'data:text/css,%23a{color:green}'",
"@import 'data:text/css,%23a{color:green}",
"@foo {}" + base,
"@foo bar {}" + base,
"@foo; " + base,