Bug 1090759 - Part 5. Use setAttribute to set mozbrowser instead of using SpecialPowers. r=smaug

This commit is contained in:
Kan-Ru Chen (陳侃如) 2014-10-31 10:39:15 +08:00
parent 089fc344f8
commit f75b538f19
68 changed files with 78 additions and 78 deletions

View File

@ -14,7 +14,7 @@ var mm;
function runTest() {
iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
document.body.appendChild(iframe);
mm = SpecialPowers.getBrowserFrameMessageManager(iframe);

View File

@ -10,7 +10,7 @@ browserElementTestHelpers.addPermission();
function runTest() {
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
iframe.addEventListener('mozbrowsershowmodalprompt', function(e) {
is(e.detail.message, 'Hello');

View File

@ -12,7 +12,7 @@ SpecialPowers.setAllAppsLaunchable(true);
function testAppElement(expectAnApp, callback) {
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
iframe.setAttribute('mozapp', 'http://example.org/manifest.webapp');
iframe.addEventListener('mozbrowsershowmodalprompt', function(e) {
is(e.detail.message == 'app', expectAnApp, e.detail.message);

View File

@ -13,7 +13,7 @@ SpecialPowers.addPermission("embed-apps", true, document);
function runTest() {
var iframe1 = document.createElement('iframe');
SpecialPowers.wrap(iframe1).mozbrowser = true;
iframe1.setAttribute('mozbrowser', 'true');
iframe1.setAttribute('mozapp', 'http://example.org/manifest.webapp');
// Two mozapp frames for different apps with the same code both do the same
@ -26,7 +26,7 @@ function runTest() {
SimpleTest.executeSoon(function() {
var iframe2 = document.createElement('iframe');
SpecialPowers.wrap(iframe2).mozbrowser = true;
iframe2.setAttribute('mozbrowser', 'true');
iframe2.setAttribute('mozapp', 'http://example.com/manifest.webapp');
iframe2.addEventListener('mozbrowseropenwindow', function(e) {

View File

@ -16,7 +16,7 @@ var iframe;
function runTest() {
iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
document.body.appendChild(iframe);
// Wait for the initial load to finish, then navigate the page, then start test

View File

@ -21,7 +21,7 @@ function addOneShotIframeEventListener(event, fn) {
function runTest() {
iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
addOneShotIframeEventListener('mozbrowserloadend', function() {
SimpleTest.executeSoon(test2);

View File

@ -46,7 +46,7 @@ function checkScreenshotResult(expectSuccess, args) {
function runTest() {
iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
document.body.appendChild(iframe);
iframe.src = 'data:text/html,<html>' +
'<body style="background:green">hello</body></html>';

View File

@ -13,7 +13,7 @@ browserElementTestHelpers.addPermission();
function runTest() {
var iframe1 = document.createElement('iframe');
SpecialPowers.wrap(iframe1).mozbrowser = true;
iframe1.setAttribute('mozbrowser', 'true');
// Two mozbrowser frames with the same code both do the same
// window.open("foo", "bar") call. We should only get one
@ -35,7 +35,7 @@ function runTest() {
SimpleTest.executeSoon(function() {
var iframe2 = document.createElement('iframe');
SpecialPowers.wrap(iframe2).mozbrowser = true;
iframe2.setAttribute('mozbrowser', 'true');
iframe2.addEventListener('mozbrowseropenwindow', function(e) {
ok(false, "Got second mozbrowseropenwindow event.");

View File

@ -33,7 +33,7 @@ function runTest() {
function testIFrameWithSrc(src) {
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
iframe.style = "border:none; width:400px; height:400px;";
iframe.src = src;
iframe.addEventListener("mozbrowserresize", function (e) {

View File

@ -10,7 +10,7 @@ browserElementTestHelpers.addPermission();
function runTest() {
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
document.body.appendChild(iframe);
iframe.addEventListener("mozbrowserclose", function(e) {

View File

@ -21,11 +21,11 @@ function runTest() {
// frame.
var appFrame = document.createElement('iframe');
SpecialPowers.wrap(appFrame).mozbrowser = true;
appFrame.setAttribute('mozbrowser', 'true');
appFrame.setAttribute('mozapp', 'http://example.org/manifest.webapp');
var browserFrame = document.createElement('iframe');
SpecialPowers.wrap(browserFrame).mozbrowser = true;
browserFrame.setAttribute('mozbrowser', 'true');
var gotAppFrameClose = false;
appFrame.addEventListener('mozbrowserclose', function() {

View File

@ -10,7 +10,7 @@ browserElementTestHelpers.addPermission();
function runTest() {
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
iframe.addEventListener('mozbrowseropenwindow', function(e) {
ok(true, "got openwindow event.");

View File

@ -219,7 +219,7 @@ function checkContextMenuCallbackForId(detail, id, callback) {
var iframe = null;
function createIframe(callback) {
iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
iframe.src = 'data:text/html,<html>' +
'<body>' +

View File

@ -13,7 +13,7 @@ function runTest() {
const innerPage = 'http://example.com/tests/dom/browser-element/mochitest/file_browserElement_CookiesNotThirdParty.html';
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
iframe.addEventListener('mozbrowsershowmodalprompt', function(e) {
if (e.detail.message == 'next') {

View File

@ -46,7 +46,7 @@ function getScriptForSetFocus() {
function runTest() {
iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
document.body.appendChild(iframe);
gTextarea = document.createElement('textarea');

View File

@ -11,7 +11,7 @@ browserElementTestHelpers.addPermission();
function runTest() {
var iframe1 = document.createElement('iframe');
SpecialPowers.wrap(iframe1).mozbrowser = true;
iframe1.setAttribute('mozbrowser', 'true');
iframe1.src = 'data:text/html,<html>' +
'<body style="background:green">hello</body></html>';
document.body.appendChild(iframe1);

View File

@ -10,7 +10,7 @@ browserElementTestHelpers.addPermission();
function runTest() {
var iframe1 = document.createElement('iframe');
SpecialPowers.wrap(iframe1).mozbrowser = true;
iframe1.setAttribute('mozbrowser', 'true');
iframe1.id = 'iframe1';
iframe1.addEventListener('mozbrowserloadend', function if1_loadend() {
iframe1.removeEventListener('mozbrowserloadend', if1_loadend);

View File

@ -62,7 +62,7 @@ function testFirstLoad() {
function runTest() {
iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
runTestQueue([testFirstLoad, testReload, testChangeLocation]);
}

View File

@ -14,7 +14,7 @@ var downloadURL = 'http://test/tests/dom/browser-element/mochitest/file_download
function runTest() {
iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
iframe.addEventListener('mozbrowserloadend', loadend);
iframe.src = 'data:text/html,<html><body>hello</body></html>';

View File

@ -12,7 +12,7 @@ browserElementTestHelpers.addPermission();
var iframe = null;
function runTest() {
iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
document.body.appendChild(iframe);
checkForGenericError();

View File

@ -47,7 +47,7 @@ function testWyciwyg() {
function runTest() {
iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
document.body.appendChild(iframe);
testWyciwyg();
}

View File

@ -10,7 +10,7 @@ browserElementTestHelpers.addPermission();
function runTest() {
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
var gotFirstPaint = false;
var gotFirstLocationChange = false;

View File

@ -12,7 +12,7 @@ browserElementTestHelpers.addPermission();
function runTest() {
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
iframe.setAttribute('name', 'foo');
iframe.addEventListener("mozbrowseropenwindow", function(e) {

View File

@ -10,7 +10,7 @@ browserElementTestHelpers.addPermission();
function runTest() {
var iframeJS = document.createElement('iframe');
SpecialPowers.wrap(iframeJS).mozbrowser = true;
iframeJS.setAttribute('mozbrowser', 'true');
iframeJS.addEventListener('mozbrowserloadstart', function(e) {
ok(false, "This should not happen!");
@ -24,7 +24,7 @@ function runTest() {
document.body.appendChild(iframeJS);
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
var gotPopup = false;
iframe.addEventListener('mozbrowseropenwindow', function(e) {

View File

@ -17,7 +17,7 @@ var resizeContent = function() {
function runTest() {
var iframe1 = document.createElement('iframe');
SpecialPowers.wrap(iframe1).mozbrowser = true;
iframe1.setAttribute('mozbrowser', 'true');
var iframeWidth = 400;
var iframeHeight = 400;

View File

@ -10,7 +10,7 @@ browserElementTestHelpers.addPermission();
function runTest() {
var iframe1 = document.createElement('iframe');
SpecialPowers.wrap(iframe1).mozbrowser = true;
iframe1.setAttribute('mozbrowser', 'true');
iframe1.src = 'data:text/html,<html>' +
'<body style="background:green">hello</body></html>';

View File

@ -16,7 +16,7 @@ function runTest() {
var iframe1 = document.createElement('iframe');
iframe1.setAttribute('width', cssPixelWidth);
iframe1.setAttribute('height', cssPixelHeight);
SpecialPowers.wrap(iframe1).mozbrowser = true;
iframe1.setAttribute('mozbrowser', 'true');
iframe1.src = 'data:text/html,<html><body>hello</body></html>';
document.body.appendChild(iframe1);

View File

@ -23,14 +23,14 @@ function createLink(name, sizes, rel) {
function runTest() {
var iframe1 = document.createElement('iframe');
SpecialPowers.wrap(iframe1).mozbrowser = true;
iframe1.setAttribute('mozbrowser', 'true');
document.body.appendChild(iframe1);
// iframe2 is a red herring; we modify its favicon but don't listen for
// iconchanges; we want to make sure that its iconchange events aren't
// picked up by the listener on iframe1.
var iframe2 = document.createElement('iframe');
SpecialPowers.wrap(iframe2).mozbrowser = true;
iframe2.setAttribute('mozbrowser', 'true');
document.body.appendChild(iframe2);
// iframe3 is another red herring. It's not a mozbrowser, so we shouldn't

View File

@ -32,7 +32,7 @@ var iframe;
var finished = false;
function runTest() {
iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
iframe.src = browserElementTestHelpers.focusPage;
var gotFocus = false;

View File

@ -20,7 +20,7 @@ function runTest() {
var seenLocationChange = false;
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
iframe.id = 'iframe';
iframe.src = 'http://example.com/tests/dom/browser-element/mochitest/file_browserElement_LoadEvents.html';

View File

@ -18,14 +18,14 @@ function createManifest(href) {
function runTest() {
var iframe1 = document.createElement('iframe');
SpecialPowers.wrap(iframe1).mozbrowser = true;
iframe1.setAttribute('mozbrowser', 'true');
document.body.appendChild(iframe1);
// iframe2 is a red herring; we modify its manifest link elements but don't
// listen for manifestchanges; we want to make sure that its manifestchange
// events aren't picked up by the listener on iframe1.
var iframe2 = document.createElement('iframe');
SpecialPowers.wrap(iframe2).mozbrowser = true;
iframe2.setAttribute('mozbrowser', 'true');
document.body.appendChild(iframe2);
// iframe3 is another red herring. It's not a mozbrowser, so we shouldn't

View File

@ -26,14 +26,14 @@ function createMetaWithLang(name, content, lang) {
function runTest() {
var iframe1 = document.createElement('iframe');
SpecialPowers.wrap(iframe1).mozbrowser = true;
iframe1.setAttribute('mozbrowser', 'true');
document.body.appendChild(iframe1);
// iframe2 is a red herring; we modify its meta elements but don't listen for
// metachanges; we want to make sure that its metachange events aren't
// picked up by the listener on iframe1.
var iframe2 = document.createElement('iframe');
SpecialPowers.wrap(iframe2).mozbrowser = true;
iframe2.setAttribute('mozbrowser', 'true');
document.body.appendChild(iframe2);
// iframe3 is another red herring. It's not a mozbrowser, so we shouldn't

View File

@ -10,7 +10,7 @@ browserElementTestHelpers.addPermission();
function runTest() {
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
document.body.appendChild(iframe);
// Add a first listener that we'll remove shortly after.

View File

@ -28,7 +28,7 @@ function runTest() {
var remote = !browserElementTestHelpers.getOOPByDefaultPref();
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
iframe.setAttribute('remote', remote);
// The page we load does window.open, then checks some things and reports

View File

@ -13,7 +13,7 @@ var iframe;
var popupFrame;
function runTest() {
iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
var gotPopup = false;
iframe.addEventListener('mozbrowseropenwindow', function(e) {

View File

@ -10,7 +10,7 @@ browserElementTestHelpers.addPermission();
function runTest() {
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
var gotPopup = false;
iframe.addEventListener('mozbrowseropenwindow', function(e) {

View File

@ -10,7 +10,7 @@ browserElementTestHelpers.addPermission();
function runTest() {
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
iframe.addEventListener('mozbrowseropenwindow', function(e) {
ok(true, 'Got first window.open call');

View File

@ -16,7 +16,7 @@ browserElementTestHelpers.addPermission();
function runTest() {
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
var gotPopup = false;
iframe.addEventListener('mozbrowseropenwindow', function(e) {

View File

@ -11,7 +11,7 @@ browserElementTestHelpers.addPermission();
function runTest() {
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
iframe.addEventListener('mozbrowseropenwindow', function(e) {
ok(e.detail.url.indexOf('does_not_exist.html') != -1,

View File

@ -15,7 +15,7 @@ browserElementTestHelpers.addPermission();
function runTest() {
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
iframe.addEventListener('mozbrowseropenwindow', function(e) {
ok(e.detail.url.indexOf('does_not_exist.html') != -1,

View File

@ -18,14 +18,14 @@ function createLink(name) {
function runTest() {
var iframe1 = document.createElement('iframe');
SpecialPowers.wrap(iframe1).mozbrowser = true;
iframe1.setAttribute('mozbrowser', 'true');
document.body.appendChild(iframe1);
// iframe2 is a red herring; we modify its link but don't listen for
// opensearch; we want to make sure that its opensearch events aren't
// picked up by the listener on iframe1.
var iframe2 = document.createElement('iframe');
SpecialPowers.wrap(iframe2).mozbrowser = true;
iframe2.setAttribute('mozbrowser', 'true');
document.body.appendChild(iframe2);
// iframe3 is another red herring. It's not a mozbrowser, so we shouldn't

View File

@ -10,7 +10,7 @@ browserElementTestHelpers.addPermission();
function createFrame(aIsPrivate) {
var iframe = document.createElement("iframe");
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
if (aIsPrivate) {
iframe.setAttribute("mozprivatebrowsing", "true");
}

View File

@ -17,7 +17,7 @@ browserElementTestHelpers.addPermission();
function runTest()
{
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
document.body.appendChild(iframe);
var numPrompts = 0;

View File

@ -14,7 +14,7 @@ browserElementTestHelpers.addPermission();
function runTest() {
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
document.body.appendChild(iframe);
var prompts = [

View File

@ -21,7 +21,7 @@ function addOneShotIframeEventListener(event, fn) {
function runTest() {
iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
addOneShotIframeEventListener('mozbrowserloadend', function() {
SimpleTest.executeSoon(test2);

View File

@ -21,7 +21,7 @@ var countAcc;
function runTest() {
iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
iframe.addEventListener('mozbrowserloadend', mozbrowserLoaded);

View File

@ -75,7 +75,7 @@ function pageLoadDone() {
function runTest() {
iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
isPostRequestSubmitted = false;
iframe.src = 'file_post_request.html';

View File

@ -12,7 +12,7 @@ browserElementTestHelpers.addPermission();
function runTest() {
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
document.body.appendChild(iframe);
iframe.addEventListener("mozbrowsershowmodalprompt", function(e) {

View File

@ -10,7 +10,7 @@ browserElementTestHelpers.addPermission();
function runTest() {
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
document.body.appendChild(iframe);
iframe.addEventListener("mozbrowserscroll", function(e) {

View File

@ -11,7 +11,7 @@ browserElementTestHelpers.addPermission();
function runTest() {
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
var lastSecurityState;
iframe.addEventListener('mozbrowsersecuritychange', function(e) {

View File

@ -10,7 +10,7 @@ browserElementTestHelpers.addPermission();
function runTest() {
var iframe = document.createElement("iframe");
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
document.body.appendChild(iframe);
iframe.addEventListener("mozbrowserloadend", function onloadend(e) {

View File

@ -110,7 +110,7 @@ function createFrames() {
// Create an input field to receive string from input method iframes.
gInputFrame = document.createElement('iframe');
SpecialPowers.wrap(gInputFrame).mozbrowser = true;
gInputFrame.setAttribute('mozbrowser', 'true');
gInputFrame.src =
'data:text/html,<input autofocus value="hello" />' +
'<p>This is targetted mozbrowser frame.</p>';
@ -119,7 +119,7 @@ function createFrames() {
for (let i = 0; i < 2; i++) {
let frame = gFrames[i] = document.createElement('iframe');
SpecialPowers.wrap(gFrames[i]).mozbrowser = true;
gFrames[i].setAttribute('mozbrowser', 'true');
// When the input method iframe is activated, it will send the URL
// hash to current focused element. We set different hash to each
// iframe so that iframes can be differentiated by their hash.

View File

@ -20,7 +20,7 @@ function runTest() {
var mm;
var numEvents = 0;
var iframe1 = document.createElement('iframe');
SpecialPowers.wrap(iframe1).mozbrowser = true;
iframe1.setAttribute('mozbrowser', 'true');
iframe1.src = 'data:text/html,1';
document.body.appendChild(iframe1);

View File

@ -23,7 +23,7 @@ function runTest() {
isInBrowserElement: true });
iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
// Our test involves three <iframe mozbrowser>'s, parent, child1, and child2.
// child1 and child2 are contained inside parent. child1 is visibile, and

View File

@ -17,7 +17,7 @@ function runTest() {
isInBrowserElement: true });
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
// We need remote = false here until bug 761935 is fixed; see
// SetVisibleFrames.js for an explanation.

View File

@ -19,7 +19,7 @@ var imgSrc = 'http://test/tests/dom/browser-element/mochitest/file_bug709759.sjs
function runTest() {
iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
iframe.addEventListener('mozbrowserloadend', loadend);
iframe.src = 'data:text/html,<html>' +

View File

@ -11,7 +11,7 @@ browserElementTestHelpers.addPermission();
function runTest() {
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
iframe.addEventListener('mozbrowseropenwindow', function(e) {
is(e.detail.url, 'http://example.com/');

View File

@ -11,7 +11,7 @@ browserElementTestHelpers.addPermission();
function runTest() {
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
iframe.addEventListener('mozbrowseropenwindow', function(e) {
ok(false, 'Not expecting an openwindow event.');

View File

@ -16,7 +16,7 @@ function runTest() {
}
let iframe1 = document.createElement('iframe');
SpecialPowers.wrap(iframe1).mozbrowser = true;
iframe1.setAttribute('mozbrowser', 'true');
iframe1.src = "http://test/tests/dom/browser-element/mochitest/file_browserElement_ThemeColor.html";
iframe1.addEventListener('mozbrowsermetachange', tests);
document.body.appendChild(iframe1);

View File

@ -10,14 +10,14 @@ browserElementTestHelpers.addPermission();
function runTest() {
var iframe1 = document.createElement('iframe');
SpecialPowers.wrap(iframe1).mozbrowser = true;
iframe1.setAttribute('mozbrowser', 'true');
document.body.appendChild(iframe1);
// iframe2 is a red herring; we modify its title but don't listen for
// titlechanges; we want to make sure that its titlechange events aren't
// picked up by the listener on iframe1.
var iframe2 = document.createElement('iframe');
SpecialPowers.wrap(iframe2).mozbrowser = true;
iframe2.setAttribute('mozbrowser', 'true');
document.body.appendChild(iframe2);
// iframe3 is another red herring. It's not a mozbrowser, so we shouldn't

View File

@ -18,7 +18,7 @@ function runTest() {
dump("Got error: " + e + '\n');
}
});
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
iframe.src = 'data:text/html,Outer iframe <iframe id="inner-iframe"></iframe>';
// For kicks, this test uses a display:none iframe. This shouldn't make a
// difference in anything.

View File

@ -11,7 +11,7 @@ browserElementTestHelpers.addPermission();
var iframe1 = null;
function runTest() {
iframe1 = document.createElement('iframe');
SpecialPowers.wrap(iframe1).mozbrowser = true;
iframe1.setAttribute('mozbrowser', 'true');
document.body.appendChild(iframe1);
iframe1.src = 'data:text/html,<html><head><title>Title</title></head><body></body></html>';

View File

@ -11,7 +11,7 @@ browserElementTestHelpers.addPermission();
function runTest() {
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
// The page we load will fire an alert when it successfully loads.
iframe.addEventListener('mozbrowsershowmodalprompt', function(e) {

View File

@ -30,7 +30,7 @@ function runTest() {
var count = 0;
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
iframe.height = '1000px';
// The innermost page we load will fire an alert when it successfully loads.

View File

@ -29,7 +29,7 @@ function arrayBuffersEqual(a, b) {
function runTest() {
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
// Our child will create two iframes, so make sure this iframe is big enough
// to show both of them without scrolling, so taking a screenshot gets both

View File

@ -13,7 +13,7 @@ browserElementTestHelpers.addPermission();
function runTest() {
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
// The innermost page we load will fire an alert when it successfully loads.
iframe.addEventListener('mozbrowsershowmodalprompt', function(e) {

View File

@ -24,7 +24,7 @@ SimpleTest.waitForExplicitFinish();
function runTest() {
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
document.body.appendChild(iframe);
iframe.addEventListener('mozbrowserloadstart', function() {

View File

@ -25,7 +25,7 @@ SimpleTest.waitForExplicitFinish();
function runTest() {
var iframe = document.createElement('iframe');
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.setAttribute('mozbrowser', 'true');
document.body.appendChild(iframe);
iframe.addEventListener('mozbrowserloadstart', function() {