219 Commits

Author SHA1 Message Date
Hixie
97ed9fdd7d [Effen] rename RenderNode and WrapperNode (previously know as Element) to SkyNodeWrapper and SkyElementWrapper to avoid confusion with C++ RenderNode objects
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1066093003
2015-04-07 14:12:32 -07:00
Eric Seidel
e8140cd33f Unbreak widgets_app.dart (by disabling PopupMenu for now)
Also fix button.dart to include ink_well.dart.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1058013003
2015-04-07 11:17:26 -07:00
Ojan Vafai
88f38ce0e6 Remove all uses of display:block and display:inline-block.
-Make display:flex, flex-direction: column, flex-shrink: 1 the default.
-Simplify StyleAdjuster::adjustStyleForAlignment to remove special cases we
won't need as we make flex the default and remove absolute positioning.
-Fix a bug this exposed in column flexboxes where we'd apply the wrong edge
of border/padding/margin.
-For now leave the default of align-items:stretch. The main change here is
that iframe/img will do width:auto the same as blocks (i.e. the width of
the parent). I think this is a good change, but we'll have to see how it feels
in practice.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1061163002
2015-04-06 16:44:12 -07:00
Tony Gentilcore
cd1ca3d88b Revert API change from issue 1053883002.
tl;dr is that unless the Proxy is passed, the caller doesn't know
whether it's a Stub or Proxy (or whether it's bound).

See that patch for further explanation.

BUG=
R=hansmuller@google.com

Review URL: https://codereview.chromium.org/1052693003
2015-04-02 08:38:33 -07:00
Tony Gentilcore
0bbc4cee4a Make embedder.serviceRegistry return a ServiceRegistry instead of ServiceRegistryProxy.
The proxy has methods like close() that I think we're not intending to expose to the
caller. The ServiceRegistry is just the interface itself. This also avoids users of
the API from having to add a .ptr to their usages of the registry.

BUG=
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1053883002
2015-04-01 16:33:16 -07:00
Hixie
1ad52007bd [Effen] Remove '_isInCheckedMode' flag and use an assert() instead, since presumably that will more reliably get compiled out in prod builds.
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1052793002
2015-04-01 14:28:14 -07:00
Hixie
e3318005f4 [Effen] missed an underscore in the _ensureDepth() logic
TBR=eseidel

Review URL: https://codereview.chromium.org/1056633002
2015-04-01 12:39:59 -07:00
Hixie
ee63773cd1 [Effen] fix _ensureDepth to work on root of tree, oops
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1050153002
2015-04-01 12:08:06 -07:00
Hixie
6ff2cfbe82 [Effen] use the fact that the parent knows its depth already to avoid walking the entire tree each time, and simplify how we build the trace message
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1051913002
2015-04-01 10:30:45 -07:00
Hixie
c0067cceba [Effen] s/Node/UINode/, s/Element/WrapperNode/, s/EventTarget/EventListenerNode/
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1043283003
2015-04-01 09:46:28 -07:00
Hans Muller
867df1ba15 Effen error if a component ancestor doesn't specify a style
If a component ancestor doesn't specify a style, quietly ignore it.

Currently the result is a little confusing:

[0330/124031:ERROR:dart_error.cc(20)] Unhandled exception:
Uncaught Error: The null object does not have a getter '_className'.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1041863003
2015-03-30 14:16:40 -07:00
Adam Barth
8c5939bb7c Fix deploy_sdk.py to include README.md and stock data files
Also, remove testplan.txt, which isn't part of the framework.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1038273002
2015-03-26 17:26:04 -07:00
Adam Barth
8aff978b43 Improve Sky READMEs
TBR=ojan@chromium.org

Review URL: https://codereview.chromium.org/1037163002
2015-03-26 17:17:34 -07:00
Adam Barth
51e3fce449 Clean up examples directory
1) Merge input example into widgets example
2) Move single-file, non-fn examples into a "raw" directory
3) Rename stocks-fn and widgets-fn to stocks and widgets

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1005393006
2015-03-26 14:32:40 -07:00
Hans Muller
aab55efe9c Fix a typo in embedder.dart
Connection has two Ns. It was me.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1020073003
2015-03-25 16:34:49 -07:00
Rafael Weinstein
36ad366ba0 [Effen] Add a basic layout test
BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1038583003
2015-03-25 10:53:51 -07:00
Adam Barth
707968b1db Menu in StocksApp should dismiss when tapping elsewhere
When the StocksApp menu is showing, the user shouldn't be able to interact with
the rest of the app. Instead, taps outside the menu should dismiss the menu.

This CL makes that happen by adding a ModalOverlay on top of the app. We might
want to do something fancier in the future using event delegation, but this
works for now.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1031093002
2015-03-25 10:43:35 -07:00
Adam Barth
171ff643ef Disentangle Material and InkSplash
Most of the elements that want to be Material (i.e., have a level and cast a
shadow) don't want to be InkWells (i.e., have an ink splash effect). This CL
disentangles these two components, fixing bugs in the Drawer and in the
PopupMenu. Separating these concepts also lets us use Material for the
ActionBar and the FloatingActionButton.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1037673002
2015-03-25 10:43:12 -07:00
Adam Barth
4f29d04e2e Add an implict animation between ActionBar backgrounds
This CL uses CSS transition to add an implicit animation between purple
ActionBar and the light grey "search" action bar. It's unclear to me how best
to create implicit animations in this system, but using a CSS transition works
surprisingly well.

Also, fix the typography style for the placeholder in the search box.
Previously it was white on Grey[50], which was extremely hard to see.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1036783002
2015-03-25 10:42:42 -07:00
Adam Barth
bfd2651acb Remove the |style| parameter from Material
There's no reason for Material to take a |style| parameter anymore. Clients can
simply use StyleNode instead.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1030963005
2015-03-25 10:42:19 -07:00
Adam Barth
c6fa902d79 Remove the |style| parameter to InkWell
There's no reason for InkWell to take a |style| parameter anymore. Clients can
simply use StyleNode instead.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1019443003
2015-03-25 10:41:38 -07:00
Adam Barth
f2ce04fb3d Menu in StocksApp should animate out
This CL teaches PopupMenu how to animate out as well as in. Also, I've changed
the PopupMenuItem animations to be driven from the PopupMenu itself, which
makes it easier to run the animation in reverse when closing the menu.

TBR=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1033913002
2015-03-25 10:40:29 -07:00
Adam Barth
040c83d59a Clean up stock_app.dart
This CL cleans up stock_app.dart to better separate concerns now that we have
StyleNode. Also, this CL introduces IconButton, which will grow to include an
ink effect in the future, and makes the background of the search bar white.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1007893005
2015-03-24 18:00:33 -07:00
Adam Barth
f3df64fa3d Let Dart code running in Sky add events to the trace timeline
This will let us form a wholistic picture of work done in the framework and in
the engine.

R=ojan@chromium.org, rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1028243003
2015-03-23 14:48:06 -07:00
Hixie
e42426a37c [Effen] put Node class above its superclasses
TBR=rafaelw

Review URL: https://codereview.chromium.org/1030753002
2015-03-23 14:44:18 -07:00
Adam Barth
cc12331d63 Update references to Mojo core and bindings
Build fix after recent Dart bindings refactoring.  Now that these libraries are
not included in the snapshot, we need to load them from the mojo package.

R=zra@google.com
TBR=zra@chromium.org

Review URL: https://codereview.chromium.org/1029683002
2015-03-23 13:22:38 -07:00
Zachary Anderson
d83427c165 Dart: Removes all but native calls and the handle watcher from the snapshot.
The bindings, core, and application libraries are now referred to as, e.g.:

package:mojo/public/dart/core.dart

Since the handle watcher remains in the snapshot, it no
longer refers to types defined in core.dart. References to types defined
in core.dart are also removed from mojo_natives.cc.

In Dart packaged apps, the SDK is zipped up under mojo/public/dart.

