flutter_flutter/tests/lowlevel/bug-438036.sky
Adam Barth b0ef81ac95 Make element.style["color"] work in Sky
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
2015-02-19 13:06:01 -08:00

36 lines
777 B
Plaintext

<sky>
<style>
div { width: 100px; height: 100px; background-color: red; }
div.wide { width: 200px; }
div#high { height: 200px; }
</style>
<div></div>
<div></div>
<script>
import "../resources/third_party/unittest/unittest.dart";
import "../resources/unit.dart";
import "dart:sky";
void main() {
initUnit();
test("should grow width to 200px", () {
var target = document.querySelector('div');
target.classList.add("wide");
expect(window.getComputedStyle(target)["width"],
equals("200px"));
});
test("should grow height to 200px", () {
var target = document.querySelectorAll('div')[1];
target.setAttribute("id", "high");
expect(window.getComputedStyle(target)["height"],
equals("200px"));
});
}
</script>
</sky>