37534 Commits

Author SHA1 Message Date
Adam Barth
64409f370b ParentNode#appendChild(null) shouldn't crash
We just needed to throw the proper exception when handed null for a
non-nullable argument.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/934863002
2015-02-17 10:15:27 -08:00
Przemyslaw Pietrzkiewicz
261d740312 Switch skydb to services/http_server.
This patch makes the skydb debugger use the Mojo http_server app instead
of the /net http_server.

BUG=456128
R=eseidel@chromium.org, qsr@chromium.org

Review URL: https://codereview.chromium.org/930903002
2015-02-17 17:10:24 +01:00
Adam Barth
051352eec3 Morph the APIs for Node, ParentNode, and Element closer to the specs
These still don't match the specs exactly, but they're much closer.

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

Review URL: https://codereview.chromium.org/924203002
2015-02-13 21:36:53 -08:00
Ojan Vafai
3912ca81ab Get rid of HitTestChildBlockBackground walk.
I'm not 100% what this was for, but looking at Blink,
it appears that HitTestChildBlockBackground being different
from HitTestBlockBackground had something to do with
multi-column/regions, which we don't have. I believe
this patch doesn't change any behavior.

Also added to the elementFromPoint test in order to
get more test coverage of the hitTesting code.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/924263002
2015-02-13 21:05:58 -08:00
Adam Barth
e240568540 Port all of Sky's editing tests to Dart
R=eseidel@chromium.org, ojan@chromium.org

Review URL: https://codereview.chromium.org/921123002
2015-02-13 13:54:49 -08:00
Adam Barth
2a44491945 Make sky/tests/services/event-sender.sky pass
This CL ports sky/framework/shell.sky to Dart and makes event-sender.sky. I've
also removed a number of not-that-interesting tests for the JS Mojo bindings.

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

Review URL: https://codereview.chromium.org/922123002
2015-02-13 13:52:08 -08:00
Adam Barth
d7ee97cc3d Delete Sky tests that we're not going to run with Dart
This CL removes a number of tests that we don't plan to port to Dart:

1) custom-elements. We're going to use a different mechanism for custom
   elements. We'll need to write a new set of tests as we implement it.
2) inspector. These are tests of the JS inspector backend, which we don't
   plan to use.
3) js. This is a test of a JavaScript feature.
4) mocha. These are tests of the JavaScript testing framework we were using.
5) mutation-observer. We're keeping the C++ code for mutation observers, but
   it's unclear how we want to expose this in the platform.
6) resources. These are JavaScript-based testing frameworks.

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

Review URL: https://codereview.chromium.org/920343002
2015-02-13 13:51:26 -08:00
Przemyslaw Pietrzkiewicz
fb3af8b4c2 Drop weak_ptr_factory in SkyDebugger.
It seems not to be used for anything.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/921633006
2015-02-13 18:24:15 +01:00
Adam Barth
e1b8c6890c 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
7e572d0622 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
Adam Barth
e66af1376c skydb shouldn't use origin on Linux
Unfortunately, using --origin on Linux is slow and too painful to use at the
moment. We should work on fixing that, but currently many of us have this in
our local working copy anyway.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/922823002
2015-02-12 13:37:50 -08:00
Hans Muller
8716bf6a98 Adds support for embedViewManagerClient() to IFrame.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/912183002
2015-02-10 17:09:22 -08:00
James Robinson
86ae400a55 Update from https://crrev.com/315085
This includes the switch to libc++ on Android.

Other fixes:

*) Add (dumb) impl of OrderingBarrier() to command buffer
*) "base/debug/trace_event.h" -> "base/trace_event/trace_event.h"
*) Added a few <cmath> includes to sky

Review URL: https://codereview.chromium.org/903273002
2015-02-06 15:14:04 -08:00
Adam Barth
9ebbab290b Plumb resize notifications around sky/shell
This CL plumbs resize notifications from SkyView to Engine. I've taken the
opportunity to reorganize how notifications generated by SkyView are plumbed to
the GPU and UI threads. This approach should reduce the amount of plumbing
needed for new notifications.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/880443003
2015-02-05 20:08:22 -08:00
Ojan Vafai
c30847eb9d Add opacity to the layers.sky test.
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/883903003
2015-02-06 14:27:24 +11:00
Adam Barth
ca428592e7 sky/shell should link with sky/engine
This CL causes sky/shell to create a blink::WebView to show that sky/shell
links with sky/engine. In the process, I've made it easier to be a trivial
embedder of sky/engine by removing the requirement to implement
blink::ServiceProvider.

This CL also causes sky/shell to link with mojo/edk/system to resolve link
errors with Mojo fabric (e.g., MojoClose, MojoWriteMessage, etc). To make this
work properly, we'll need to initialize the EDK in a future CL.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/873923003
2015-02-04 19:31:17 -08:00
Ojan Vafai
6684a93c42 Add some basic test coverage for layers.
Add a basic pixel test for z-index, transforms and clip-path.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/884503003
2015-02-04 13:55:20 +11:00
James Robinson
c45dfa0e8d De-client tracing.TraceController interface
The tracing service logically provides one service, TraceCoordinator, which can
start and stop tracing sessions. It also can connect to any number of
TraceControllers each of which can supply tracing information on demand.

