Commit graph

237 commits

Author SHA1 Message Date
Adam Barth 83805e2a9e Plumb input events into SkyView
Clients can now register a callback that gets called whenever we have an event
for the view. We'll need to update the Event class at some point, but this is a
start.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1129333005
2015-05-19 16:50:28 -07:00
Hixie 9523283bb4 [Effen] Rename Action Bar to Tool Bar.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1133353008
2015-05-19 15:52:12 -07:00
Adam Barth 17040ff355 Plumb display metrics into SkyView
This CL teaches SkyView the width, height, and device pixel ratio of the
display. In the future, we'll want some sort of notification system for when
these values change.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1139823010
2015-05-19 14:54:08 -07:00
Adam Barth 0b18d56d5a Teach SkyView path to draw a circle
This CL adds a global view object that can receive a Picture and be signaled to
draw. When using SkyView, this Picture shows up on screen.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1134913003
2015-05-19 14:20:04 -07:00
John McCutchan 5fd9d77387 Fix domokit.github.io site deployment script
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1145843002
2015-05-19 14:03:13 -07:00
Adam Barth a21939bdaf Teach SkyView code path to print hello, world
This CL makes the SkyView codepath smart enough to print "hello, world" to the
console. The code path is off by default but can be enabled by changing one
line of code.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1131673011
2015-05-19 13:51:12 -07:00
Matt Perry 9dfbc4eea4 Sky: Add a CustomDart attribute to the IDL compiler, and use that with Canvas
to provide a better Dart API.

When the attribute is present on an IDL interface, the generate Dart code will be a private interface that can extended by custom dart code.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1135283005
2015-05-19 13:59:05 -04:00
John McCutchan 204298278a Suppress unnamed library analyzer spam in shelldb
Revert "Add library names to many sky libraries"

This reverts commit 1337e0a803a54ee92d6dce7f8c4a6335f7cbb9fa.

BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1142893007
2015-05-19 10:25:43 -07:00
John McCutchan 5d3bfd6108 Add library names to many sky libraries
- Analyzer complains about libraries not having names. This adds names to many libraries.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1150433002
2015-05-19 10:19:11 -07:00
Eric Seidel 293563078d Add Canvas.drawPicture
I wrote another copy of paint_element_into_displaylist
using this new technology.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1129353010
2015-05-18 15:13:15 -07:00
Eric Seidel 20459183e4 Make it possible to Paint elements into a display list.
Currently said elements need to be in the DOM and have
already been laid out for this to work, but follow-up patches
will remove these restrictions.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1144673002
2015-05-18 14:49:59 -07:00
Hixie 4c15a9688f [Layout] Put in some guards to prevent us from reintroducing 'display' properties into the CSS.
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1132983007
2015-05-15 15:16:25 -07:00
Hixie d7138735a5 [Effen] fix the stock README to be better markdown.
TBR=eseidel

Review URL: https://codereview.chromium.org/1141013003
2015-05-14 14:41:17 -07:00
Hixie 69c060a06e [Effen] Add a README.txt file that describes how to test Effen using the stock app.
Also includes a link to all the know bugs that affect the stock app.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1145523003
2015-05-14 14:34:45 -07:00
Hixie 2be9ca104b [Effen] Make the stock app use the radio button widget so that it's being tested.
Changes:
- adds a couple of radio buttons to the drawer menu list.
- makes menu items support being tapped and reporting the tap.
- hooks up the checkbox to actually support being checked.
- changes the drawer menu items to make more sense in a stock app.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1137373004
2015-05-14 13:16:35 -07:00
Hixie 156179769d [Effen] Make the drawer not be included in the build output when the drawer is not shown.
This is a prerequisite to dropping 'display:none'.
Included in this CL is making AnimatedValue able to animate more than one field.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1126333006
2015-05-14 09:44:22 -07:00
Matt Perry 769cef59ba Flesh out the Painting API a bit.
This exposes most methods from Skia's C canvas API to Dart. For now, SkRect and
SkMatrix are represented simply as an array of floats, which requires a
conversion at the bindings layer. More complex types like SkPath are still TODO.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1144483002
2015-05-13 17:17:26 -04:00
Eric Seidel a0609d1f4e Make it possible to custom-paint without an Element.
This adds a new abstract 'Canvas' which is similar to SkCanvas.
PaintContext implements Canvas while still having its
own commit() method to cause the paint actions to apply to
the Element for the next frame.
This adds a new PictureRecorder which also implements Canvas
and has an endRecording() method which returns a Picture
(another new interface) which can be held from Dart.

