зеркало из https://github.com/mozilla/pjs.git
Bug 658949 patch 0: Fix existing tests that use "#" in data URIs to use %23 instead. rs=bz
This commit is contained in:
Родитель
99cf048dd2
Коммит
84fa7a2973
|
@ -31,7 +31,7 @@ function test() {
|
||||||
|
|
||||||
content.location =
|
content.location =
|
||||||
"data:text/html," +
|
"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 id='not-test-image'>" +
|
||||||
"<img src='about:logo?b' height=300 width=350 alt=2>" +
|
"<img src='about:logo?b' height=300 width=350 alt=2>" +
|
||||||
"<img src='about:logo?a' height=200 width=250>" +
|
"<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
|
// very long page that produces black bars at the right
|
||||||
let html1 = '<html><body style="background-color: #00f;">' +
|
let html1 = '<html><body style="background-color: %2300f;">' +
|
||||||
'<div style="background: #fff; width: 95%; height: 10000px; ' +
|
'<div style="background: %23fff; width: 95%; height: 10000px; ' +
|
||||||
' margin: 0 auto;"></div></body></html>';
|
' margin: 0 auto;"></div></body></html>';
|
||||||
|
|
||||||
// very short page that produces black bars at the bottom
|
// 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 = [{
|
let tests = [{
|
||||||
url: 'data:text/html,' + html1,
|
url: 'data:text/html,' + html1,
|
||||||
|
|
|
@ -189,7 +189,7 @@ SimpleTest.waitForFocus(runTest);
|
||||||
<button id="b2" label="Button"/>
|
<button id="b2" label="Button"/>
|
||||||
<button id="b3" label="Button"/>
|
<button id="b3" label="Button"/>
|
||||||
|
|
||||||
<iframe id="child" src="data:text/html,<html><style>* { outline: none; -moz-appearance: none; } #elem:focus { outline: 2px solid red; } #elem:-moz-focusring { outline: 1px solid blue; }</style><div id='container'></html>"/>
|
<iframe id="child" src="data:text/html,<html><style>* { outline: none; -moz-appearance: none; } %23elem:focus { outline: 2px solid red; } %23elem:-moz-focusring { outline: 1px solid blue; }</style><div id='container'></html>"/>
|
||||||
|
|
||||||
<body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
|
<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";
|
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)
|
function test_document_rule(urltests, shouldapply)
|
||||||
{
|
{
|
||||||
var zIndex = ++zIndexCounter;
|
var zIndex = ++zIndexCounter;
|
||||||
var rule = "@-moz-document " + urltests +
|
var encodedRule = encodeURI("@-moz-document " + urltests + " { ") +
|
||||||
" { #display { z-index: " + zIndex + " } }";
|
"%23" + // encoded hash character for "#display"
|
||||||
var sheeturi = "data:text/css," + encodeURI(rule);
|
encodeURI("display { z-index: " + zIndex + " } }");
|
||||||
|
var sheeturi = "data:text/css," + encodedRule;
|
||||||
set_user_sheet(sheeturi);
|
set_user_sheet(sheeturi);
|
||||||
if (shouldapply) {
|
if (shouldapply) {
|
||||||
is(cs.zIndex, zIndex,
|
is(cs.zIndex, zIndex,
|
||||||
|
|
|
@ -104,13 +104,13 @@ base + "#6ident, #a {color: red }",
|
||||||
".\\--ident, .a { color: green; }",
|
".\\--ident, .a { color: green; }",
|
||||||
|
|
||||||
// CSS2.1 section 4.1.5 and 4.2
|
// CSS2.1 section 4.1.5 and 4.2
|
||||||
"@import 'data:text/css,#a{color:green}';",
|
"@import 'data:text/css,%23a{color:green}';",
|
||||||
"@import \"data:text/css,#a{color:green}\";",
|
"@import \"data:text/css,%23a{color:green}\";",
|
||||||
"@import url(data:text/css,#a{color:green});",
|
"@import url(data:text/css,%23a{color:green});",
|
||||||
"@import 'data:text/css,#a{color:green}' screen;",
|
"@import 'data:text/css,%23a{color:green}' screen;",
|
||||||
base + "@import 'data:text/css,#a{color:red}' blahblahblah;",
|
base + "@import 'data:text/css,%23a{color:red}' blahblahblah;",
|
||||||
"@import 'data:text/css,#a{color:green}'",
|
"@import 'data:text/css,%23a{color:green}'",
|
||||||
"@import 'data:text/css,#a{color:green}",
|
"@import 'data:text/css,%23a{color:green}",
|
||||||
"@foo {}" + base,
|
"@foo {}" + base,
|
||||||
"@foo bar {}" + base,
|
"@foo bar {}" + base,
|
||||||
"@foo; " + base,
|
"@foo; " + base,
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
- ***** END LICENSE BLOCK ***** -->
|
- ***** END LICENSE BLOCK ***** -->
|
||||||
<?xml-stylesheet type="text/css" href="data:text/css,
|
<?xml-stylesheet type="text/css" href="data:text/css,
|
||||||
|
|
||||||
#_box_windowsDefaultTheme:-moz-system-metric(windows-default-theme) {
|
%23_box_windowsDefaultTheme:-moz-system-metric(windows-default-theme) {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче