Commit graph

2850 commits

Author SHA1 Message Date
Eric Seidel 7e9bbbec21 Sort the stocks displayed in stocks-fn as per Material Design
http://www.google.com/design/spec/components/lists.html#lists-behavior

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/993093004
2015-03-10 14:55:49 -07:00
Eric Seidel a8891ed07e Fix toolbar height to match Material Design.
54px on small screens:
http://www.google.com/design/spec/layout/metrics-keylines.html#metrics-keylines-keylines-spacing

TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/995133002
2015-03-10 14:38:44 -07:00
Adam Barth 6f691a043e Make Sky's EditableText mostly work
This CL factors EditableString out of EditableText and implements more of the
InputConnection functions. As a result, EditableText now basically works.

This CL also paves the way to make EditableText stateless by using
EditableString as its state object. However, there's still a bit more work to
do to make that a reality (e.g., factoring out the cursor blink timer and the
connection to the keyboard).

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/995073002
2015-03-10 12:31:55 -07:00
Rafael Weinstein f7cdfda454 Add initialDelay to AnimationGenerator and add Animation class.
This patch allows for an initial delay before an animation begins and also adds an Animation class which encapsulates a value which is long-lived, can be explicitly set and also animated from its current value to another value.

BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/994143002
2015-03-10 12:22:15 -07:00
Adam Barth 42b7a2716d Implement a basic IME-aware input element
This CL introduces a new keyboard service that understands Android IME and
starts work on a Input component that interacts with this service to provide an
editing control.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/995613002
2015-03-09 16:19:56 -07:00
Rafael Weinstein 409b12e5df 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 b7d9e4753f 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
Rafael Weinstein 440185f854 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 4dcb64a99f 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
Rafael Weinstein 196fd752c4 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 21012343aa 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 2a9c2c40bf 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
Hixie 760a6502e0 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
Adam Barth 169dea3270 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 55421096ec 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 c3aeac0ea1 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
Adam Barth b23b62af59 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 bf2ff82576 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 38ef054f95 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 65592c41cd 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 1c73dfb952 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 09538aed91 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 7b1f56d8b2 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 50c2f8837b 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
Adam Barth 3f34718465 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 e5a51a3052 Update sky/examples/fn README.md 2015-03-03 21:26:25 -08:00
Adam Barth a7aea2ba1e 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 4677386498 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 130124bd4a 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 658f770723 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 3c5df69a2b 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
Eric Seidel de7f8a9c2b 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
Rafael Weinstein 202f99d71d 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 6f92088fae Use double rather than float
double is a built-in type in Dart. float isn't...

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/968293003
2015-03-02 13:11:05 -08:00
Eric Seidel b9c8e71096 Add support for pressure on pointer events
The touch demo needs some basic smoothing, right now
it looks rather jittery after this change.  But the pressure
code is definitely working!

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/970493003
2015-03-02 12:38:29 -08:00
Adam Barth 11c76c9c45 Make shake-to-reload actually work
We need to create a new service provider when we navigate to a new page
otherwise the new page is sad that the old page took its service provider.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/962383003
2015-02-27 16:38:40 -08:00
Adam Barth 5db32b7186 Implement shake-to-reload
Apps can import this library if they wish to reload on shake.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/963303004
2015-02-27 15:31:11 -08:00
Adam Barth 5db8423f38 Expose Android sensors to via Mojo services
This CL adds a sensor_service to sky/services and wires it into SkyShell
The plan is to eventually use this data to implement shake-to-refresh.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/962043002
2015-02-27 14:37:50 -08:00
Eric Seidel a128b09618 Fix multi-touch to work in SkyShell.
Before this patch it crashed.

Also updated the touch-demo to support multi-touch.

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/961483004
2015-02-26 12:23:18 -08:00
Zachary Anderson 1a9b6b68d4 Dart: Renames dart:mojo_blah -> mojo:blah
This improves consistency with the convention that the dart: scheme is
only for things from the Dart standard library.

BUG=
R=erg@chromium.org

