blob: 8a70f187dc790516a13d706c8cb3d67bbc193c33 [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 directionality of an element with dir=auto set is
* not determined by the value of its child text form control.
import "dart:html";
import "../../../../Utils/expect.dart";
import "../../../testcommon.dart";
main() {
var meta = new Element.html('''
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
''', treeSanitizer: new NullTreeSanitizer());
var style = new Element.html('''
.testElement {-webkit-border-start: 5px solid green; -webkit-border-end: 5px solid red; }
''', treeSanitizer: new NullTreeSanitizer());
<p id="description"></p>
<div id="console"></div>
<div id="result"></div>
<div id="parentDiv">
Test that the direction of the div is left-to-right, ignoring its child that is a text form control.
<div id="left-to-right" dir="auto" class="testElement">
<input type="text" value="מקור השם עברית">Test test test
Test that the direction of the div is right-to-left, ignoring its child that is a text form control.
<div id="right-to-left1" dir="auto" class="testElement">
<input type="text" value="Test test test">מקור השם עברית
<div id="right-to-left2" dir="auto" class="testElement">
<textarea>Test test test</textarea>מקור השם עברית
''', treeSanitizer: new NullTreeSanitizer());
var el = document.getElementById("left-to-right");
'rgb(255, 0, 0)');
el = document.getElementById("right-to-left1");
'rgb(0, 128, 0)');
el = document.getElementById("right-to-left2");
'rgb(0, 128, 0)');
document.getElementById("parentDiv").style.display = "none";