Whenever an app connects to the tracing service, the tracing service attempts to
connect to that app's TraceController interface. If the app provides this
interface then tracing data will be requested whenever tracing starts. If the
app doesn't, then the pipe just closes. Thus apps that want to be traced can do
so by creating however many connections to the tracing service they want and
registering a TraceController implementation on each outgoing connection.

The shell connects in a similar fashion by connecting to the tracing service and
providing a TraceController implementation. The code looks a bit different since
the shell is special.

BUG=451319
R=viettrungluu@chromium.org

Review URL: https://codereview.chromium.org/791493006
2015-02-02 16:56:34 -08:00
Adam Barth
01245cc95b Teach SkyShell how to draw with Ganesh
This CL adds support to SkyShell for drawing with Ganesh. Currently, we don't
actually create any SkPictures to draw, but that will come in a later CL.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/891143002
2015-02-01 00:39:36 -08:00
Adam Barth
016e5c4531 SkyShell should be able to draw a green square with GL
This CL teaches SkyShell how to initialize GL and draw a green square.

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

Review URL: https://codereview.chromium.org/890803004
2015-01-31 00:44:42 -08:00
James Robinson
8480c34bbe De-Client Surface interface
mojo.Surface's client had two methods:

*) SetIdNamespace replaced by mojo.Surface.GetIdNamespace which returns
the id namespace via a callback.

*) ReturnResources split into a ResourceReturner interface which can be
(optionally) set on the mojo.Surface via
mojo.Surface.SetResourceReturner

Also beefed up the comments a bit.

BUG=451319
R=sky@chromium.org

Review URL: https://codereview.chromium.org/871373015
2015-01-30 17:44:43 -08:00
Adam Barth
45f711fe05 Add a standalone SkyShell.apk for testing
This CL adds a SkyShell.apk, which will become a direct embedding of Sky on
Android that will let us run performance tests on the Sky engine in a
self-contained environment on a real device.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/893643002
2015-01-30 14:05:57 -08:00
James Robinson
d0a6e53dad Remove mojo.SurfacesService interface in favor of mojo.Surface directly
Most of the callers have been updated to the new flow already. This
updates the rest and removes the deprecated interface to simplify the
flows in preparation for de-Clienting this interface.

Chromium caller updated to not use this interface here:
https://codereview.chromium.org/869343004/

R=sky@chromium.org
BUG=451319

Review URL: https://codereview.chromium.org/882083003
2015-01-30 13:02:48 -08:00
Eric Seidel
c5416c52ce Replace usage of md5 with sha256 for generation of mojo app ids.
Before we start adding more uses of mojo app ids we should use
to a non-broken hash function. :)

What was holding me back before was I wasn't aware of us having an
incremental hash api other than base/md5.h (others in base only operate
on the full input data), however it turns out that the crypto/ library
has one in crypto/secure_hash.h.

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/868253006
2015-01-29 12:59:48 -08:00
Eric Seidel
084737b0fb Rename SkyDebugger to KioskWM and move to /services
Already other applications use sky's simple window
manager (mojo:sky_debugger) as a full-screen window
manager.  This moves this to /services and removes
all sky references from it.

As a part of this I've removed inspector support
from skydb.  It was already broken and will need
to be re-thought to not involve calls into
this new window manager.

I'm also flipping the relationship between prompt.cc
and debugger.cc for skydb.  Skydb will tell mojo_shell
to start sky_debugger_prompt instead of sky_debugger.

I'm also renaming sky_debugger_prompt to be
sky_debugger.

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/883983004
2015-01-29 11:25:58 -08:00
Adam Barth
9c71fa140b 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
433ab2ab85 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
Adam Barth
763893ce7e Make skydb --gdb work a bit better on Android
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/878163005
2015-01-28 15:30:31 -08:00
Eric Seidel
a715b93255 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
Tony Gentilcore
043b30cdda Set execute permissions on sky_server after download.
BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/886543004
2015-01-28 10:26:06 -08:00
Ojan Vafai
5dd395d81d Merge outline paint phases into the foreground phase.
Mostly just mechanical changes. The one surprising bit
is that RenderLayer no longer needs to explictly paint
outlines. I tested manually that before this patch,
the paintOutline call in RenderLayer was needed for
outlines on positioned elements and that after this
patch it's not.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/878023002
2015-01-27 17:45:04 -08:00
Adam Barth
9582236903 Normalize import paths for Sky modules
This CL simplifies the sky_server to only map the build directory into /gen,
which will make the deploy script simpler. This CL updates all the imports to
use the /gen prefix when referring to generated files.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/881093003
2015-01-27 17:04:40 -08:00
Eric Seidel
8c02bac6a8 Remove skydb dependency on build/android/pylib
I also fixed skydb to use --args-for sky_debugger to
automatically issue the load from 'start' even when
the --gdb option is present.

