Auto merge of #8618 - paulrouget:reload, r=jdm

Browser API: implement iframe.reload()

fixes #8575

The implementation is naive, and doesn't support the `hardreload` parameter.
And for the test, I'm not sure how else I can test the reload.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8618)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-12-17 19:45:44 +05:30
commit 9570b51565
6 changed files with 67 additions and 13 deletions

View file

@ -5685,6 +5685,12 @@
"url": "/_mozilla/mozilla/mozbrowser/mozbrowsericonchange_event.html"
}
],
"mozilla/mozbrowser/reload.html": [
{
"path": "mozilla/mozbrowser/reload.html",
"url": "/_mozilla/mozilla/mozbrowser/reload.html"
}
],
"mozilla/navigator.html": [
{
"path": "mozilla/navigator.html",

View file

@ -0,0 +1,35 @@
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
async_test(function(t) {
const SRC = "data:,foobar";
const RELOAD_MAX_COUNT = 5;
var iframe = document.createElement("iframe");
iframe.mozbrowser = "true";
iframe.src = SRC;
var reload_count = 0;
iframe.addEventListener("mozbrowserloadend", t.step_func(e => {
reload_count++;
assert_equals(SRC, e.target.src);
if (reload_count == RELOAD_MAX_COUNT) {
t.done();
} else {
iframe.reload();
}
}));
document.body.appendChild(iframe);
});
</script>
</body>