For embedder tests, the SDK is copied into the generated source output directory.

A base_dir parameter is added to the 'dart_package' and 'mojom' GN macros so that
consumers of the Mojo SDK can all import using the same URIs regardless of where
the SDK lives in their source trees.

BUG=
R=erg@chromium.org

Review URL: https://codereview.chromium.org/1027603002
2015-03-23 11:04:03 -07:00
Adam Barth
9703e7f46f Load stocks data off the network
Instead of hard-coding the stock data in the Dart file, this CL moves the data
to a JSON file and loads that file over the network. This change improves load
time for the Stocks app from 3 seconds to 2 seconds.

Also, this CL removes shake-to-reload from the Stocks app because that also
slows down load time (due to the two module systems fighting each other).

R=rafaelw@chromium.org, ojan@chromium.org

Review URL: https://codereview.chromium.org/1021723005
2015-03-23 09:59:50 -07:00
Rafael Weinstein
8eaeed7ba0 [Effen] Update README.md 2015-03-20 13:45:04 -07:00
Rafael Weinstein
5b9632b9d4 Update Effen README.md 2015-03-20 13:43:55 -07:00
Rafael Weinstein
ad8f8a6ea5 [Effen] Move README.md to correct directory
TBR=abarth
BUG=

Review URL: https://codereview.chromium.org/1024183002
2015-03-20 13:24:10 -07:00
Rafael Weinstein
d702c848e4 [Effen] minor cleanup
This patch adds an assert that the mount/unmount queues are not subject to concurrent modification and refactors the sync-tracing to avoid the cost of string interpolation if tracing is disabled.

BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1020103004
2015-03-20 10:20:05 -07:00
Adam Barth
f8b3596df6 Use StyleNode in StockMenu
StockMenu was creating a container for the sole purpose of applying style to
PopupMenu. Now we just use a StyleNode.

Also, I've reverted the change to make box-sizing default to border-box. It
turns out that CL wasn't effective because we didn't use the initialBoxSizing
function to initialize box sizing. I've made us use initialBoxSizing but switch
the default back to content-box because actually using border-box breaks a
bunch of stuff.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1024083003
2015-03-20 10:16:24 -07:00
Adam Barth
9a5aea3737 Introduce Scaffold to Sky framework
This CL extracts a Scaffold component from StockApp. The Scaffold component
lets you create an "app-like" layout with an action bar, a drawer, etc.

R=ojan@chromium.org, rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1027813002
2015-03-20 09:34:06 -07:00
Rafael Weinstein
082ca7c2c0 [Effen] add StyleNode
This patch adds a new (non-Render) StyleNode which takes two arguments: A (content) node, which it wraps and a Style object.

This allows for styles to be applied to Nodes which are constructed elsewhere (e.g. passed in as arguments).

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1027653002
2015-03-16 12:27:25 -07:00
Rafael Weinstein
86dc24f938 [Effen] Add AnimatedComponent base class
This patch adds a base AnimatedComponent from which most components that animated should derive. It takes care of listening & unlistening from the animations during did(Un)mount as well as binding the animated value to a private field and scheduling the component for build.

Note that this patch removes the did(Un)mount overridable methods from Component and replaces them with a callback mechanism which is less brittle.

BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1027633003
2015-03-16 03:18:17 -07:00
Rafael Weinstein
f7a1477d26 [Effen] Add _syncChild assert and cleanup trace output
TBR=abarth
BUG=

Review URL: https://codereview.chromium.org/1021113002
2015-03-16 01:19:26 -07:00
Rafael Weinstein
486d0c1ce9 Added render tracing to Effen
TBR=abarth

Review URL: https://codereview.chromium.org/1023063003
2015-03-16 00:49:09 -07:00
Rafael Weinstein
216f9b143c [Effen] Slightly cleaner enforcement of App lifetime signals
TBR=hansmuller

Review URL: https://codereview.chromium.org/1028473003
2015-03-15 23:26:41 -07:00
Hans Muller
2239d67032 Call _notifyMountStatusChanged() on App startup
A recent change caused my scrolling app to fail because
didMount() was no longer called on my Scrollable subclass
at startup time.