There is also now a rootPicture setter on Document which takes
a Picture and will then make the Document draw that Picture
until changed.

This piggybacks on the existing custom painting system
which adds the painting at background-and-borders paint
time so technically if you both set rootPicture as well as
construct a DOM you will draw the DOM on top of your picture. :)

R=mpcomplete@chromium.org

Review URL: https://codereview.chromium.org/1122423009
2015-05-13 13:16:47 -07:00
Hixie 09183a7fd1 [Effen] Use the checkbox widget in the stocks app.
- add a checkbox to the stock app, so that we're testing the checkbox widget
  (it's not currently wired up to anything, that can come later)
- make InkSplash use FlexContainer so that we can use flex in the popup menu items
- make effen's Text be more similar to Image and Container, so that it can be styled
- make layout.dart's RenderCSSText correctly support being styled
- also fixes a bug with the stock list where we were rendering one too few a row when scrolling
- check in the code to dump the DOM so I don't have to keep remembering how to do this

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1134163003
2015-05-12 14:39:43 -07:00
Eric Seidel f32b32343d Rename view-configuration to view_configuration to make analyzer happy.
Analyzer was complaining about '-' not being an allowed character
in dart file names.

R=jamesr@chromium.org
2015-05-04 14:18:19 -07:00
Eric Seidel d12f84c818 Add pubspec.yaml files for each of the examples/ directories
so that pub get will create a packages/ directory for each
and users of packages/sky/sky_tool can run these examples
from sky_sdk as the instructions say to.

TBR=ianh@google.com
https://github.com/domokit/mojo/issues/128

Review URL: https://codereview.chromium.org/1110283002
2015-04-28 16:26:38 -07:00
Hixie ab3b684f23 fix 'feeback' typo in stock app in menus
TBR=eseidel

Review URL: https://codereview.chromium.org/1065653009
2015-04-21 14:32:22 -07:00
Hixie 4398883334 [Effen] fix warnings
remove members that are never read
remove imports that are never used

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1099203002
2015-04-21 14:05:28 -07:00
Hixie ebc879babf [Effen] Prevent scrolling past the bottom of a scrollable list.
- make the ScrollBehavior instance long-lived, rather than recreating
  it each time we update the list contents.
- have OverscrollBehavior track the total height of the contents and
  the height of the scrollable region, so that it can determine when
  to stop scrolling down.
- teach OverscrollBehavior about how to determine when to stop
  scrolling down, and how to bounce when it's too far down.
- replace the 'energy' concept in Particles with a method that sets
  the energy and direction at the same time, instead of assuming that
  the direction is always positive when setting energy.
- make FixedHeightScrollable lists track the number of items in the
  list and have them update their ScrollBehavior regarding this
  information as it changes.
- track how many items are currently showing in the list stock list.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1097373002
2015-04-21 13:20:30 -07:00
Hixie 23283319bc [Effen] Only skip rows we're showing, when skipping past the rows that we've scrolled beyond in the stock list.
Currently, if you then scroll down N items with a filter set, we select which
stock to show by taking the entire list of stocks, skipping the first N, then
filtering the list, then selecting as many stocks as needed to fill the list.

So suppose the list is A, B, Cx, Dx, Ex, F, and the filter is "x", and you've
scrolled down 1 item.

Currently we'd show Cx, Dx, Ex.

Scroll down 1 again.

We still show Cx, Dx, Ex.

What we _should_ show is Dx, Ex if you've scrolled down 1, and just Ex if you've
scrolled two.

This patch fixes this. We now skip rows _after_ filtering. This fixes
the bug whereby if you set a filter then fling the list, we show the
same item over and over as if in a loop.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1057603006
2015-04-20 16:35:49 -07:00
Eric Seidel 38472e4e87 Remove Widgets Demo, it's broken and doesn't provide any value over Stocks App
R=ianh@google.com, ojan@chromium.org

Review URL: https://codereview.chromium.org/1085933002
2015-04-14 14:47:21 -07:00
Eric Seidel 72902ef85b Teach window.location.href setter to handle relative urls.
Also fixed display of text in touch-demo.sky

R=ianh@google.com

Review URL: https://codereview.chromium.org/1059743004
2015-04-14 12:16:51 -07:00
Ojan Vafai 3f0f87ca22 Stop rendering text inside flex boxes.
Text can only only inside paragraphs and inlines. This patch makes it
so we stop putting such text nodes in the render tree at all if their
parent is not a paragraph or an inline.

This is the final step in making it so that we don't create anonymous
renderers, which fixes a crash in the new custom layout code.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1077473002
2015-04-09 11:40:03 -07:00
Eric Seidel 9717a17371 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 a03a911e7c 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
Hixie fd14a1d0f2 [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
Adam Barth 362f8193ab Improve Sky READMEs
TBR=ojan@chromium.org

Review URL: https://codereview.chromium.org/1037163002
2015-03-26 17:17:34 -07:00
Adam Barth 64d53aa0fa Move terminal example from //sky/examples to //examples
We're trying to clean up the //sky/examples directory to focus on mobile use
cases for the fn framework. Terminal is both focused on desktop and uses the
older custom-element framework.

R=viettrungluu@chromium.org

Review URL: https://codereview.chromium.org/1038813005
2015-03-26 14:53:38 -07:00
Adam Barth 854f083f1b 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
Adam Barth 20a4c66ade Move fakesky.dart from examples to benchmark/resources
It's not really an example of how to use Sky. It's a resource for benchmarking.

TBR=raf@chromium.org

Review URL: https://codereview.chromium.org/1030423002
2015-03-26 14:08:10 -07:00
Adam Barth 52d8ea0c23 Remove flights example
Flights is not longer a good example of something you can build wity Sky.
Restore the flights-app-pixel test and move the assets needed for the test into
the tests directory.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1034953003
2015-03-26 13:28:23 -07:00
Adam Barth d47ecb8bc5 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 1718f196c0 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 08f2a275ad 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 0abd3c9ef3 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 e1e5d93861 Load data for StocksApp incrementally
Previously we would spend a lot of time during startup processing all 3k stocks
in the data set. This CL breaks the data up into 100 stock chunks and loads
them incrementally off the network. A future CL will switch to loading them on
demand.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1038533002
2015-03-24 14:58:42 -07:00
Viet-Trung Luu 94d55d4003 A crappy "netcat"-type example (in Dart).
It's especially crappy since it doesn't actually do much/any error
handling.

Use:
$ sky/tools/skydb start out/Debug \
  'sky/examples/terminal/index.sky?url=mojo:netcat?host=localhost%26port=80'

(Note: We don't have a resolver yet, so the host either has to be
"localhost" or an IPv4 address in the form N1.N2.N3.N4.)

R=erg@chromium.org

Review URL: https://codereview.chromium.org/1032743002
2015-03-24 13:49:13 -07:00
Viet-Trung Luu 0593b9f813 Fix the terminal example.
TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/1031933002
2015-03-24 13:00:55 -07:00
Adam Barth cf204971fb 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
Adam Barth 37bd64b209 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
Adam Barth 7818b1c0bb Make it possible to construct a Stock directly
We were missing the ability to initialize one of the fields.

TBR=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1027293003
2015-03-23 11:23:48 -07:00
Adam Barth cc1c9cb9fc 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 f15727a644 [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
Adam Barth ca74c312f7 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 f65ff7f4e5 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