Review URL: https://codereview.chromium.org/951783004
2015-02-25 14:29:41 -08:00
Adam Barth 6d64856134 Implement quantum ink splashes
These aren't 100% correct, but they look somewhat reasonable.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/954023002
2015-02-24 15:41:52 -08:00
Adam Barth b4385bcebe Make the stock app demo list view prettier
This CL makes the list view in the stocks app more consistent with the material
spec by using a colored circle instead of color-coding the percentage change.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/932103004
2015-02-24 15:41:35 -08:00
Adam Barth 8462f94f22 Add a shadow to the sky-drawer
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/950353003
2015-02-24 11:33:26 -08:00
Adam Barth 0c2621411d Make the stocks drawer look more realistic
The menu items don't quite make sense for this app, but they're closer in
visual styling.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/951413002
2015-02-24 10:48:23 -08:00
Adam Barth 5f50e4b60f Factor sky-toolbar into a componet and use a proper material shadow
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/953903004
2015-02-24 10:47:01 -08:00
Adam Barth 3904a6c35b Update Sky widgets to have more material design
This CL updates the Sky widgets to be closer to the material design spec.
There's still a long way to go, but this CL is a start.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/951823002
2015-02-23 23:59:57 -08:00
Adam Barth adf02a0dc5 Add a search and menu button to stocks app
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/956463002
2015-02-23 22:14:26 -08:00
Adam Barth b24baa7a2a Add <sky-icon> to access material design widgets
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/947383002
2015-02-23 17:26:19 -08:00
Eric Seidel 4ca655c963 Add a box-shadow to the app-bar per material design
Also made the background a MD color.

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/951653004
2015-02-23 17:19:29 -08:00
Eric Seidel 71390b7ef1 Attempt to make the stocks example more more material-friendly.
http://www.google.com/design/spec/components/lists.html#lists-specs
http://www.google.com/design/spec/style/color.html#

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/930193004
2015-02-23 16:19:06 -08:00
Adam Barth 465de9a02f Remove outdated examples and framework pieces
None of this code runs in the current Sky. Some of it never ran.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/951673003
2015-02-23 15:09:36 -08:00
Eric Seidel 377cd1bea7 Show the last sale price in the stocks app
TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/953593002
2015-02-23 14:51:22 -08:00
Eric Seidel 457c78f742 Make the stocks app slightly prettier.
I removed the green background and added display
of percent change (which is random for now).
I also display a random assortment of stocks every time
instead of always the top 100.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/950073002
2015-02-23 13:09:40 -08:00
Eric Seidel e6a5e59e25 Wire in more-real stock data for stocks example.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/954513003
2015-02-23 12:52:17 -08:00
Adam Barth 545f6abb02 Morph "appish" example into a "stocks" app
We'll flesh this example out over time to demo a bunch of our widgets.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/954503002
2015-02-23 09:30:11 -08:00
Adam Barth 973cf80fb9 Port sky-drawer to Dart
Also, port the "appish" example to exercise the drawer.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/942413002
2015-02-23 08:30:58 -08:00
Adam Barth eb117c7326 Port Sky widgets demo to Dart
This CL updates sky-box, sky-button, sky-checkbox, sky-input, and sky-radio to
work in Dart. We don't have a data binding system yet, so there's a bit more
plumbing in the code.

This CL adds support for sky-element@attributes, which lets you specify which
attributes your element supports. We use this information to synthesize getters
and setters for those attributes and to dispatch to mumbleChanged methods when
the attributes change.

I've also wrapped the widgets demo itself in a sky-scrollable so the whole
thing scrolls.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/946813005
2015-02-23 08:30:36 -08:00
Adam Barth 01938c9551 Port sky-scrollable to Dart
This CL ports sky-scrollable to the new sky-element.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/950603002
2015-02-21 09:56:22 -08:00
Adam Barth fba37a0398 Add a basic sky-element custom element
After this CL, you can use <sky-element> to describe custom elements. The
current iteration is very basic and is hardcoded to "example", but its a start.

This CL renames the |init| function to |_init| to prevent importers from
calling it directly. Also, we now pass the <script> element to |_init| to give
some context.

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

