37534 Commits

Author SHA1 Message Date
Ojan Vafai
893d8ae2e7 Fix crash when removing layout managers.
We weren't correctly marking an element as needing style
recalc if it was *losing* it's layout manager. We were
only doing so when it was gaining a layout manager for
the first time.

Review URL: https://codereview.chromium.org/1082273004
2015-04-14 13:57:07 -07:00
Eric Seidel
c71545ef1f Make shelldb load sky_home by default
TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1083963003
2015-04-14 12:49:22 -07:00
Hixie
50cf104e25 Fix the test broken by https://codereview.chromium.org/1078973002 by
making sure the basic.sky test exposes the right (new) DOM now that
text is always wrapped in a display:paragraph div.

BUG=85
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1083443002
2015-04-10 15:04:54 -07:00
Tony Gentilcore
5c5e867890 Disable sky/tests/framework/basic.sky due to issue #85
TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1073173002
2015-04-10 07:26:36 -07:00
James Robinson
80ea7c82c9 Generate trace header/footer in tracing consumer instead of service
Having the output of the tracing service be a list of json objects
instead of one json object makes it much easier to combine multiple
sources. This teaches skydb (which wants to format the output into a
json file loadable by trace-viewer) to emit the tracing header/footer
itself. This will make it possible to combine data from the tracing
service with data collected by the shell itself.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1065093003
2015-04-09 16:51:38 -07:00
Ojan Vafai
4289780662 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
de89bf500f Update test expectations
This test was failing because I changed the url.
The new url is correct.  Sorry for not running the tests
before committing.

https://codereview.chromium.org/1065073002/
https://github.com/domokit/mojo/issues/81
TBR=ojan@chromium.org

Review URL: https://codereview.chromium.org/1075603002
2015-04-08 12:25:07 -07:00
Tony Gentilcore
54729f7ae4 Disable sky/tests/framework/basic.sky due to issue #81
TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1063233003
2015-04-07 17:53:11 -07:00
Ojan Vafai
3948df5970 Delete RenderBlockFlow.
We only ever create RenderParagraphs now. The only non-trivial change here
is making RenderView a RenderFlexibleBox. This required changing custom.sky.
That test was written in a fragile way that behaved differently if we
did multiple layouts. Instead, having it be less racy and only change
values during the test itself.

This also throws a wrench in moving all the layout code to dart
because we can't set the layout manager on the RenderView. Maybe
we need to explicitly let you do so.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1068683002
2015-04-07 16:59:36 -07:00
Eric Seidel
7352d571d5 Fix sky_tool's calling of adb, and shelldb's analyze and stop
Just silly fixes needed for our 4 copies of our python run script.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1064983003
2015-04-07 15:15:56 -07:00
Ojan Vafai
ed5af4c741 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
James Robinson
c872ce42b3 Teach skydb about the --trace-startup flag
This flag to mojo_shell is gaining the ability to produce tracing info
starting very early in process startup. This allows the skydb 'start'
command to pass this command through to mojo_shell.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1065723003
2015-04-06 16:14:33 -07:00
Ojan Vafai
08dbc60abd Make custom layout actually work.
-Temporarily add setting override width as well so that we correctly bypass in RenderBox::computeLogicalWidth.
-Add setNeedsLayout so that the author code can force layouts (e.g. when the container's width changes).
-Have setLayoutManager force a reattach of the element if it's renderer wasn't a custom layout one before.
-Remove the laying out of children from RenderCustomLayout::layout. This is the job of the author code.
-Add a test case.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1055263002
2015-04-06 12:53:35 -07:00
Mitch Rudominer
bb8695802f Replaces |shell_handle| with |application_request| as the name of the parameter to MojoMain().
BUG=468496
R=viettrungluu@chromium.org, viettrungluu

Review URL: https://codereview.chromium.org/1058163002
2015-04-03 08:22:46 -07:00
Eric Seidel
f13976c659 Fix SkyDemo.apk on KitKat
LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS doesn't exist on K
so guard its usage.

R=jamesr@chromium.org

Review URL: https://codereview.chromium.org/1058943004
2015-04-02 14:14:38 -07:00
Hixie
7a6fd8ce40 [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
Raph Levien
c76f4113d7 Revert "Fix build: Revert "Add hyphenation to line breaking""
This reverts commit f8ed26a065cdb58adfa5df940bd2f0f6ae70d236.
2015-03-30 14:20:18 -07:00
Ed Heyl
f8ed26a065 Fix build: Revert "Add hyphenation to line breaking"
This reverts commit b038d920c433d8971b179b888220cc2a197bc227.

Change-Id: I3fed65046274d3aeb748f0730585ab89927f5741
2015-03-30 20:40:33 +00:00
Raph Levien
b038d920c4 Add hyphenation to line breaking
This patch adds hyphenation using the Liang hyphenation algorithm,
similar to TeX. It also improves the optimized line breaker so that
it works correctly and efficiently even when the line width is not
constant (there is a specialization for constant width, which is
probably worthwhile, but performance TODOs remain).

Still to be done:

* hyphenator has many shortcuts, only tested with English

* interaction between punctuation and hyphenation is problematic

Change-Id: I2d94a1668ebc536398b7c43fcf486333eeb7c6aa
2015-03-30 09:15:53 -07:00
Adam Barth
99a5e5d356 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
76a5e6184e Improve Sky READMEs
TBR=ojan@chromium.org

Review URL: https://codereview.chromium.org/1037163002
2015-03-26 17:17:34 -07:00
Raph Levien
e65751d728 Add LineBreaker to Minikin
This patch adds a LineBreaker class to Minikin, which will be used for
computing line breaks in StaticLayout. The version in this patch
contains basically the same functionality that existed before, but
hopefully better performance and an interface that's suitable for more
sophisticated paragraph layout.

Note that this version contains a high quality strategy, which mostly
works but doesn't respect varying line width.

Change-Id: I02485d58b1e52856296a72cdd4efd963bc572933
2015-03-26 16:00:04 -07:00
Adam Barth
0444ee9834 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
86a4ceb351 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
52552112ff 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
37257f17ad 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
719e795c42 Update Sky README.md
R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1030063003
2015-03-26 10:17:06 -07:00
Adam Barth
e6fca05936 Remove <canvas>
Folks should use custom paint instead (see sky/engine/core/painting for a
sketch).

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1001913003
2015-03-25 16:15:05 -07:00
Viet-Trung Luu
0e7b1ddb53 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
9cead2d61d 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
4fc0ac189a Add a --no_install option to shelldb
This CL adds an option to shelldb to skip installing the APK if the user of the
tool knows that the APK is already up-to-date on the device.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1002123003
2015-03-24 12:44:39 -07:00
Adam Barth
a606ea0f9e 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
b8f3e80284 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
55f5a4c536 Add more tracing to Sky
This CL adds trace events:

1) Between requesting a frame and begin frame.
2) In the DartLoader see network latency.
3) While executing |main| and |_init|.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1025073003
2015-03-20 16:11:39 -07:00
Rafael Weinstein
38ce45bb07 Move dom-serializer.sky to dom_serializer.dart (and clean up some analyizer errors)
TBR=abarth