I tried to invoke gdb_attach directly from within start_command
but that seemed to cause some strangeness with my zsh shell
where it would automatically suspend gdb.  So I'll revisit
that change in the next patch.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/880143002
2015-01-27 15:56:23 -08:00
Adam Barth
72233afa6c 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
9be3b5193a Merge pull request #26 from domenic/patch-1
Don't create redundant promises
2015-01-27 14:40:59 -08:00
Adam Barth
762ae4563e Split skydb trace into start_tracing and stop_tracing
Now stop_tracing writes the response to a file instead of spamming the trace data to stdout.

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

Review URL: https://codereview.chromium.org/878283002
2015-01-27 13:58:29 -08:00
Domenic Denicola
17575faefd Don't create redundant promises
Just use promise chaining
2015-01-27 15:43:56 -05:00
Adam Barth
211ffcb881 Make it possible to navigate <iframes>
Also, add support for exposing services to <iframes>. This worked before but
now that [Client=...] is gone we need to create another message pipe.

R=sky@chromium.org

Review URL: https://codereview.chromium.org/882723003
2015-01-27 10:35:52 -08:00
Adam Barth
4de104b325 Rebaseline tests after removing RenderLayerScrollableArea 2015-01-27 10:25:45 -08:00
Adam Barth
23294c892d 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
eee6b2af78 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
0467502886 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
0bbf271f11 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
James Robinson
2ff9d2d006 Remove Client relationship between mojo.Shell/mojo.Application
Instead of mojo.Shell and mojo.Application being clients of each other
they are now separate interfaces. An implementation of mojo.Application
receives a handle to the shell in its Initialize call, as described in
this doc:

https://docs.google.com/document/d/1xjt_TPjTu0elix8fNdBgWmnjJdJAtqSr1XDS_C-Ct8E/edit?usp=sharing

An analogous change is made to the content handler definition.

In C++, this is handled by the mojo::ApplicationImpl class which stores
shell handle in its implementation of Initialize. Thus the only change
for most C++ applications is the meaning of the handle in MojoMain is
different, although mains that use the ApplicationRunners do the same
thing with it.  Connecting to other apps is largely the same although
instead of grabbing the ApplicationImpl's client() to talk to the shell
code must now use the ApplicationImpl::shell() getter.

In JavaScript, the initialization sequence is a bit different although
this is hidden mostly in the Application class which calls initialize()
on its subclass with the same set of parameters. Connecting to another
application looks different, especially for sky code using the shell
proxy handle exposed via internals. Hans has some ideas about how to
make this a bit nicer.

Python apps similarly need to change their startup sequence a bit. I
didn't find a common library to take care of this dance, although it's
possible I just missed it.

Other languages probably a bit of reworking - I fixed everything here
that is covered by mojob.py test but some might be missing.

This patch also uses typed handles (i.e. InterfacePtr<> or
InterfaceRequest<> or their type aliases) wherever possible instead of
ScopedMessagePipeHandle for clarity.

R=davemoore@chromium.org

Review URL: https://codereview.chromium.org/868463008
2015-01-26 17:53:08 -08:00
Ojan Vafai
df4b5c5e55 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
Elliott Sprehn
69fb511131 Replace createTextNode with new Text().
Sky doesn't have this method (per spec).

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/879733002
2015-01-26 15:12:19 -08:00
Adam Barth
150ee5f775 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
Eric Seidel
590f35b842 Make it possible to pass a default url to sky_debugger
sky_debugger will load the default url in every view that it's
asked to embed.  Think of the default_url as being like the
home-page in a conventional browser.

I also fixed prompt.cc to not terminate the entire mojo
environment when it can't start itself, but rather just
quit its own application.

With this patch I'm able to hack up mojo_shell to be able
to have a sensible default behavior when clicked from
the Android homescreen, but I'll land those hacks in a
separate change.

TBR=abarth@chromium.org
BUG=451620

Review URL: https://codereview.chromium.org/875183002
2015-01-26 13:19:06 -08:00
Elliott Sprehn
2808cfa418 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
966b475029 Switch KeyboardEvents over to NewEventHandler
This CL moves KeyboardEvents from the old event model to NewEventHandler. This
CL keeps the basic structure of keydown, keypress, keyup events even though
that's a bit wacky. As with pointer and gesture events, this CL removes
PlatformKeyboardEvent in favor of just using WebKeyboardEvent. I've also made
WebKeyboardEvent align more closely with Mojo's keyboard event.

The CL does change one important aspect of key event handling: on the web the
"keyCode" property of KeyboardEvent changes its meaning depending on whether
the event is a keydown or a keypress event. For the former events, keyCode is
the "virtual" (i.e., windows) key code where for the latter events, keyCode is
the character code. To be more precise, I've renamed keyCode to virtualKeyCode
and I've given it a zero (unknown key code) value during keypress events.

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

Review URL: https://codereview.chromium.org/872233002
2015-01-25 22:46:50 -08:00