If your constraints are tight when you get laid out, you don't get a
relayout subtree root.
If you don't have a relayout subtree root, and you get marked dirty,
you go through layoutWithoutResize() rather than layout(), so we don't
get a parentUsesSize.
If you're not dirty and your constraints didn't change, layout() skips
your layout.
So then if your initial layout had parentUsesSize:true, and then you
got marked dirty directly, you would set your size with
parentCanUseSize=false, and then later if your parent tried to lay you
out then read your size, it would crash because your size wasn't set
up to allow you to get your size.
The fix is to actually remember the last setting of parentUsesSize,
even in the case of the constraints being tight and you later being
marked as needing layout directly.
Make SnackBar animate itself.
This introduces a bit of a regression - the FloatingActionButton no longer animates. I'm not sure yet how to animated the FAB along with the SnackBar. Maybe some notion of anchoring a node to another.
Also remove last use of AnimationBuilder.
This fixes some theoretical bugs whereby we were using hashCode to try
to get unique keys for objects, but really we wanted object identity.
It also lays the groundwork for a new GlobalKey concept.
I tried to keep the impact on the code minimal, which is why the "Key"
constructor is actually a factory that returns a StringKey. The code
has this class hierarchy:
```
KeyBase
|
Key--------------+---------------+
| | |
StringKey ObjectKey UniqueKey
```
...where the constructors are Key and Key.stringify (StringKey),
Key.fromObjectIdentity (ObjectKey), and Key.unique (UniqueKey).
We could instead of factory methods use regular constructors with the
following hierarchy:
```
KeyBase
|
LocalKey---------+---------------+
| | |
Key ObjectIdentityKey UniqueKey
```
...with constructors Key, Key.stringify, ObjectIdentityKey, and
UniqueKey, but I felt that that was maybe a more confusing hierarchy.
I don't have a strong opinion on this.
We were declaring that the function passed to setState should return a
Function. In reality, we want the function to return void (and everyone calls
it with a function that returns void).
Text styles are now a global constant instead of being initialised dynamically.
There are now sufficient text styles for 8 mines around a square.
I coallesced Game and MineDiggerApp.
Used an enum instead of constants for the cell state.
Used setState() instead of scheduleBuild().
Used an O(N) algorithm for mine laying instead of the previous potentially-never-ending algorithm.
Moved the listener on the cells to the app, so that the logic survives a rebuild.
Various other minor changes.
The first one is that we weren't setting up a
FontCachePurgePreventer during drawText. It's not clear
that this is the correct fix, since Blink doesn't have
this FontCachePurgePreventer here either, but it's also
possible that they would hit this same ASSERT and just
not care (since ASSERTs are disabled on clusterfuzz).
The second fix is making ExceptionState actually track
whether it has thrown an exception or not. The c++ code
was depending on this working in order to return early
from dom functions and not crash!
R=abarth@google.com
It turns out that we aren't really using these. The identity logic is sufficient.
Also, add some asserts for a crash I had once but couldn't reproduce, in case that helps catch it next time.
Route (named routes) no longer have a key, and have their own storage for their names.
RouseState no longer has a key, and uses an owner field pointing to a StatefulComponent instead.
As such, RouteBase no longer has a key.
HistoryEntry no longer uses a global int to ensure uniqueness.
Propagated this to stocks app.
When we build widgets during layout we weren't notifying those widgets that
they were mounted. Now we notify mount status changes when exiting build phases
inside layout.
Fixes#176
This change makes it easier to defined only the width or the height of an image
and let the other value be filled in from the image's intrinsic aspect ratio.
Fixes#175