mirror of
https://github.com/servo/servo.git
synced 2025-10-01 09:09:15 +01:00
Implement synchronous about:blank loading.
Based on initial work by jdm in <https://github.com/servo/servo/pull/8600>.
This commit is contained in:
parent
2677540cd0
commit
b86965f394
34 changed files with 456 additions and 906 deletions
|
@ -1,6 +1,5 @@
|
|||
[htmllabel-activation.html]
|
||||
type: testharness
|
||||
|
||||
[If label's 1st child (submit) is disabled, click should have no impact]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
[mozbrowser_loadevents.html]
|
||||
type: testharness
|
||||
[mozbrowserloadstart, mozbrowserconnected and mozbrowserloadend are dispatched]
|
||||
expected: FAIL
|
||||
|
|
@ -12,13 +12,13 @@ async_test(function(t) {
|
|||
var url1 = `data:text/html,<script>setTimeout(() => location.assign("${url2}"), 0)</${"script"}>`;
|
||||
|
||||
var locations = []
|
||||
var expected_locations = [url1, url2, url1];
|
||||
var expected_locations = ["about:blank", url1, url2, url1];
|
||||
|
||||
var iframe = document.createElement("iframe");
|
||||
iframe.mozbrowser = "true";
|
||||
iframe.src = url1;
|
||||
|
||||
iframe.addEventListener("mozbrowserlocationchange", e => {
|
||||
iframe.addEventListener("mozbrowserlocationchange", t.step_func(e => {
|
||||
locations.push(e.detail.url);
|
||||
if (e.detail.url == url2) {
|
||||
iframe.goBack();
|
||||
|
@ -27,7 +27,7 @@ async_test(function(t) {
|
|||
assert_array_equals(locations, expected_locations);
|
||||
t.done();
|
||||
}
|
||||
});
|
||||
}));
|
||||
|
||||
document.body.appendChild(iframe);
|
||||
|
||||
|
|
|
@ -14,24 +14,29 @@ async_test(function(t) {
|
|||
|
||||
var received_events = []
|
||||
var expected_events = [
|
||||
url1, false, false,
|
||||
"about:blank", false, false,
|
||||
url1, true, false,
|
||||
url2, true, false,
|
||||
url3, true, false,
|
||||
url2, true, true,
|
||||
url1, false, true,
|
||||
url1, true, true,
|
||||
"about:blank", false, true,
|
||||
url1, true, true,
|
||||
url2, true, true,
|
||||
url3, true, false,
|
||||
];
|
||||
|
||||
var iframe = document.createElement("iframe");
|
||||
iframe.mozbrowser = "true";
|
||||
iframe.src = url1;
|
||||
|
||||
var actions = [
|
||||
function() {iframe.src = url1},
|
||||
function() {iframe.src = url2},
|
||||
function() {iframe.src = url3},
|
||||
function() {iframe.goBack()},
|
||||
function() {iframe.goBack()},
|
||||
function() {iframe.goBack()},
|
||||
function() {iframe.goForward()},
|
||||
function() {iframe.goForward()},
|
||||
function() {iframe.goForward()},
|
||||
];
|
||||
|
|
|
@ -9,9 +9,17 @@
|
|||
var iframe = document.createElement("iframe");
|
||||
iframe.mozbrowser = "true";
|
||||
iframe.src = "redirect_init.html?pipe=status(302)|header(Location,redirect_final.html)";
|
||||
var i = 0;
|
||||
iframe.addEventListener("mozbrowserlocationchange", t.step_func(e => {
|
||||
assert_equals(e.detail.url, new URL("redirect_final.html", location).href);
|
||||
t.done();
|
||||
switch (++i) {
|
||||
case 1:
|
||||
assert_equals(e.detail.url, "about:blank");
|
||||
break;
|
||||
case 2:
|
||||
assert_equals(e.detail.url, new URL("redirect_final.html", location).href);
|
||||
t.done();
|
||||
break;
|
||||
}
|
||||
}));
|
||||
document.body.appendChild(iframe);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue