mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
This CL makes CSSStyleDeclaration a bit less painful to use by replacing the crazy Java-style APIs with overloading operator[] and operator[]=. R=esprehn@chromium.org, ojan@chromium.org Review URL: https://codereview.chromium.org/942553002
24 lines
537 B
Plaintext
24 lines
537 B
Plaintext
<html>
|
|
<foo />
|
|
<script>
|
|
import "../resources/third_party/unittest/unittest.dart";
|
|
import "../resources/unit.dart";
|
|
|
|
import "dart:sky";
|
|
|
|
void main() {
|
|
initUnit();
|
|
|
|
test('should be settable using "style" attribute', () {
|
|
var foo = document.querySelector('foo');
|
|
foo.setAttribute('style', 'color: red');
|
|
|
|
|
|
expect(foo.getAttribute('style'), equals('color: red'));
|
|
expect(foo.style["color"], equals('rgb(255, 0, 0)'));
|
|
expect(window.getComputedStyle(foo)["color"], equals('rgb(255, 0, 0)'));
|
|
});
|
|
}
|
|
</script>
|
|
</html>
|