Review URL: https://codereview.chromium.org/950493003
2015-02-20 21:45:36 -08:00
Eric Seidel 7dcdf11b95 Fix touch-demo after recent api changes.
TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/950503002
2015-02-20 15:23:09 -08:00
Eric Seidel 26629785a9 Fix spinning-square to spin again.
TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/942923002
2015-02-20 10:28:03 -08:00
Adam Barth c54e1688e8 Sky should expose services provided to/by embedder
These now appear on internals as takeServicesProvidedToEmbedder and
takeServicesProvidedByEmbedder. When you call these functions, you get back the
raw int that represents the handle. We'll need to wrap them up inside the Dart
VM with the appropriate types. We can create a nice wrapper for that in a
future CL.

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

Review URL: https://codereview.chromium.org/944733002
2015-02-19 21:16:04 -08:00
Hans Muller 819d14cbd2 Dart version of the Sky color chooser
I haven't removed the JS color picker code yet.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/940233002
2015-02-19 15:08:20 -08:00
Adam Barth 431716f86d Port touch-demo.sky to Dart and make it work in SkyShell
We still don't quite handle multitouch correctly, but single touches work now.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/932283002
2015-02-18 16:57:32 -08:00
Adam Barth a5e01b1521 Add initializeFromShellProxy to application.dart
This CL adds the ability to initialize the Dart Application class with a shell
proxy (rather than with a MojoHandle). This change lets Sky use the Dart
bindings for Mojo.

This CL was reviewed on the SkyDart branch in
https://codereview.chromium.org/919883002/

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

Review URL: https://codereview.chromium.org/922083002
2015-02-12 23:36:40 -08:00
Adam Barth deedba409a Merge the Sky Engine changes from the SkyDart branch
This CL flips the switch to make Sky use Dart.

TBR=eseidel@chromium.org
BUG=454613

Review URL: https://codereview.chromium.org/922893002
2015-02-12 15:06:03 -08:00
Hans Muller 5f719fecde Extend the sky color picker example
Displays the last six selected colors.

BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/897683002
2015-02-04 09:30:47 -08:00
Hans Muller ae503019b7 A simple Sky color chooser example. The color-picker is
two components: color-wheel, and color-picker which adds
a div that displays the selected color. Data binding is
used to connect the color-wheel's "color" property to the
sample div's background-color.

BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/872993006
2015-02-02 09:01:47 -08:00
Adam Barth 249bb59f25 This CL adds an "appish" example to the Sky examples, including a drawer widget.
R=eseidel@chromium.org, esprehn@chromium.org

Review URL: https://codereview.chromium.org/886723002
2015-01-29 11:21:39 -08:00
Ojan Vafai 45d7d34530 Add a selection and outline to flights-app.
This is just to get basic paint coverage of selections
and outlines on positioned elements.

TBR=esprehn@chromium.org

Review URL: https://codereview.chromium.org/886683002
2015-01-28 21:48:28 -08:00
Rafael Weinstein 931f29c80e Fix city-list example after changes to scrolling.
Note that this patch only includes support for the wheel event.
I'll follow-up with a patch for scrolling/fling when I have a setup
on which I can verify that working.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/875473004
2015-01-28 16:56:25 -08:00
Eric Seidel cfd21dfd13 Add a very basic deploy script for mojo.
We could do something much more sophisticated for deploy in the future.

Also add #!mojo:sky_viewer to .sky file demos

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/885653006
2015-01-28 11:00:52 -08:00
Adam Barth 00842383fd Remove more scrolling code from Sky
None of this code does anything anymore.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/878303002
2015-01-27 15:20:14 -08:00
Adam Barth 46334e2e32 Add wheel support to sky-scrollable
This CL plumbs wheel events through Sky again and uses them in sky-scrollable.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/876853005
2015-01-27 09:58:22 -08:00
Colin Blundell 73f0a8d121 Revert "Add a close box to flights-app toast."
This reverts commit ffcbc3b2f5417b09328eae4aeb8de2e5eab6324d.

This test broke sky_tests:

Regressions: Unexpected text-only failures (6)
  framework/flights-app.sky [ Failure ]

Example:

http://build.chromium.org/p/client.mojo/builders/Mojo%20Linux%20ASan%20%28dbg%29/builds/173/steps/Sky%20tests/logs/stdio

TBR=ojan

Review URL: https://codereview.chromium.org/880863002
2015-01-27 10:11:41 +01:00
Ojan Vafai 55b9f393c1 Add a close box to flights-app toast.
This is to get a case of having an outline on an
absolutely positioned, overflow:hidden, i.e. a
self-painting layer.

TBR=esprehn@chromium.org

Review URL: https://codereview.chromium.org/878873002
2015-01-26 22:54:39 -08:00
Ojan Vafai 09ffab7233 Fix border painting on self-painting layers.
Commit efc3afd428bd85fd3d12e0dc941b5eb7248ca30b broke it because
we'd computed an empty foreground layer. Now that background
painting is part of the foreground phase, we need to use the
background rect for clipping. As best I can tell, the
background rect is always >= the size of the foreground
rect, so it should be safe to use.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/876243002
2015-01-26 22:45:30 -08:00
Ojan Vafai 609cf2e8d9 Add a gratuitous outline to flights-app.
This is so we have minimal coverage of outline painting.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/878803002
2015-01-26 16:40:40 -08:00
Adam Barth 435b203406 Add a basic sky-scrollable element that scrolls
We still need to polish sky-scrollable, but it basically works.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/875953004
2015-01-26 13:29:38 -08:00
Elliott Sprehn 66e6949f46 module.exports should default to an empty object.
Per the spec in modules.md the exports property should default to an
empty object. We lazy allocate it so that modules that just replace it
don't create the empty object and then throw it away.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/872043003
2015-01-26 11:38:04 -08:00
Adam Barth 8260024b38 Move city-list data into a separate module
This way other scrolling demos can share the data.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/876763002
2015-01-26 09:41:25 -08:00
Adam Barth 451778fdce Move sky-box,-button,-checkbox,-radio out of their directories
Instead of having a separate directory for every Sky element, we should just
put them in the general framework directory. Once the framework is more
complicated, we'll probably want to organize it a bit better, but for now there
aren't enough files to justify having so many directories.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/874303003
2015-01-26 09:20:25 -08:00
Elliott Sprehn d439820922 Add the <t> element and ignore whitespace outside it.
We now only preserve the whitespace inside a <t> element inside
the parser. This removes the known n^2 from reattaching whitespace
which should make parsing and appending nodes faster. I also
removed the dead WhitespaceMode code from the parser, and made
the dom-seralizer.sky auto indent the markup so the test output
would be readable.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/867963006
2015-01-23 16:50:00 -08:00
Adam Barth 106c532257 Remove touch events from Sky
We use pointer events instead.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/868133003
2015-01-23 12:41:56 -08:00
Elliott Sprehn 0b73de95da Don't set expression attributes before they're bound.
We were cloning elements with all the attributes that contained
expressions like attrName="{{ foo }}" which meant we'd go through the
reflection process converting that value and also call the
attrNameChanged() callback and the attributeChanged() with the braced
string which the element didn't really want to know about.

After this patch we create a "clone source node" which is a copy of the
original element without the attributes that have the expressions and
use that when cloning, then we assign the properties using data binding
later.

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

Review URL: https://codereview.chromium.org/868973002
2015-01-22 17:04:10 -08:00
Adam Barth fbc45545df Change background-repeat default to no-repeat
Previously, if you had a generated background image and a translucent (or
rounded) border, we would draw the image nine times because we would inflate
the fill rect to draw behind the border. With no-repeat, we only draw the image
once.

