blob: 7fda1ff7b74e2e78263464e958f893f8dcb2e958 [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
* @description
import "dart:html";
import "../../testharness.dart";
const String htmlEL1 = r'''
#cell {
font: menu;
background-color: skyblue;
padding-left: .73em;
white-space: nowrap;
#display-cell {
font: menu;
background-color: green;
display: table-cell;
padding-left: .73em;
white-space: nowrap;
const String htmlEL2 = r'''
<td id="cell">Should not wrap</td>
<div id="display-cell">Should not wrap</div>
num getElementHeight(element) {
var rect = element.getBoundingClientRect();;
return rect.bottom -;
void testHeight(id, description) {
var cellElement = document.getElementById(id);
var expectedHeight = getElementHeight(cellElement); = 'normal';
if (getElementHeight(cellElement) == expectedHeight)
testFailed(description, 'wraps');
void main() {
document.head.appendHtml(htmlEL1, treeSanitizer: new NullTreeSanitizer());
document.body.appendHtml(htmlEL2, treeSanitizer: new NullTreeSanitizer());
testHeight('cell', 'table cell');
testHeight('display-cell', 'display: table-cell');