blob: 46ce0e43fb5e78a5bf5c2cda6613af04d4992fca [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 for first-letter for nested elements
import "dart:html";
import "../../testcommon.dart";
import "../../../Utils/async_utils.dart";
main() {
var style = new Element.html('''
.test:first-letter { color: green; }
.boxed { border: solid 1px; }
''', treeSanitizer: new NullTreeSanitizer());
<div id="description"></div>
<p class="test" id="test_p_1">
<span class="boxed" id="test_span_1">Span</span>
<p class="test">
<span class="boxed" id="test_span_2" class="boxed">Span</span>
<span class="boxed" id="ref_span" style="font-size:32px"><span style="color:green">S</span>pan</span>
<div id="console"></div>
''', treeSanitizer: new NullTreeSanitizer());
document.getElementById('test_p_1').style.fontSize = '32px';
document.getElementById('test_span_2').style.fontSize = '32px';
description("The three spans below should look the same.");
shouldBe(document.getElementById('test_span_1').offsetWidth, document.getElementById('ref_span').offsetWidth);
shouldBe(document.getElementById('test_span_2').offsetWidth, document.getElementById('ref_span').offsetWidth);