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
36 lines
777 B
Plaintext
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>
|