mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 234628 part 4 - Test cases for character encoding override code. r=bzbarsky.
--HG-- rename : docshell/test/browser/browser_bug134911.js => docshell/test/browser/browser_bug234628-1.js rename : docshell/test/browser/browser_bug134911.js => docshell/test/browser/browser_bug234628-10.js rename : docshell/test/browser/browser_bug134911.js => docshell/test/browser/browser_bug234628-11.js rename : docshell/test/browser/browser_bug134911.js => docshell/test/browser/browser_bug234628-2.js rename : docshell/test/browser/browser_bug134911.js => docshell/test/browser/browser_bug234628-3.js rename : docshell/test/browser/browser_bug134911.js => docshell/test/browser/browser_bug234628-4.js rename : docshell/test/browser/browser_bug134911.js => docshell/test/browser/browser_bug234628-5.js rename : docshell/test/browser/browser_bug134911.js => docshell/test/browser/browser_bug234628-6.js rename : docshell/test/browser/browser_bug134911.js => docshell/test/browser/browser_bug234628-7.js rename : docshell/test/browser/browser_bug134911.js => docshell/test/browser/browser_bug234628-8.js rename : docshell/test/browser/browser_bug134911.js => docshell/test/browser/browser_bug234628-9.js
This commit is contained in:
parent
18704e2d42
commit
019ae01d3f
@ -32,6 +32,42 @@ MOCHITEST_BROWSER_FILES = \
|
|||||||
browser_bug670318.js \
|
browser_bug670318.js \
|
||||||
file_bug670318.html \
|
file_bug670318.html \
|
||||||
browser_bug673467.js \
|
browser_bug673467.js \
|
||||||
|
browser_bug234628-1.js \
|
||||||
|
file_bug234628-1.html \
|
||||||
|
file_bug234628-1-child.html \
|
||||||
|
browser_bug234628-2.js \
|
||||||
|
file_bug234628-2.html \
|
||||||
|
file_bug234628-2-child.html \
|
||||||
|
browser_bug234628-3.js \
|
||||||
|
file_bug234628-3.html \
|
||||||
|
file_bug234628-3-child.html \
|
||||||
|
browser_bug234628-4.js \
|
||||||
|
file_bug234628-4.html \
|
||||||
|
file_bug234628-4-child.html \
|
||||||
|
browser_bug234628-5.js \
|
||||||
|
file_bug234628-5.html \
|
||||||
|
file_bug234628-5-child.html \
|
||||||
|
browser_bug234628-6.js \
|
||||||
|
file_bug234628-6.html \
|
||||||
|
file_bug234628-6-child.html \
|
||||||
|
file_bug234628-6-child.html^headers^ \
|
||||||
|
browser_bug234628-7.js \
|
||||||
|
file_bug234628-7.html \
|
||||||
|
file_bug234628-7-child.html \
|
||||||
|
file_bug234628-7-child.html^headers^ \
|
||||||
|
browser_bug234628-8.js \
|
||||||
|
file_bug234628-8.html \
|
||||||
|
file_bug234628-8-child.html \
|
||||||
|
browser_bug234628-9.js \
|
||||||
|
file_bug234628-9.html \
|
||||||
|
file_bug234628-9-child.html \
|
||||||
|
browser_bug234628-10.js \
|
||||||
|
file_bug234628-10.html \
|
||||||
|
file_bug234628-10-child.xhtml \
|
||||||
|
browser_bug234628-11.js \
|
||||||
|
file_bug234628-11.html \
|
||||||
|
file_bug234628-11-child.xhtml \
|
||||||
|
file_bug234628-11-child.xhtml^headers^ \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
39
docshell/test/browser/browser_bug234628-1.js
Normal file
39
docshell/test/browser/browser_bug234628-1.js
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
function test() {
|
||||||
|
waitForExplicitFinish();
|
||||||
|
|
||||||
|
var rootDir = "http://mochi.test:8888/browser/docshell/test/browser/";
|
||||||
|
gBrowser.selectedTab = gBrowser.addTab(rootDir + "file_bug234628-1.html");
|
||||||
|
gBrowser.selectedBrowser.addEventListener("load", afterOpen, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
function afterOpen(event) {
|
||||||
|
if (event.target != gBrowser.contentDocument) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gBrowser.selectedBrowser.removeEventListener("load", afterOpen, true);
|
||||||
|
gBrowser.selectedBrowser.addEventListener("load", afterChangeCharset, true);
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.documentElement.textContent.indexOf('\u20AC'), 129, "Parent doc should be windows-1252 initially");
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.documentElement.textContent.indexOf('\u20AC'), 85, "Child doc should be windows-1252 initially");
|
||||||
|
|
||||||
|
BrowserSetForcedCharacterSet("windows-1251");
|
||||||
|
}
|
||||||
|
|
||||||
|
function afterChangeCharset(event) {
|
||||||
|
if (event.target != gBrowser.contentDocument) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gBrowser.selectedBrowser.removeEventListener("load", afterChangeCharset, true);
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.documentElement.textContent.indexOf('\u0402'), 129, "Parent doc should decode as windows-1251 subsequently");
|
||||||
|
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.documentElement.textContent.indexOf('\u0402'), 85, "Child doc should decode as windows-1251 subsequently");
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.characterSet, "windows-1251", "Parent doc should report windows-1251 subsequently");
|
||||||
|
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.characterSet, "windows-1251", "Child doc should report windows-1251 subsequently");
|
||||||
|
|
||||||
|
gBrowser.removeCurrentTab();
|
||||||
|
finish();
|
||||||
|
}
|
39
docshell/test/browser/browser_bug234628-10.js
Normal file
39
docshell/test/browser/browser_bug234628-10.js
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
function test() {
|
||||||
|
waitForExplicitFinish();
|
||||||
|
|
||||||
|
var rootDir = "http://mochi.test:8888/browser/docshell/test/browser/";
|
||||||
|
gBrowser.selectedTab = gBrowser.addTab(rootDir + "file_bug234628-10.html");
|
||||||
|
gBrowser.selectedBrowser.addEventListener("load", afterOpen, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
function afterOpen(event) {
|
||||||
|
if (event.target != gBrowser.contentDocument) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gBrowser.selectedBrowser.removeEventListener("load", afterOpen, true);
|
||||||
|
gBrowser.selectedBrowser.addEventListener("load", afterChangeCharset, true);
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.documentElement.textContent.indexOf('\u20AC'), 151, "Parent doc should be windows-1252 initially");
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.documentElement.textContent.indexOf('\u20AC'), 71, "Child doc should be utf-8 initially");
|
||||||
|
|
||||||
|
BrowserSetForcedCharacterSet("windows-1251");
|
||||||
|
}
|
||||||
|
|
||||||
|
function afterChangeCharset(event) {
|
||||||
|
if (event.target != gBrowser.contentDocument) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gBrowser.selectedBrowser.removeEventListener("load", afterChangeCharset, true);
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.documentElement.textContent.indexOf('\u0402'), 151, "Parent doc should decode as windows-1251 subsequently");
|
||||||
|
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.documentElement.textContent.indexOf('\u20AC'), 71, "Child doc should decode as utf-8 subsequently");
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.characterSet, "windows-1251", "Parent doc should report windows-1251 subsequently");
|
||||||
|
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.characterSet, "UTF-8", "Child doc should report UTF-8 subsequently");
|
||||||
|
|
||||||
|
gBrowser.removeCurrentTab();
|
||||||
|
finish();
|
||||||
|
}
|
39
docshell/test/browser/browser_bug234628-11.js
Normal file
39
docshell/test/browser/browser_bug234628-11.js
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
function test() {
|
||||||
|
waitForExplicitFinish();
|
||||||
|
|
||||||
|
var rootDir = "http://mochi.test:8888/browser/docshell/test/browser/";
|
||||||
|
gBrowser.selectedTab = gBrowser.addTab(rootDir + "file_bug234628-11.html");
|
||||||
|
gBrowser.selectedBrowser.addEventListener("load", afterOpen, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
function afterOpen(event) {
|
||||||
|
if (event.target != gBrowser.contentDocument) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gBrowser.selectedBrowser.removeEventListener("load", afterOpen, true);
|
||||||
|
gBrowser.selectedBrowser.addEventListener("load", afterChangeCharset, true);
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.documentElement.textContent.indexOf('\u20AC'), 193, "Parent doc should be windows-1252 initially");
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.documentElement.textContent.indexOf('\u20AC'), 107, "Child doc should be utf-8 initially");
|
||||||
|
|
||||||
|
BrowserSetForcedCharacterSet("windows-1251");
|
||||||
|
}
|
||||||
|
|
||||||
|
function afterChangeCharset(event) {
|
||||||
|
if (event.target != gBrowser.contentDocument) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gBrowser.selectedBrowser.removeEventListener("load", afterChangeCharset, true);
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.documentElement.textContent.indexOf('\u0402'), 193, "Parent doc should decode as windows-1251 subsequently");
|
||||||
|
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.documentElement.textContent.indexOf('\u20AC'), 107, "Child doc should decode as utf-8 subsequently");
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.characterSet, "windows-1251", "Parent doc should report windows-1251 subsequently");
|
||||||
|
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.characterSet, "UTF-8", "Child doc should report UTF-8 subsequently");
|
||||||
|
|
||||||
|
gBrowser.removeCurrentTab();
|
||||||
|
finish();
|
||||||
|
}
|
39
docshell/test/browser/browser_bug234628-2.js
Normal file
39
docshell/test/browser/browser_bug234628-2.js
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
function test() {
|
||||||
|
waitForExplicitFinish();
|
||||||
|
|
||||||
|
var rootDir = "http://mochi.test:8888/browser/docshell/test/browser/";
|
||||||
|
gBrowser.selectedTab = gBrowser.addTab(rootDir + "file_bug234628-2.html");
|
||||||
|
gBrowser.selectedBrowser.addEventListener("load", afterOpen, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
function afterOpen(event) {
|
||||||
|
if (event.target != gBrowser.contentDocument) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gBrowser.selectedBrowser.removeEventListener("load", afterOpen, true);
|
||||||
|
gBrowser.selectedBrowser.addEventListener("load", afterChangeCharset, true);
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.documentElement.textContent.indexOf('\u20AC'), 129, "Parent doc should be windows-1252 initially");
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.documentElement.textContent.indexOf('\u00E2\u201A\u00AC'), 78, "Child doc should be windows-1252 initially");
|
||||||
|
|
||||||
|
BrowserSetForcedCharacterSet("windows-1251");
|
||||||
|
}
|
||||||
|
|
||||||
|
function afterChangeCharset(event) {
|
||||||
|
if (event.target != gBrowser.contentDocument) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gBrowser.selectedBrowser.removeEventListener("load", afterChangeCharset, true);
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.documentElement.textContent.indexOf('\u0402'), 129, "Parent doc should decode as windows-1251 subsequently");
|
||||||
|
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.documentElement.textContent.indexOf('\u0432\u201A\u00AC'), 78, "Child doc should decode as windows-1251 subsequently");
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.characterSet, "windows-1251", "Parent doc should report windows-1251 subsequently");
|
||||||
|
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.characterSet, "windows-1251", "Child doc should report windows-1251 subsequently");
|
||||||
|
|
||||||
|
gBrowser.removeCurrentTab();
|
||||||
|
finish();
|
||||||
|
}
|
39
docshell/test/browser/browser_bug234628-3.js
Normal file
39
docshell/test/browser/browser_bug234628-3.js
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
function test() {
|
||||||
|
waitForExplicitFinish();
|
||||||
|
|
||||||
|
var rootDir = "http://mochi.test:8888/browser/docshell/test/browser/";
|
||||||
|
gBrowser.selectedTab = gBrowser.addTab(rootDir + "file_bug234628-3.html");
|
||||||
|
gBrowser.selectedBrowser.addEventListener("load", afterOpen, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
function afterOpen(event) {
|
||||||
|
if (event.target != gBrowser.contentDocument) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gBrowser.selectedBrowser.removeEventListener("load", afterOpen, true);
|
||||||
|
gBrowser.selectedBrowser.addEventListener("load", afterChangeCharset, true);
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.documentElement.textContent.indexOf('\u20AC'), 118, "Parent doc should be windows-1252 initially");
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.documentElement.textContent.indexOf('\u20AC'), 73, "Child doc should be utf-8 initially");
|
||||||
|
|
||||||
|
BrowserSetForcedCharacterSet("windows-1251");
|
||||||
|
}
|
||||||
|
|
||||||
|
function afterChangeCharset(event) {
|
||||||
|
if (event.target != gBrowser.contentDocument) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gBrowser.selectedBrowser.removeEventListener("load", afterChangeCharset, true);
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.documentElement.textContent.indexOf('\u0402'), 118, "Parent doc should decode as windows-1251 subsequently");
|
||||||
|
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.documentElement.textContent.indexOf('\u0432\u201A\u00AC'), 73, "Child doc should decode as windows-1251 subsequently");
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.characterSet, "windows-1251", "Parent doc should report windows-1251 subsequently");
|
||||||
|
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.characterSet, "windows-1251", "Child doc should report windows-1251 subsequently");
|
||||||
|
|
||||||
|
gBrowser.removeCurrentTab();
|
||||||
|
finish();
|
||||||
|
}
|
39
docshell/test/browser/browser_bug234628-4.js
Normal file
39
docshell/test/browser/browser_bug234628-4.js
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
function test() {
|
||||||
|
waitForExplicitFinish();
|
||||||
|
|
||||||
|
var rootDir = "http://mochi.test:8888/browser/docshell/test/browser/";
|
||||||
|
gBrowser.selectedTab = gBrowser.addTab(rootDir + "file_bug234628-4.html");
|
||||||
|
gBrowser.selectedBrowser.addEventListener("load", afterOpen, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
function afterOpen(event) {
|
||||||
|
if (event.target != gBrowser.contentDocument) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gBrowser.selectedBrowser.removeEventListener("load", afterOpen, true);
|
||||||
|
gBrowser.selectedBrowser.addEventListener("load", afterChangeCharset, true);
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.documentElement.textContent.indexOf('\u20AC'), 132, "Parent doc should be windows-1252 initially");
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.documentElement.textContent.indexOf('\u20AC'), 79, "Child doc should be utf-8 initially");
|
||||||
|
|
||||||
|
BrowserSetForcedCharacterSet("windows-1251");
|
||||||
|
}
|
||||||
|
|
||||||
|
function afterChangeCharset(event) {
|
||||||
|
if (event.target != gBrowser.contentDocument) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gBrowser.selectedBrowser.removeEventListener("load", afterChangeCharset, true);
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.documentElement.textContent.indexOf('\u0402'), 132, "Parent doc should decode as windows-1251 subsequently");
|
||||||
|
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.documentElement.textContent.indexOf('\u20AC'), 79, "Child doc should decode as utf-8 subsequently");
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.characterSet, "windows-1251", "Parent doc should report windows-1251 subsequently");
|
||||||
|
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.characterSet, "UTF-8", "Child doc should report UTF-8 subsequently");
|
||||||
|
|
||||||
|
gBrowser.removeCurrentTab();
|
||||||
|
finish();
|
||||||
|
}
|
39
docshell/test/browser/browser_bug234628-5.js
Normal file
39
docshell/test/browser/browser_bug234628-5.js
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
function test() {
|
||||||
|
waitForExplicitFinish();
|
||||||
|
|
||||||
|
var rootDir = "http://mochi.test:8888/browser/docshell/test/browser/";
|
||||||
|
gBrowser.selectedTab = gBrowser.addTab(rootDir + "file_bug234628-5.html");
|
||||||
|
gBrowser.selectedBrowser.addEventListener("load", afterOpen, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
function afterOpen(event) {
|
||||||
|
if (event.target != gBrowser.contentDocument) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gBrowser.selectedBrowser.removeEventListener("load", afterOpen, true);
|
||||||
|
gBrowser.selectedBrowser.addEventListener("load", afterChangeCharset, true);
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.documentElement.textContent.indexOf('\u20AC'), 146, "Parent doc should be windows-1252 initially");
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.documentElement.textContent.indexOf('\u20AC'), 87, "Child doc should be utf-16 initially");
|
||||||
|
|
||||||
|
BrowserSetForcedCharacterSet("windows-1251");
|
||||||
|
}
|
||||||
|
|
||||||
|
function afterChangeCharset(event) {
|
||||||
|
if (event.target != gBrowser.contentDocument) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gBrowser.selectedBrowser.removeEventListener("load", afterChangeCharset, true);
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.documentElement.textContent.indexOf('\u0402'), 146, "Parent doc should decode as windows-1251 subsequently");
|
||||||
|
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.documentElement.textContent.indexOf('\u20AC'), 87, "Child doc should decode as utf-16 subsequently");
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.characterSet, "windows-1251", "Parent doc should report windows-1251 subsequently");
|
||||||
|
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.characterSet, "UTF-16", "Child doc should report UTF-16 subsequently");
|
||||||
|
|
||||||
|
gBrowser.removeCurrentTab();
|
||||||
|
finish();
|
||||||
|
}
|
39
docshell/test/browser/browser_bug234628-6.js
Normal file
39
docshell/test/browser/browser_bug234628-6.js
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
function test() {
|
||||||
|
waitForExplicitFinish();
|
||||||
|
|
||||||
|
var rootDir = "http://mochi.test:8888/browser/docshell/test/browser/";
|
||||||
|
gBrowser.selectedTab = gBrowser.addTab(rootDir + "file_bug234628-6.html");
|
||||||
|
gBrowser.selectedBrowser.addEventListener("load", afterOpen, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
function afterOpen(event) {
|
||||||
|
if (event.target != gBrowser.contentDocument) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gBrowser.selectedBrowser.removeEventListener("load", afterOpen, true);
|
||||||
|
gBrowser.selectedBrowser.addEventListener("load", afterChangeCharset, true);
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.documentElement.textContent.indexOf('\u20AC'), 190, "Parent doc should be windows-1252 initially");
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.documentElement.textContent.indexOf('\u20AC'), 109, "Child doc should be utf-16 initially");
|
||||||
|
|
||||||
|
BrowserSetForcedCharacterSet("windows-1251");
|
||||||
|
}
|
||||||
|
|
||||||
|
function afterChangeCharset(event) {
|
||||||
|
if (event.target != gBrowser.contentDocument) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gBrowser.selectedBrowser.removeEventListener("load", afterChangeCharset, true);
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.documentElement.textContent.indexOf('\u0402'), 190, "Parent doc should decode as windows-1251 subsequently");
|
||||||
|
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.documentElement.textContent.indexOf('\u20AC'), 109, "Child doc should decode as utf-16 subsequently");
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.characterSet, "windows-1251", "Parent doc should report windows-1251 subsequently");
|
||||||
|
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.characterSet, "UTF-16BE", "Child doc should report UTF-16 subsequently");
|
||||||
|
|
||||||
|
gBrowser.removeCurrentTab();
|
||||||
|
finish();
|
||||||
|
}
|
39
docshell/test/browser/browser_bug234628-7.js
Normal file
39
docshell/test/browser/browser_bug234628-7.js
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
function test() {
|
||||||
|
waitForExplicitFinish();
|
||||||
|
|
||||||
|
var rootDir = "http://mochi.test:8888/browser/docshell/test/browser/";
|
||||||
|
gBrowser.selectedTab = gBrowser.addTab(rootDir + "file_bug234628-7.html");
|
||||||
|
gBrowser.selectedBrowser.addEventListener("load", afterOpen, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
function afterOpen(event) {
|
||||||
|
if (event.target != gBrowser.contentDocument) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gBrowser.selectedBrowser.removeEventListener("load", afterOpen, true);
|
||||||
|
gBrowser.selectedBrowser.addEventListener("load", afterChangeCharset, true);
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.documentElement.textContent.indexOf('\u20AC'), 188, "Parent doc should be windows-1252 initially");
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.documentElement.textContent.indexOf('\u20AC'), 107, "Child doc should be utf-8 initially");
|
||||||
|
|
||||||
|
BrowserSetForcedCharacterSet("windows-1251");
|
||||||
|
}
|
||||||
|
|
||||||
|
function afterChangeCharset(event) {
|
||||||
|
if (event.target != gBrowser.contentDocument) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gBrowser.selectedBrowser.removeEventListener("load", afterChangeCharset, true);
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.documentElement.textContent.indexOf('\u0402'), 188, "Parent doc should decode as windows-1251 subsequently");
|
||||||
|
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.documentElement.textContent.indexOf('\u0432\u201A\u00AC'), 107, "Child doc should decode as windows-1251 subsequently");
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.characterSet, "windows-1251", "Parent doc should report windows-1251 subsequently");
|
||||||
|
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.characterSet, "windows-1251", "Child doc should report windows-1251 subsequently");
|
||||||
|
|
||||||
|
gBrowser.removeCurrentTab();
|
||||||
|
finish();
|
||||||
|
}
|
23
docshell/test/browser/browser_bug234628-8.js
Normal file
23
docshell/test/browser/browser_bug234628-8.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
function test() {
|
||||||
|
waitForExplicitFinish();
|
||||||
|
|
||||||
|
var rootDir = "http://mochi.test:8888/browser/docshell/test/browser/";
|
||||||
|
gBrowser.selectedTab = gBrowser.addTab(rootDir + "file_bug234628-8.html");
|
||||||
|
gBrowser.selectedBrowser.addEventListener("load", afterOpen, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
function afterOpen(event) {
|
||||||
|
if (event.target != gBrowser.contentDocument) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gBrowser.selectedBrowser.removeEventListener("load", afterOpen, true);
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.documentElement.textContent.indexOf('\u0402'), 156, "Parent doc should be windows-1251");
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.documentElement.textContent.indexOf('\u0402'), 99, "Child doc should be windows-1251");
|
||||||
|
|
||||||
|
gBrowser.removeCurrentTab();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
23
docshell/test/browser/browser_bug234628-9.js
Normal file
23
docshell/test/browser/browser_bug234628-9.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
function test() {
|
||||||
|
waitForExplicitFinish();
|
||||||
|
|
||||||
|
var rootDir = "http://mochi.test:8888/browser/docshell/test/browser/";
|
||||||
|
gBrowser.selectedTab = gBrowser.addTab(rootDir + "file_bug234628-9.html");
|
||||||
|
gBrowser.selectedBrowser.addEventListener("load", afterOpen, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
function afterOpen(event) {
|
||||||
|
if (event.target != gBrowser.contentDocument) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gBrowser.selectedBrowser.removeEventListener("load", afterOpen, true);
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.documentElement.textContent.indexOf('\u20AC'), 145, "Parent doc should be UTF-16");
|
||||||
|
|
||||||
|
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.documentElement.textContent.indexOf('\u20AC'), 96, "Child doc should be windows-1252");
|
||||||
|
|
||||||
|
gBrowser.removeCurrentTab();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
12
docshell/test/browser/file_bug234628-1-child.html
Normal file
12
docshell/test/browser/file_bug234628-1-child.html
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta content="width=device-width, initial-scale=1" name="viewport">
|
||||||
|
<title>No encoding declaration in parent or child</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Euro sign if decoded as Windows-1252: €</p>
|
||||||
|
<p>a with diaeresis if decoded as Windows-1252: ä</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
17
docshell/test/browser/file_bug234628-1.html
Normal file
17
docshell/test/browser/file_bug234628-1.html
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta content="width=device-width, initial-scale=1" name="viewport">
|
||||||
|
<title>No encoding declaration in parent or child</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>No encoding declaration in parent or child</h1>
|
||||||
|
|
||||||
|
<p>Euro sign if decoded as Windows-1252: €</p>
|
||||||
|
<p>a with diaeresis if decoded as Windows-1252: ä</p>
|
||||||
|
|
||||||
|
<iframe src="file_bug234628-1-child.html"></iframe>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
4
docshell/test/browser/file_bug234628-10-child.xhtml
Normal file
4
docshell/test/browser/file_bug234628-10-child.xhtml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head><title>XML child with no encoding declaration</title></head>
|
||||||
|
<body><p>Euro sign if decoded as UTF-8: €</p></body>
|
||||||
|
</html>
|
17
docshell/test/browser/file_bug234628-10.html
Normal file
17
docshell/test/browser/file_bug234628-10.html
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta content="width=device-width, initial-scale=1" name="viewport">
|
||||||
|
<title>No encoding declaration in HTML parent or XHTML child</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>No encoding declaration in HTML parent or XHTML child</h1>
|
||||||
|
|
||||||
|
<p>Euro sign if decoded as Windows-1252: €</p>
|
||||||
|
<p>a with diaeresis if decoded as Windows-1252: ä</p>
|
||||||
|
|
||||||
|
<iframe src="file_bug234628-10-child.xhtml"></iframe>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
4
docshell/test/browser/file_bug234628-11-child.xhtml
Normal file
4
docshell/test/browser/file_bug234628-11-child.xhtml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head><title>No encoding declaration in HTML parent and HTTP declaration in XHTML child</title></head>
|
||||||
|
<body><p>Euro sign if decoded as UTF-8: €</p></body>
|
||||||
|
</html>
|
@ -0,0 +1 @@
|
|||||||
|
Content-Type: application/xhtml+xml; charset=utf-8
|
17
docshell/test/browser/file_bug234628-11.html
Normal file
17
docshell/test/browser/file_bug234628-11.html
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta content="width=device-width, initial-scale=1" name="viewport">
|
||||||
|
<title>No encoding declaration in HTML parent and HTTP declaration in XHTML child</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>No encoding declaration in HTML parent and HTTP declaration in XHTML child</h1>
|
||||||
|
|
||||||
|
<p>Euro sign if decoded as Windows-1252: €</p>
|
||||||
|
<p>a with diaeresis if decoded as Windows-1252: ä</p>
|
||||||
|
|
||||||
|
<iframe src="file_bug234628-11-child.xhtml"></iframe>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
12
docshell/test/browser/file_bug234628-2-child.html
Normal file
12
docshell/test/browser/file_bug234628-2-child.html
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta content="width=device-width, initial-scale=1" name="viewport">
|
||||||
|
<title>No encoding declaration in parent or child</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Euro sign if decoded as UTF-8: €</p>
|
||||||
|
<p>a with diaeresis if decoded as UTF-8: ä</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
17
docshell/test/browser/file_bug234628-2.html
Normal file
17
docshell/test/browser/file_bug234628-2.html
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta content="width=device-width, initial-scale=1" name="viewport">
|
||||||
|
<title>No encoding declaration in parent or child</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>No encoding declaration in parent or child</h1>
|
||||||
|
|
||||||
|
<p>Euro sign if decoded as Windows-1252: €</p>
|
||||||
|
<p>a with diaeresis if decoded as Windows-1252: ä</p>
|
||||||
|
|
||||||
|
<iframe src="file_bug234628-2-child.html"></iframe>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
13
docshell/test/browser/file_bug234628-3-child.html
Normal file
13
docshell/test/browser/file_bug234628-3-child.html
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta content="width=device-width, initial-scale=1" name="viewport">
|
||||||
|
<title>meta declaration in parent and child</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Euro sign if decoded as UTF-8: €</p>
|
||||||
|
<p>a with diaeresis if decoded as UTF-8: ä</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
18
docshell/test/browser/file_bug234628-3.html
Normal file
18
docshell/test/browser/file_bug234628-3.html
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="windows-1252">
|
||||||
|
<meta content="width=device-width, initial-scale=1" name="viewport">
|
||||||
|
<title>meta declaration in parent and child</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>meta declaration in parent and child</h1>
|
||||||
|
|
||||||
|
<p>Euro sign if decoded as Windows-1252: €</p>
|
||||||
|
<p>a with diaeresis if decoded as Windows-1252: ä</p>
|
||||||
|
|
||||||
|
<iframe src="file_bug234628-3-child.html"></iframe>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
12
docshell/test/browser/file_bug234628-4-child.html
Normal file
12
docshell/test/browser/file_bug234628-4-child.html
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta content="width=device-width, initial-scale=1" name="viewport">
|
||||||
|
<title>meta declaration in parent and BOM in child</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Euro sign if decoded as UTF-8: €</p>
|
||||||
|
<p>a with diaeresis if decoded as UTF-8: ä</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
18
docshell/test/browser/file_bug234628-4.html
Normal file
18
docshell/test/browser/file_bug234628-4.html
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="windows-1252">
|
||||||
|
<meta content="width=device-width, initial-scale=1" name="viewport">
|
||||||
|
<title>meta declaration in parent and BOM in child</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>meta declaration in parent and BOM in child</h1>
|
||||||
|
|
||||||
|
<p>Euro sign if decoded as Windows-1252: €</p>
|
||||||
|
<p>a with diaeresis if decoded as Windows-1252: ä</p>
|
||||||
|
|
||||||
|
<iframe src="file_bug234628-4-child.html"></iframe>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
BIN
docshell/test/browser/file_bug234628-5-child.html
Normal file
BIN
docshell/test/browser/file_bug234628-5-child.html
Normal file
Binary file not shown.
18
docshell/test/browser/file_bug234628-5.html
Normal file
18
docshell/test/browser/file_bug234628-5.html
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="windows-1252">
|
||||||
|
<meta content="width=device-width, initial-scale=1" name="viewport">
|
||||||
|
<title>meta declaration in parent and UTF-16 BOM in child</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>meta declaration in parent and UTF-16 BOM in child</h1>
|
||||||
|
|
||||||
|
<p>Euro sign if decoded as Windows-1252: €</p>
|
||||||
|
<p>a with diaeresis if decoded as Windows-1252: ä</p>
|
||||||
|
|
||||||
|
<iframe src="file_bug234628-5-child.html"></iframe>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
BIN
docshell/test/browser/file_bug234628-6-child.html
Normal file
BIN
docshell/test/browser/file_bug234628-6-child.html
Normal file
Binary file not shown.
@ -0,0 +1 @@
|
|||||||
|
Content-Type: text/html; charset=utf-16be
|
18
docshell/test/browser/file_bug234628-6.html
Normal file
18
docshell/test/browser/file_bug234628-6.html
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="windows-1252">
|
||||||
|
<meta content="width=device-width, initial-scale=1" name="viewport">
|
||||||
|
<title>meta declaration in parent and BOMless UTF-16 with HTTP charset in child</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>meta declaration in parent and BOMless UTF-16 with HTTP charset in child</h1>
|
||||||
|
|
||||||
|
<p>Euro sign if decoded as Windows-1252: €</p>
|
||||||
|
<p>a with diaeresis if decoded as Windows-1252: ä</p>
|
||||||
|
|
||||||
|
<iframe src="file_bug234628-6-child.html"></iframe>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
12
docshell/test/browser/file_bug234628-7-child.html
Normal file
12
docshell/test/browser/file_bug234628-7-child.html
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta content="width=device-width, initial-scale=1" name="viewport">
|
||||||
|
<title>meta declaration in parent and BOMless UTF-8 with HTTP charset in child</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Euro sign if decoded as UTF-8: €</p>
|
||||||
|
<p>a with diaeresis if decoded as UTF-8: ä</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
Content-Type: text/html; charset=utf-8
|
18
docshell/test/browser/file_bug234628-7.html
Normal file
18
docshell/test/browser/file_bug234628-7.html
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="windows-1252">
|
||||||
|
<meta content="width=device-width, initial-scale=1" name="viewport">
|
||||||
|
<title>meta declaration in parent and BOMless UTF-8 with HTTP charset in child</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>meta declaration in parent and BOMless UTF-8 with HTTP charset in child</h1>
|
||||||
|
|
||||||
|
<p>Euro sign if decoded as Windows-1252: €</p>
|
||||||
|
<p>a with diaeresis if decoded as Windows-1252: ä</p>
|
||||||
|
|
||||||
|
<iframe src="file_bug234628-7-child.html"></iframe>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
12
docshell/test/browser/file_bug234628-8-child.html
Normal file
12
docshell/test/browser/file_bug234628-8-child.html
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta content="width=device-width, initial-scale=1" name="viewport">
|
||||||
|
<title>meta declaration in parent and no declaration in child</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Capital dje if decoded as Windows-1251: €</p>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
17
docshell/test/browser/file_bug234628-8.html
Normal file
17
docshell/test/browser/file_bug234628-8.html
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="windows-1251">
|
||||||
|
<meta content="width=device-width, initial-scale=1" name="viewport">
|
||||||
|
<title>meta declaration in parent and no declaration in child</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>meta declaration in parent and no declaration in child</h1>
|
||||||
|
|
||||||
|
<p>Capital dje if decoded as Windows-1251: €</p>
|
||||||
|
|
||||||
|
<iframe src="file_bug234628-8-child.html"></iframe>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
12
docshell/test/browser/file_bug234628-9-child.html
Normal file
12
docshell/test/browser/file_bug234628-9-child.html
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta content="width=device-width, initial-scale=1" name="viewport">
|
||||||
|
<title>UTF-16 with BOM in parent and no declaration in child</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Euro sign if decoded as Windows-1251: €</p>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
BIN
docshell/test/browser/file_bug234628-9.html
Normal file
BIN
docshell/test/browser/file_bug234628-9.html
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user