blob: fea42a0b5e7848acc0937520ec5b43640912a2a7 [file] [log] [blame]
/*
* Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
* for details. All rights reserved. Use of this source code is governed by a
* BSD-style license that can be found in the LICENSE file.
*/
/**
* @description Test that partial layout works with non-overlay scrollbars.
*/
import "dart:html";
import "../../testcommon.dart";
import "../../resources/testharness.dart";
import "../../../Utils/async_utils.dart";
main() {
var style = new Element.html('''
<style>
::-webkit-scrollbar {
-webkit-appearance: none;
width: 8px;
}
* {
margin: 0;
padding: 0;
}
#makespace {
height: 5000px;
}
</style>
''', treeSanitizer: new NullTreeSanitizer());
document.head.append(style);
document.body.setInnerHtml('''
<div id="makespace"></div>
<div id="measure"></div>
''', treeSanitizer: new NullTreeSanitizer());
asyncStart();
setTimeout(() {
setTimeout(() {
var measure = document.getElementById('measure');
var measureWidth = measure.offsetWidth; // Partial layout occurs here!
assert_equals(measureWidth, document.body.offsetWidth);
assert_equals(measureWidth, window.innerWidth - 8);
asyncEnd();
});
}, 0);
}