I haven't been able to sort out how this used to work.
This CL is a hack to make it work again.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1019973003
2015-03-19 14:05:44 -07:00
Adam Barth
97abc0dadd Improve Material ink effects
1) Factors InkWell out of Material so that components can use an ink well
   without needing the shadow/level machinery.

2) Makes the ink effect move at a different velocity once the tap has actually
   occurred, converging with the spec. We don't have the right speeds yet, but
   at least we're approaching the right shape.

3) To support (2), added a primaryPointer attribute to GestureEvents to let
   authors coorelate gesturetapdown events with later gesturetap events.

4) To support (2), modernized SplashAnimation to used AnimatedValue and friends.

5) Added more constants to view-configuration.dart that match Android.

I've also removed the cancelling of the ink effect on scroll. The proper way to
do that is to notice that someone in the event chain is listening for
scrollstart and delay the beginning of the ink effect for some period of time.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1019023003
2015-03-19 11:17:48 -07:00
Adam Barth
953145ba63 Default box-sizing to border-box
content-box is crazy banana-pants.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1015253002
2015-03-19 10:55:03 -07:00
Rafael Weinstein
7230f65ca9 Turn off Effen render times printing
TBR=abarth
BUG=

Review URL: https://codereview.chromium.org/1023673004
2015-03-15 13:08:26 -07:00
Hans Muller
cc4f7d0db0 Added a positional Component.fromArgs() constructor
To define a Component subclass with mixins, a constructor without optional parameters is needed.

Added Component.fromArgs() which just delegates to the main constructor.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1017353002
2015-03-19 08:06:23 -07:00
Rafael Weinstein
e8318f65a7 Change how events are handled in Effen
This patch removes the mutable API to event handling (Nodes no longer have a events object with which to add listeners).

Instead, a new (non-Render) Node is introduced: EventTarget. This node represents a location in the Effen tree which can handle events as they bubble.

Note that this also changes the implementation to use event delegation (one set of listeners at the sky.document level) rather than direct listeners on leaf nodes.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1019633004
2015-03-15 12:33:30 -07:00
Adam Barth
420098c97c Improve the openning animation for PopupMenu
We're now doing all of the elements of the popup menu entrance animation from
the material design spec, but our timing and curves might not be exactly right
yet. I haven't started on the exit animation.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1017193004
2015-03-18 15:21:48 -07:00
Eric Seidel
03407ba35e Remove custom elements examples, they are no longer maintained
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1022613002
2015-03-18 13:38:17 -07:00
Rafael Weinstein
8879e082ef Refactor Effen to make explicit the distinction between render & non-render nodes.
All Effen which can directly create a sky.Node are now derived from RenderNode. In contrast, Component now derives from the (now) base Node class which simply represents a position in the Effen hierarchy.

A fair amount of clean-up & refactoring went into this change, simplifying & unifying the "sync" logic between Element & Component as well as making the Component.didMount/didUnmount signals async WRT component building.

BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1009543008
2015-03-14 17:27:27 -07:00
Adam Barth
10d63a0744 Begin work on the PopupMenu entrance animation
This CL also refactors how animations work, particularly for the Drawer. I've
renamed DrawerAnimation to DrawerController and switched it from being an
Animation to having an Animation. I've also renamed Animation to AnimatedValue
to capture the idea that the class actually presents the value being animated.
Finally, I've factored AnimatedValueListener out of Drawer so that it can be
used by PopupMenuItem as well.

Finally, I've added a scheduleBuild convienence function to Component instead
of having to call setState(() {}), which has come up a couple times.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1016093002
2015-03-18 11:31:07 -07:00
Adam Barth
4b6783ceee Add a menu to the stocks app
We should probably move this menu into a view for an individual stock, but for
now add it to the main stock screen.

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

Review URL: https://codereview.chromium.org/1008003007
2015-03-17 19:21:36 -07:00