Review URL: https://codereview.chromium.org/1025013003
2015-03-20 15:42:35 -07:00
Eric Seidel
abd773d7d0 Unbreak the deploy_sdk for --dev-environment
sdk_additions was already created above and thus
can't be linked here, must be copied.

TBR=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1026933002
2015-03-20 15:20:57 -07:00
Adam Barth
ff4e7ca874 Add more trace events to Sky
These will help us better understand what's happening.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1027913002
2015-03-20 15:07:24 -07:00
Eric Seidel
fd614cc08f Copy all of dart_sky.dart's supporting files into package:sky
Also bumped package:sky's version in prep for publishing.

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1024243002
2015-03-20 14:46:58 -07:00
Eric Seidel
938293d22c Make the Sky pub package include our APK and teach sky_tool to install it
I'm not sure this is the final long-term solution, but works for now.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1022193002
2015-03-20 14:35:14 -07:00
Adam Barth
b14165ea84 Enable tracing in SkyShell
This CL teaches shelldb how to trace SkyShell.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1027903002
2015-03-20 14:16:43 -07:00
Eric Seidel
91fd0ffdfd Attempt to make us not crash on KitKat.
https://github.com/domokit/mojo/issues/68

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1026873002
2015-03-20 12:45:25 -07:00
Eric Seidel
e3770bfc19 Fix deploy_sdk.py to error out if files are missing
I also now deploy sky/bin/sky as sky/lib/sky_tool since
pub run doesn't really work very well yet.

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1026863002
2015-03-20 11:21:47 -07:00
Benjamin Lerman
e3366f88a2 Fix races when the same bits are downloaded from 2 URLs.
Until now, we were saving downloaded file to the temporary directory
with a name being the hash of the file content. It means there is a race
when the same content is downloaded from 2 different URLs.

To fix this, we now create an intermediary directory that is the hash of
the URL.

Also, because this is only needed for debugging with gdb, and this is
inefficient in term of both CPU and storage (we do not know when to
delete the temporary directory), we control this with a command line
flag.

R=ncbray@chromium.org, eseidel@chromium.org
BUG=https://github.com/domokit/mojo/issues/61

Review URL: https://codereview.chromium.org/1011333003
2015-03-20 12:51:00 +01:00
Adam Barth
64dff80933 Add a basic custom painting facility to Sky
This CL adds just enough custom painting to Sky to make
sky/examples/painting/circle.sky draw a circle. Over time, we should be able to
elaborate this system into something interesting and to make it actually work
in a reasonable way.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1017593005
2015-03-19 16:00:21 -07:00
Adam Barth
1f625c9665 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
Viet-Trung Luu
1cf73be5af Make the terminal demo able (to try) to connect to anything.
(Using the query string from the URL.)

R=erg@chromium.org

Review URL: https://codereview.chromium.org/1019323002
2015-03-19 11:14:56 -07:00
Ojan Vafai
9b820a0c59 Fix hit-testing in the stocks apps when scrolled.
We were not passing the transformed HitTestLocation when we recursed
into child layers, which meant that we wouldn't take transforms
correctly into account when hit testing.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1019723002
2015-03-18 18:55:54 -07:00
Eric Seidel
32b16eca53 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
Eric Seidel
0574e849d6 Update deploy and deploy_sdk for the new package: world.
Before this change Sky would hit 404s when trying to
load examples from domokit.github.io.

I also added a separate sky_home and updated the default
url to point to sky_home instead of home.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1016143002
2015-03-18 13:00:46 -07:00
Adam Barth
d32ec33c3e 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