This saves 4.5% of record time on flights-app.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/844193009
2015-01-21 16:42:26 -08:00
Elliott Sprehn 8c9486fc71 Reuse the DOM in the <fps-counter>.
Instead of storing primitive values which makes the data
binding system throw away DOM each time we update each slot
lets just use objects and shift + pop. This means very little
data binding churn.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/802153004
2015-01-15 22:02:35 -08:00
Elliott Sprehn 42a7db75ec Turn on harmony arrays and regexp.
adamk@ says these are pretty stable.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/845403009
2015-01-15 17:12:17 -08:00
Elliott Sprehn b9aac0ada7 Add two way data binding.
All reflected attributes two way bind on SkyElement, so now doing
<sky-element name="sky-input" attributes="value:string"> is enough
to get two way binding on the value attribute so users doing
<sky-input value="{{ inputValue }}"> will get the inputValue property
updated as the user types.

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

Review URL: https://codereview.chromium.org/850383002
2015-01-15 15:03:44 -08:00
Adam Barth ed73bbb5ee Fix fips-counter in touch-demo.sky
TBR=ojan@chromium.org

Review URL: https://codereview.chromium.org/813133010
2015-01-15 11:11:38 -08:00
Adam Barth f3d9715455 Add a fps-counter widget to some Sky demos
This CL makes some Sky demos more interesting and adds an fps-widget to see how
fast they run.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/803283006
2015-01-14 15:50:59 -08:00
Adam Barth c57eec3baa Remove outdated hack from flights-app
We don't need this hack anymore.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/853593002
2015-01-13 16:41:20 -08:00
Hixie 7598f1fd3c Examples: move markAsLaidOut() to just before the return, so the asserts work
Specs: introduce layoutDescendants() to avoid work when a layout
manager is unaffected by its childrens' intrinsic dimensions
Examples: update for layoutDescendants() change
Specs: add "lifetime" to resolver settings so that a transition can
avoid having to dirty every consumer of the property every frame when
it only needs to update the objects that are changing that frame
Specs: expose the parents on AbstractStyleDeclarationList subclasses
Specs: fix documentation around autoreap
Specs: fix definition of setProperty()
Specs: clean up the dimension-related logic of layout managers

Review URL: https://codereview.chromium.org/850593003
2015-01-13 11:25:24 -08:00
Adam Barth 6646821d57 Add support for touch events to sky_viewer
This CL adds conversion routines for touch events to sky_viewer so that Mojo
touch events actually show up in the platform.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/847873003
2015-01-12 15:18:16 -08:00
Hixie fcec023701 Specs and Docs: minor updates to fix mistakes I found when proof-reading
Review URL: https://codereview.chromium.org/845053002
2015-01-09 13:46:58 -08:00
Elliott Sprehn 4002105ad9 console.error when using unknown attributes in templates.
Log an error whenever an element has an unknown attribute in a template.
This means you can't use generic attributes like Polymer, but we
probably want to discourage that anyway since attribute selectors should
be avoided for most things.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/845523004
2015-01-08 16:52:12 -08:00
Adam Barth d58e6de7b2 Add the #!mojo to spinning-square.sky
TBR=jamesr@chromium.org

Review URL: https://codereview.chromium.org/840133002
2015-01-08 16:47:32 -08:00
Elliott Sprehn dfba1a80ac Prevent expandos on all SkyElements.
Expandos make v8 sad, lets not allow them.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/835353004
2015-01-08 15:30:18 -08:00
Adam Barth 8ac50c62ca Implement <sky-input>
This CL contains a basic input element.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/831353003
2015-01-08 13:22:00 -08:00
Scott Violet ed3cbb541e Changes magic sequence to '!#mojo ' and strips 'mojo ' when building url
Prior to this change the magic sequence was '#!mojo:' and the url of the content handler app included mojo:. This works only for mojo: urls, but we want
other schemes. So, the magic sequence is now '#!mojo ' and 'mojo ' is not part of the resulting url.

R=aa@chromium.org

Review URL: https://codereview.chromium.org/821403003
2015-01-08 10:19:52 -08:00
Hixie 79a529c6d9 Specs: custom element constructor argument shouldn't clash with the module-global 'module' identifier
Review URL: https://codereview.chromium.org/829133003
2015-01-07 14:39:58 -08:00
Eric Seidel f8cce94873 Fix home.sky's #! to modern style
TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/844443004
2015-01-06 17:05:30 -08:00
Hixie 9d70f573e4 Specs: registerElement(registerElement(...)) failed to work as expected
Review URL: https://codereview.chromium.org/836153005
2015-01-06 13:23:04 -08:00
Elliott Sprehn 00f2a53738 Improve the appearance of <sky-checkbox>
The unicode char never showed up for me, lets do what polymer does for
now.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/836723006
2015-01-05 14:28:16 -08:00
Elliott Sprehn e1e7110716 Add declarataive event handlers.
Now inside the <template> of a SkyElement you can use
on-eventName="method" on any element to add event listeners.

