blob: 798f8a3e8d6e67854c2c8a8775f01f276b580f4f [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 This test performs a check for the :invalid CSS selector on
* various input elements.
import "dart:html";
import "../../testcommon.dart";
import "../../../Utils/async_utils.dart";
import "pwd.dart";
main() {
var styles = new DocumentFragment.html('''
:invalid { background: lime; }
:valid { background: red; }
input { background: red; }
''', treeSanitizer: new NullTreeSanitizer());
<p id="description"></p>
<form method="get">
<input name="victim" type="text" required/>
<input name="victim" type="text" value="Loremipsum" pattern="Lorem ipsum"/>
<div id="console"></div>
''', treeSanitizer: new NullTreeSanitizer());
var v = document.getElementsByName("victim");
for (var i = 0; i < v.length; i++)
shouldBe(getComputedStyle(v[i], null).getPropertyValue('background-color'), 'rgb(0, 255, 0)');