1262 Commits

Author SHA1 Message Date
Rafael Weinstein
e109f30916 Change the name of Component.render to Component.build in Effen.
"Render" is misleading. "Build" may not be the best word either, it's closer to what's actually happening.

R=ojan@chromium.org
TBR=abarth
BUG=

Review URL: https://codereview.chromium.org/992033002
2015-03-09 13:30:13 -07:00
Rafael Weinstein
def96f0fd4 Ensure that sky Nodes are in the document when didMount() is fired. Refactor FixedHeightScrollable to inspect heights rather than having the passed in
BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/994553003
2015-03-09 12:39:10 -07:00
Adam Barth
4bb0ff3875 Fix shake-to-reload
The Dart bindings changed syntax a bit. This CL updates shake-to-reload to
match the new names.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/987103003
2015-03-09 10:49:46 -07:00
Ojan Vafai
a0c612c89b Fix hit-testing of elements with the same z-index.
hit-testing needs to walk in backwards order from paint.
The previous attempt at reverse sorting by z-index didn't
reverse things with the same z-index. Instead, forward
sort the same way as we do with paint and then reverse
the whole vector.

R=abarth@chromium.org, eseidel@chromium.org

Review URL: https://codereview.chromium.org/986793002
2015-03-06 15:53:02 -08:00
Hans Muller
d821faf18c Fix build: ServiceRegisty's Mojo module changed.
TBR=sky

Review URL: https://codereview.chromium.org/981143005
2015-03-06 15:46:30 -08:00
Rafael Weinstein
a77b1efd52 Prevent already scheduled-for-render fn components which become removed from rendering
This can occur, for instance, if a child component runs before a parent component within a single animation frame, and the child does setState() while the parent removes it. The child will already have been entered into the rendering queue.

TBR=eseidel
BUG=

Review URL: https://codereview.chromium.org/983793004
2015-03-06 14:16:16 -08:00
Rafael Weinstein
21a3cbab83 Correctly allow components to return different top-level nodes during different renderings
TBR=abarth
BUG=

Review URL: https://codereview.chromium.org/984983004
2015-03-06 13:32:07 -08:00
Rafael Weinstein
c3823b9204 Add back didMount
Sorry I keep changing my mind about this. My thinking had been since this was computable by just setting a bit and checking it in render(), that it was silly, but I keep finding uses for it and it's annoying to re-implement in each component.

TBR=eseidel
BUG=

Review URL: https://codereview.chromium.org/986753002
2015-03-06 12:50:42 -08:00
Rafael Weinstein
dc67022998 add some more sky api to fakesky stub implementation.
TBR=eseidel
BUG=

Review URL: https://codereview.chromium.org/987833002
2015-03-06 12:46:02 -08:00
Rafael Weinstein
2c788c3e6d Effen: willUmount->didUnmount, allow setState after didUnmount
This patch changes the timing of the unmount call until after the component is removed (and marked as such) and allows setState to be called after this point. If this happens, setState will still invoke the closer to do any neccesary cleanup, but doesn't schedule the component for render

R=eseidel@chromium.org, eseidel
BUG=

Review URL: https://codereview.chromium.org/985853002
2015-03-06 12:23:53 -08:00
Eric Seidel
e2a00dd49d Add an assert that we don't schedule a render during render
In production I added an early return.  I don't bother to log
in production since no one is looking at the log anyway.

Unfortunately this currently only fires when using a debug build
we should fix our Release build to have a checked-mode option
or consider hacks like having all localhost urls enable checked
mode, etc.

R=ianh@google.com, rafaelw@chromium.org
BUG=

Review URL: https://codereview.chromium.org/983973005
2015-03-06 10:42:49 -08:00
Rafael Weinstein
b161df2fe4 Remove unused Effen/widgets component. This was erroneously committed with the initial commit
TBR=eseidel
BUG=

Review URL: https://codereview.chromium.org/983173003
2015-03-06 10:24:01 -08:00
Adam Barth
177e6d1419 The floating action button should have a shadow
This provokes a rendering bug in MojoShell but not in SkyShell.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/984793002
2015-03-05 17:56:15 -08:00
Eric Seidel
bbeb05afb7 Make stocksapp.dart almost pass the dart analyzer.
To test:
sky/tools/shelldb analyze sky/examples/stocks-fn/stocksapp.dart

It prints 600+ warnings about the "native" keyword, and after
this change only a couple warnings about missing library names
which I don't fully understand.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/987613002
2015-03-05 16:52:14 -08:00
Eric Seidel
ebc0dd2c09 Re-enable dart:sky in shelldb analyze.
It show 600+ "native" warnings, but those can be ignored
for now.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/981103002
2015-03-05 16:22:50 -08:00
Hixie
88df817d43 fix typo in _syncEvent; make it possible for a component to entirely change the class of its rendering's component
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/986463003
2015-03-05 16:06:33 -08:00
Adam Barth
270d658ad9 Sometimes the drawer doesn't fully close
The AnimationGenerator didn't always generate the |end| value because of
floating point rounding. This CL causes it to always generate |end| at the end.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/983893002
2015-03-05 15:53:22 -08:00
Hixie
37c27faae4 fix the hang when clicking the drawer in the stocks app
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/980043005
2015-03-05 15:46:21 -08:00
Eric Seidel
3a73d55159 Fix test_sky after 14270f1151aacfa650985c4333572c356d15c024
In order to make the Dart Analyzer stop complaining about
Event not having a default constructor (and all Event subclasses
not having an explicit constructor, thus having an implicit one
which calls the default Event() constructor), I made all of
Event()'s parameters named and thus optional, but did not update
our one sky test which used Event().

The real fix is probably to make the autogenerator smart enough
to have FooEvent() call super("foo"), but I was lazy.

This at least fixes the tests (and greens the waterfall) for now.

TBR=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/988573002
2015-03-05 15:45:06 -08:00
Eric Seidel
e3a8059796 Fix all dartanalyzer errors in dart:sky except the Native ones.
I also fixed all warnings. :)

This is the only error remaining:
[error] Native functions can only be declared in the SDK and code
that is loaded through native extensions

My understanding is that we need to do something similar to:
https://codereview.chromium.org/950063002/
in order to work around the 'native' issue.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/981733009
2015-03-05 13:36:48 -08:00
Adam Barth
ca60f330e9 Move animationgenerator.dart to sky/framework/animation/generator.dart
That's where it belongs.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/979283002
2015-03-05 11:40:35 -08:00
Adam Barth
1f77a79a2c fn.dart shouldn't spam the log
This CL introduces a flag to control whether fn.dart prints the render duration
to the console. By default, the flag is off to avoid log spam.

Also, improve the way we intialize _isInCheckedMode to make use of the fact
that Dart intializes final fields lazily.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/982073002
2015-03-05 11:38:17 -08:00
Eric Seidel
e7335d39f4 Add a new analyze command to shelldb to run the dart analyzer
This just makes it easier to run with the correct flags.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/982093003
2015-03-05 11:28:57 -08:00
Adam Barth
e3812af9c0 Move fn.dart into /sky/framework
It's awkward to work on fn.dart in the examples directory so this CL moves it
to /sky/framework. Also, I've merged the whole library into one file instead of
using the |part| mechanism. The whole thing isn't that big.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/987463002
2015-03-05 10:53:01 -08:00
Adam Barth
adc56ba354 Remove some more Sky examples that don't run
These examples don't work anymore and have been replaced with
color-chooser.sky.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/987443002
2015-03-05 10:52:29 -08:00
Scott Violet
517379cf6d Makes DocumentView not assume it's getting services from the embedder
It's legal for the person embedding to supply null.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/979223003
2015-03-05 10:42:47 -08:00
Adam Barth
49299c81ec Fix the drawer curve to match Android
This CL changes the duration of the drawer animation to match the values used
by the Android framework.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/976193002
2015-03-05 10:16:19 -08:00
Adam Barth
4df0891248 Organize sky/framework a bit
- Removed out-of-date README.md
- Moved fling-curve into the animation directory because it's part of the
  animation behavior of the system.
- Moved view-configuration into the theme directory because it's a collection
  of constants similar in flavor to the colors and the shadows. Eventually
  we'll want to make the theme configurable and have these all together will
  hopefully make that easier.
- Moved dom-serializer into tests/resources because it is used only by tests.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/980423002
2015-03-05 09:59:50 -08:00
Adam Barth
19a844139b Remove duplicate copy of animation/curves.dart in fn widgets
Instead, we can just use the existing animation/curves.dart file in the
framework.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/976373003
2015-03-05 09:59:22 -08:00
Adam Barth
22f3af608c Add constants for material colors and shadows
This CL removes the hard-coded colors and shadows from the fn widgets and
replaces them with compile-time constants. The color values are from the
material spec:

http://www.google.com/design/spec/style/color.html#color-color-palette

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/983733003
2015-03-05 09:58:23 -08:00
Adam Barth
c8e809c998 Remove duplicate copy of fling-curve.dart in fn
Instead of duplicating fling-curve.dart in fn, we now share the existing copy
in sky/framework.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/976363003
2015-03-05 09:57:42 -08:00
Adam Barth
2f7ec6c4a0 stocks and stocks-fn should share the stocks data
Previously, the two versions of this sample app had separate copies of the
stock data. This CL moves the common data to the common data directory so that
they can share. Also, I've switched the data files to be |dart| files rather
than |sky| files to make them easier to use from fn examples.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/980953002
2015-03-05 09:56:51 -08:00
Adam Barth
b15263b453 Clean up examples directory
This CL removes a bunch of examples that don't actually work in the current
engine. I've also renamed example-element to custom-element and
example-scrollable to scrolling because the word "example" in the name is
redundant with the name of the directory.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/980323003
2015-03-05 09:55:55 -08:00
Adam Barth
383ea84244 Update SDK.md 2015-03-05 08:42:17 -08:00
Adam Barth
075635df29 Don't hardcode the list of events types in fn
This CL changes how events work in fn. Previously, event listeners were passed
in as constructor arguments. Now Nodes hold an |events| object, which contains
all the event registrations. When a Component renders, all its |events| are
copied onto the Node it produces. When an Element syncs, it walks its |events|
and adds them as event listeners on the underlying sky.Element.

