mirror of
https://github.com/servo/servo.git
synced 2025-10-01 09:09:15 +01:00
compositing/script: Do not dispatch the resize event when initially loading.
No bug report corresponds to this, but I noticed it while trying to reduce #10593
This commit is contained in:
parent
75d99eec0f
commit
7940b22158
10 changed files with 103 additions and 48 deletions
|
@ -6669,6 +6669,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",
|
||||
|
|
|
@ -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>
|
Loading…
Add table
Add a link
Reference in a new issue