Auto merge of #10654 - notriddle:no_resize_on_initial_load, r=asajeffrey

compositing/script: Do not dispatch the resize event when initially l…

…oading.

No bug report corresponds to this, but I noticed it while trying to
reduce #10593

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10654)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-04-22 14:25:51 -07:00
commit 47a0f58f98
10 changed files with 103 additions and 48 deletions

View file

@ -6682,6 +6682,12 @@
"url": "/_mozilla/mozilla/window_requestAnimationFrame2.html"
}
],
"mozilla/window_resize_not_triggered_on_load.html": [
{
"path": "mozilla/window_resize_not_triggered_on_load.html",
"url": "/_mozilla/mozilla/window_resize_not_triggered_on_load.html"
}
],
"mozilla/window_setInterval.html": [
{
"path": "mozilla/window_setInterval.html",

View file

@ -0,0 +1,28 @@
<!doctype html>
<meta charset="utf-8">
<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
<link rel="author" title="Michael Howell" href="https://www.notriddle.com/">
<link rel="help" href="https://drafts.csswg.org/cssom-view/#resizing-viewports">
<script>
<!-- This event handler needs to be registered before the first layout -->
var resize_run = false;
window.onresize = function() {
resize_run = true;
};
</script>
<title>window.onresize should not be called when the window first loads</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=d></div>
<script>
var t = async_test("window.onresize should not be called when the window first loads");
var d = document.getElementById("d");
window.getComputedStyle(d, null).getPropertyValue("width");
d.style.width = "1px";
window.onload = function() {
t.step(function() {
assert_true(!resize_run);
t.done();
});
};
</script>