For example you can write <sky-button on-click="handleClick">
and then define handleClick(event) on the element class that
contains the button.

In adding this and tests I also realized that property bindings
were not setup on the initial call to bind(), which is now
fixed in this patch (See change to Node.prototype.bind).

R=eseidel@google.com, rafaelw@chromium.org

Review URL: https://codereview.chromium.org/812713005
2014-12-19 13:10:16 -08:00
Elliott Sprehn ea93d43e64 Fix widgets demo.
It was missing the as attribute for the SkyElement import.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/789703007
2014-12-18 13:32:35 -08:00
Eric Seidel be756e7329 Add super-basic sky widgets.
Eventually we'll want to replace these with something
fancier like polymer, but this exercise helped us
find several bugs in the engine as well as
removed one more blocker from using Sky to
replace mojo/views usage in mojo/examples.

R=esprehn@chromium.org
BUG=443439

Review URL: https://codereview.chromium.org/809233002
2014-12-18 13:01:43 -08:00
Elliott Sprehn 5f6c32c247 Make SkyElement more classy.
The syntax for implementing a SkyElement is now:

<sky-element name="element-name">
<template>
  <!-- template here -->
</template>
<script>
module.exports = class extends SkyElement {
  attached() {
     // ...
  }
  // .. methods here ..
}.register();
</script>
</sky-element>

The register() static method on SkyElement subclasses calls
document.registerElement() and returns the generated constructor.
It uses the parent <sky-element>'s name attribute to set the name
of the element.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/788943003
2014-12-16 16:28:28 -08:00
Rafael Weinstein 8cd1801dc7 Fix Animations, Remove Compostior Animations.
This patch (re)hooks up animations so they start and removes the infrastructure required by blink to synchronize the compositor and main threads.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/772673002
2014-12-02 14:37:55 -08:00
Rafael Weinstein 76ef4db5e4 fix the fix to city-list example autoscroll
TBR=esprehn

Review URL: https://codereview.chromium.org/760403002
2014-11-27 12:44:24 -08:00
Rafael Weinstein 034e19300d Fix bug in city-list autoscroll
TBR=esprehn

Review URL: https://codereview.chromium.org/759483003
2014-11-24 18:27:49 -08:00
Rafael Weinstein a0df465d10 Add auto-scroll option to sky city-list example
TBR=esprehn

Review URL: https://codereview.chromium.org/758753003
2014-11-24 16:15:19 -08:00
Adam Barth 7da267c48b Add a basic example of a spinning square
This example will let us test basic animation performance.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/748853004
2014-11-21 13:27:09 -08:00
Hixie 173b73535b Docs: fix the hitTest() logic for display:toolbar since it doesn't use size 0x0 for its hidden children
Review URL: https://codereview.chromium.org/741313002
2014-11-20 15:50:43 -08:00
Hixie eedc2410f2 Specs: Simplify the paint model. Now you are not responsible for
actually telling your child to paint, you just say where it would
paint. The platform then takes care of making sure all the dirty nodes
have their paint() methods called.

