blob: 32dc15246b68b3c47ff33fdd05e66b8b6857e3f6 [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.
/// @assertion Rectangle getBoundingClientRect()
/// Returns the smallest bounding rectangle that encompasses this element's
/// padding, scrollbar, and border.
/// @description Checks that padding, scrollbar and border are included in
/// the rectangle.
import "dart:html";
import "../../../Utils/expect.dart";
main() {
var html = '<div>Text</div>';
var x1 = new Element.html(html);
var r1 = x1.getBoundingClientRect();
var x2 = new Element.html(html); = '10px';
var r2 = x2.getBoundingClientRect();
Expect.isTrue(r2.height > r1.height, 'padding');
var x3 = new Element.html(html); = '10px'; = 'scroll';
var r3 = x3.getBoundingClientRect();
Expect.isTrue(r3.height > r2.height, 'padding scrollbar');
var x4 = new Element.html(html); = '10px'; = 'scroll'; = '10px solid';
var r4 = x4.getBoundingClientRect();
Expect.isTrue(r4.height > r3.height, 'padding scrollbar border');