mirror of
https://github.com/servo/servo.git
synced 2025-10-01 09:09:15 +01:00
Auto merge of #13996 - servo:about-blank, r=Ms2ger,jdm,asajeffrey,nox
Implement synchronous about:blank loading. Based on initial work by jdm in <https://github.com/servo/servo/pull/8600>. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13996) <!-- Reviewable:end -->
This commit is contained in:
commit
0d896a8d82
103 changed files with 554 additions and 939 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
|
||||
|
|
@ -1,14 +1,6 @@
|
|||
<html class="reftest-wait">
|
||||
<link rel=match href=overflow_ref.html>
|
||||
<body>
|
||||
<iframe src="data:text/html,%3Cdiv%20style%3D%22background%3Agreen%3B%20width%3A%20200px%3B%20height%3A%20200px%3B%22%3E%3C%2Fdiv%3E"
|
||||
style="display: block; width: 108px; height: 108px; border: none">
|
||||
</iframe>
|
||||
<script type="text/javascript">
|
||||
window.onload = function() {
|
||||
document.documentElement.classList.remove("reftest-wait");
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<iframe src="data:text/html,%3Cdiv%20style%3D%22background%3Agreen%3B%20width%3A%20200px%3B%20height%3A%20200px%3B%22%3E%3C%2Fdiv%3E"
|
||||
style="display: block; width: 108px; height: 108px; border: none"
|
||||
onload="document.documentElement.classList.remove('reftest-wait')">
|
||||
</iframe>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
<html class=reftest-wait>
|
||||
<link rel=match href=stacking_context_ref.html>
|
||||
<style>
|
||||
iframe {
|
||||
|
@ -11,4 +12,6 @@ iframe {
|
|||
transform: translateX(0px); /* form a stacking context */
|
||||
}
|
||||
</style>
|
||||
<iframe src="data:text/html,%3Cspan%3EJust%20a%20simple%20little%20iframe.%3C%2Fspan%3E">
|
||||
<iframe src="data:text/html,%3Cspan%3EJust%20a%20simple%20little%20iframe.%3C%2Fspan%3E"
|
||||
onload="document.documentElement.classList.remove('reftest-wait')">
|
||||
</iframe>
|
||||
|
|
|
@ -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