Make splash animations abort on scroll.

I also fixed the transform hack in material-element to clean
up after itself.

I also discovered that our namedSetter implementation did not
handle null (it crashed) while doing this.  I fixed that
and tested my fix.

This runs great on a Nexus 5, but poorly on an Nexus 10.

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/956753002
This commit is contained in:
Eric Seidel 2015-02-24 17:20:18 -08:00
parent 9d1f53dfb7
commit c6f997085c
2 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,6 @@
CONSOLE: unittest-suite-wait-for-done
CONSOLE: PASS: should not crash when setting style to null
CONSOLE:
CONSOLE: All 1 tests passed.
CONSOLE: unittest-suite-success
DONE

View File

@ -0,0 +1,28 @@
<html>
<foo />
<script>
import "../resources/third_party/unittest/unittest.dart";
import "../resources/unit.dart";
import "dart:sky";
void main() {
initUnit();
test('should not crash when setting style to null', () {
var foo = document.querySelector('foo');
expect(foo.style['color'], isNull);
foo.style["color"] = null; // This used to crash.
expect(foo.style['color'], isNull);
foo.style["color"] = "blue";
expect(foo.style['color'], equals("rgb(0, 0, 255)"));
foo.style["color"] = null;
expect(foo.style['color'], isNull);
foo.style["color"] = "blue";
expect(foo.style['color'], equals("rgb(0, 0, 255)"));
foo.style.removeProperty("color");
expect(foo.style['color'], isNull);
});
}
</script>
</html>