Review URL: https://codereview.chromium.org/744843003
2014-11-20 15:30:30 -08:00
Hixie edcbad7686 Specs: update the layout and paint schemes to match discussions better
Review URL: https://codereview.chromium.org/745863002
2014-11-20 13:58:53 -08:00
Ojan Vafai 85817b24a0 First step at getting rid of anonymous blocks and continuations.
-Add RenderParagraph and display:paragraph. This is the only
render type that's allowed to contain inlines or text.
-If you put text nodes directly in a non-paragraph, wrap them
in an anonymous paragraph. This may not be the place we want
to end up, but it's a good stopgap to make it so we don't
crash in this case.
-Make StyleAdjuster force that non-paragraph blocks only contain
RenderBlock subclasses and that paragraphs and inlines only contain
inlines.
-Considerably simplify addChildIgnoringAnonymousColumnBlocks
now that we only create anonymous blocks for the case of
text nodes in non-paragraphs. Also get rid of the behavior
where we try to group multiple nodes into a single
anonymous block.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/729693003
2014-11-17 18:39:52 -08:00
Hixie 2556b66620 Specs: Define when needsLayout is reset (also, some unrelated markdown fixes)
Review URL: https://codereview.chromium.org/732243002
2014-11-17 15:43:31 -08:00
Rafael Weinstein 1496dcfafa Fix bad reference in city-list
TBR=esprehn
BUG=

Review URL: https://codereview.chromium.org/730283002
2014-11-17 14:57:15 -08:00
Hixie fd1e8ff53d Specs: Fix markdown errors
Review URL: https://codereview.chromium.org/730273002
2014-11-17 14:54:01 -08:00
Hixie 30ba272a0a Docs: copy/pasta left a type annotation from the IDLs in an example
Review URL: https://codereview.chromium.org/732163003
2014-11-17 14:24:33 -08:00
Hixie 8d2b5c3b1d Specs: make sure all layout/paint/hitTest APIs are relative to the right coordinate space
Review URL: https://codereview.chromium.org/725203007
2014-11-17 13:55:45 -08:00
Hixie 1316326183 Docs: duplicate ID in example
Review URL: https://codereview.chromium.org/735533002
2014-11-17 13:41:41 -08:00
Hixie 48b49a8cbe Specs: default exports to {} rather than document, since it makes writing modules saner
Review URL: https://codereview.chromium.org/730223002
2014-11-17 13:08:09 -08:00
Elliott Sprehn fe9b9d21d4 Add a version of flights that's made of components.
Also add a test, this checks nested Shadow DOM and <content> with
and without select.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/725763003
2014-11-14 15:00:12 -08:00
Hixie 3d06e2a4e7 Specs: hit testing (and some cleanup)
Review URL: https://codereview.chromium.org/727993002
2014-11-14 14:35:55 -08:00
Hixie f8340b77ef Specs: Initial hack at extensible style/layout
Review URL: https://codereview.chromium.org/716013002
2014-11-13 14:00:46 -08:00
Benjamin Lerman af585507a0 Revert "Add a version of flights that's made of components."
This reverts commit e8fdb90bca3120d1c991256a2adf83a8315bf867.

This CL breaks the linux bots:
https://chromegw.corp.google.com/i/client.mojo/builders/Mojo%20Linux/builds/216/steps/mojob%20test/logs/stdio

TBR=esprehn@chromium.org

Review URL: https://codereview.chromium.org/722103002
2014-11-13 09:59:26 +01:00
Elliott Sprehn a1d1c3e4fb Add a version of flights that's made of components.
Also add a test, this checks nested Shadow DOM and <content> with
and without select.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/724613002
2014-11-12 18:42:24 -08:00
Elliott Sprehn f9a8fd51ee Add the flights app scaffolding demo.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/720593002
2014-11-11 16:37:04 -08:00
Rafael Weinstein 4fd0160716 Add city-list example tests to sky
BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/708633002
2014-11-05 17:58:57 -08:00
Hixie f1f2a12b97 Docs: Experimental 'button' widget, work in progress
Review URL: https://codereview.chromium.org/700023003
2014-11-04 17:27:58 -08:00
Rafael Weinstein 018e6ba3bb fix file-browser
R=eseidel@chromium.org, abarth
BUG=

Review URL: https://codereview.chromium.org/705683002
2014-11-04 15:21:57 -08:00
Hixie 842d46667a Docs: We renamed appendChild to append, so update this example which still uses the old name.
Review URL: https://codereview.chromium.org/685063006
2014-11-04 14:15:40 -08:00
Hixie 1da15583c5 Docs: add an example that uses the current APIs to define an <element>
element; an example that uses that example to define some HTMLy
elements; and an example to use those HTMLy elements to display a
hello world doc. Highly incomplete WIP.

