Update web-platform-tests to revision d23db97703021bdeb4ec21ff5ce3e9de54dd4d85

This commit is contained in:
WPT Sync Bot 2020-06-12 08:22:41 +00:00
parent 54d2b7de29
commit 77784e512e
163 changed files with 3806 additions and 3068 deletions

View file

@ -46,10 +46,14 @@ function checkNotVerticallyCentered(dialog) {
function checkVerticallyCentered(dialog) {
var centeredTop = (window.innerHeight - dialog.offsetHeight) / 2;
assert_equals(dialog.getBoundingClientRect().top, centeredTop);
// Using approx equals because getBoundingClientRect() and centeredTop
// are calculated by different parts of the engine. Due to the loss
// of precision, the numbers might not equal exactly.
assert_approx_equals(dialog.getBoundingClientRect().top, centeredTop, 1);
}
function reset() {
document.body.style.width = "auto";
if (dialog.open)
dialog.close();
dialog.remove();
@ -127,8 +131,6 @@ test(function() {
dialog.showModal();
checkVerticallyCentered(dialog);
// Set back original value to 'width'.
document.body.style.width = 'auto';
}, "The dialog should be centered regardless of the presence of a horizontal scrollbar.");
test(function() {