The net result of this change is increased flexibility in how events are
registered. Now components don't need to enumerate all the possible events that
they support. Instead, the parent component can listen for whatever events it
likes.

Also, I've cleaned up the association between DrawerAnimation and Drawer. Now
the constructor for Drawer accepts an |animation| object and wires up its
internal event handlers itself instead of requiring the constructor to do all
the wiring.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/975863003
2015-03-05 08:00:24 -08:00
Hixie
46b137918b Specs: fix typos in style2.md, checkin forgotten builtins.md, add guard feature to runloop.md, rename WeakMap to MapOfWeakReferences, factor out Pair<>
Review URL: https://codereview.chromium.org/974313003
2015-03-04 09:37:15 -08:00
Hixie
fd4e2c76d2 sky-element stocks demo: add splashes and highlights to menu items
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/961873004
2015-03-04 09:25:31 -08:00
Adam Barth
0438646372 Clean up some Dart idioms in fn
This CL adds license blocks and cleans up a number of Dart idioms in fn.
Specifically, I've marked several fields as |final| and used Map#putIfAbsent in
some appropriate places.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/973613004
2015-03-04 08:27:04 -08:00
Rafael Weinstein
6e9f94b046 Update sky/examples/fn README.md 2015-03-03 21:26:25 -08:00
Adam Barth
d83aa61c46 Give the floating action button a slash effect
R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/970393002
2015-03-03 16:10:21 -08:00
Adam Barth
9381792e14 fn-drawer sometimes doesn't tick closed
If there is jank, we might not get a frame time that's just after the last
frame, which means we'll stop generating animation frames before hitting 1.0
exactly.

In this CL, we introduce state to takeWhile to cancel the stream after emitting the
1.0.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/975153002
2015-03-03 15:45:52 -08:00
Rafael Weinstein
aae2fbd500 Remove box shadow on floating action button until ganesh fixes its bug
TBR=abarth

Review URL: https://codereview.chromium.org/975203002
2015-03-03 15:36:21 -08:00
Hixie
80b4c2eadc fn: make menu items have material splashes also, by factoring out the splashes
TBR=raf

Review URL: https://codereview.chromium.org/974903005
2015-03-03 14:12:15 -08:00
Adam Barth
7d49301b3c Implement a floating action button in fn
R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/975913002
2015-03-03 14:05:02 -08:00
Scott Violet
74fe1ddecd Fixes ViewManagerClient name in sky
It needs to be mojo::ViewManagerClient; none-the-less we should use
the value from the header so we're insulated from whatever the name
happens to be.

R=hansmuller@google.com, abarth@chromium.org, hansmuller@chromium.org

Review URL: https://codereview.chromium.org/978603002
2015-03-03 14:02:56 -08:00
Eric Seidel
2959de0e37 Make shelldb not crash.
I clearly hadn't actually tested it.  Sorry.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/955263004
2015-03-03 12:49:56 -08:00
Eric Seidel
8ea48be24b Change fn-stocks to use a different color toolbar.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/973133002
2015-03-03 11:17:10 -08:00
Eric Seidel
9e08140a15 Add super-primitive shelldb
This is basically skydb v2, except only for android.

I revisited some of the architecture decisions I made
in writing skydb.  I also separated skyserver.py from
dependency on skypy/paths.py since it wasn't really adding
any value.

We could make this way fancier, but this should at least
make working with SkyDemo.apk easier for now.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/960233007
2015-03-03 10:55:22 -08:00
Rafael Weinstein
8a42f9ec75 Initial commit of Effen reactive framework experiment for Sky
This is just a proof of concept. If we like this direction, it will move out of the examples directory (likely re-written) and be committed in smaller pieces with unit tests and formal reviews.

TBR=abarth
BUG=

Review URL: https://codereview.chromium.org/971183002
2015-03-02 20:55:02 -08:00
Adam Barth
11f482978c Stocks app shouldn't show black when resuming from recents list
Previously, we weren't scheduling a visual update when our surface was created,
so we'd just continue to show black until the author requested a new animation
frame. After this CL, we schedule a visual update as soon as our surface is
created.

As part of this change, I've removed knowledge of the GPU delegate from
PlatformView. Now, all the calls from PlatformView to the GPU system bounce
through the UI delegate, which serializes the commands with other commands from
the UI engine to the GPU rasterizer.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/974483004
2015-03-02 16:25:24 -08:00