Review URL: https://codereview.chromium.org/698293003
2014-11-04 13:32:07 -08:00
Hixie 61f4494e25 Specs: define registerElement() a little differently, so that the code
that uses it looks nicer; this moves the complexity to places that
register elements without using 'class' (e.g. the internals of
frameworks that create elements for defining elements)

Review URL: https://codereview.chromium.org/699083005
2014-11-04 12:16:49 -08:00
Hixie 01f3d8fa67 Specs: define registerElement() more carefully; add an 'end tag
parsed' callback; pass the element's module to the constructor when
constructing a custom element (these are rather experimental changes
and we may want to go a different way on this stuff)

Review URL: https://codereview.chromium.org/701873004
2014-11-04 11:57:02 -08:00
Adam Barth 44ac35308c Don't GC message pipes that have an in-flight request
In mojom, there's a notion of a request/response pair. This CL teaches the JS
bindings not to GC a message pipe after a request has been issued but before
the response has been received.

R=hansmuller@chromium.org

Review URL: https://codereview.chromium.org/696373003
2014-11-03 19:05:48 -08:00
Hixie 1befcbfe67 Specs: Drop the concept of late-bound elements. An element can never be upgraded.
This has the following implications:

 - There's no createElement() function any more. If you want to create
   an element from script, you have to use its constructor.

 - There's no async element registration. The parser will block until
   all the imports are imported when you use a tag name of a custom
   element that hasn't been registered yet, in case one of the imports
   defines it.

 - If you try to construct a non-registered element in markup, it
   turns into an <error> element.

 - <div>, <span>, and <error> are new built-in elements.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/695423004
2014-11-03 16:52:47 -08:00
Adam Barth 386a980a85 Convert the directory listing to run on top of the platform
Previously we were using string concatenation to build up the directory
listing. Now we fetch some JSON from the server and use data binding to inflate
a directory listing.

This exmaple doesn't work yet because we're missing support for
template@repeat, but hopefully we'll get that soon.

Also, added support for setRequestHeader to XMLHttpRequest.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/688413005
2014-11-03 12:53:38 -08:00
Adam Barth ca52266ce8 Replace <link rel="import"> with <import>
This CL is just a search-and-replace.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/694423002
2014-11-03 12:34:57 -08:00
Hixie 956d7b3efc Specs: make element registrations be per-module, define how they are
exported and reexported, rename 'interface' to 'class' in the IDL, add
constructors to all registered elements

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/695043002
2014-10-31 16:18:46 -07:00
Rafael Weinstein fe0d6c747f Add initial SkyElement & city-list example
BUG=
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/698653002
2014-10-31 12:29:42 -07:00
Hixie bcb841290f Specs: Simplify the platform by only having one shadow tree per element.
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/694613002
2014-10-31 10:16:37 -07:00
Hixie 4f47cb9215 Docs: call superclass constructors in radio.sky example
Review URL: https://codereview.chromium.org/689763003
2014-10-29 13:45:20 -07:00
Hixie 5482eece0f Docs: Update radio.sky to use the specced API for shadow roots
Review URL: https://codereview.chromium.org/692563003
2014-10-29 13:10:33 -07:00
Hixie 3f008050a2 Enter a description of the change.
Docs: Fix the script in the example to actually clone the template contents, not the template element itself.

Review URL: https://codereview.chromium.org/680673002
2014-10-24 16:23:03 -07:00
Eric Seidel 86cd8beee7 Make skydb load examples/home.sky by default.
I had to also register for the text/plain mime-type
which turned out to be harder than expected.
Mostly due to my confusion with mojo_shell
using last-argument-wins argument parsing.

R=ianh@google.com

Review URL: https://codereview.chromium.org/672363002
2014-10-23 14:56:44 -07:00
Hixie 928524947a Placeholder Sky start page.
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/677513002
2014-10-23 13:42:24 -07:00
Adam Barth 00882d626a Open the Sky 2014-10-23 11:17:19 -07:00