345 Commits

Author SHA1 Message Date
Ojan Vafai
85887b2bc3 Fix painting of position:absolute inside display: paragraphs.
We only need to walk the immediate children of the paragraph.
The other inline children of the paragraph will get paint called
on them and they will then appropriately add the self painting
layers to the array inside their paint calls.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/945223002
2015-02-20 20:24:57 -08:00
Ojan Vafai
f6bee1e2c4 Add render tree dump and pixel tests for statically placed position:absolute.
This exposes a bug that we position and size position:absolute
correctly inside paragraphs, but we fail to paint them.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/943113003
2015-02-20 18:20:23 -08:00
Adam Barth
fb186ce679 Implement Custom Elements
This CL implements custom elements. The design is as follows:

1) Authors subclass Element and call registerElement.
2) When we create C++ elements for custom elements, we call the author's
   constructor synchronously.
3) The attach/detach/attributeChanged callbacks are called either:
   a) when exiting the current custom element callback scoped (e.g., before
      returning from appendChild), or
   b) when draining the microtask queue.

The implementation in this CL is a bit fragile because we don't detect name
registration conflicts and we let you create custom elements with the same name
as built-in elements. Also, not every part of the engine is prepared to execute
script synchronously below createElement. We'll need to iron out these issues
over time, but this CL is a start.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/943013002
2015-02-20 16:15:42 -08:00
Eric Seidel
9fa8ba1cac 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
Hans Muller
db37e4280b Added Sky Mojo embedder singleton, restored network test
Currently the embedder is just an encapsulation of the Mojo shell. Exposing an ApplicationConnection that encapsulates the ViewManager Embed SPs is next.

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

Review URL: https://codereview.chromium.org/948463003
2015-02-20 15:07:29 -08:00
Ojan Vafai
914fb9ce76 Remove LayoutState.
The only bit that was still used was the
containingBlockLogicalWidthChanged check in
RenderBlock::widthAvailableToChildrenHasChanged.
a4f1e657ff
is the patch that added that code. I added a
test to confirm we still pass the test case
that code was added for.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/945003002
2015-02-20 14:02:42 -08:00
Adam Barth
08e0cb549c Update HACKING.md 2015-02-20 13:55:37 -08:00
Adam Barth
f0f55ab906 Update HACKING.md 2015-02-20 13:54:37 -08:00
Eric Seidel
19825235e7 Allow multiple dart <script> tags in .sky files
This does several things:
1.  Teaches sky about asynchronous script execution. Previously once all imports
were loaded and the script text was available, we executed a script and assumed
it completed synchronously.  We left the parser loop to do so, but that was fine
as the next chunk from the background thread would resume the parser.  In this
change scripts now load and execute separately.  The "load" step may trigger
further dart import loads which may cause the execution to happen asynchronously
which required teaching both the DartController and the HTMLScriptRunner to
take callbacks to allow HTMLDocumentParser to know to continue parsing after
the Dart script has resolved its imports and executed.

This required re-working some of how the parser executes scripts and I
re-purposed isWaitingForScripts to include "is the parser blocked" where
as before it was limited only to "does the treebuilder have a script", even
though the imports system may have had pending scripts as well.

I made HTMLScriptRunner live only as long as the script it was executing
since it only contained per-script state at this point.

2.  Fixed an error reporting bug whereby we would not show errors when "init"
failed to execute, only "main".  This required using the dart_mirrors_api.h
which required adding an include path to the core build. :(

3.  Made it possible for a single sky file to contain multiple dart <script>
tags.  Each <script> is a separate library and executes as
soon as </script> is seen.  main or init is called for each.  This required
mangling "urls" for these script blocks since Dart unique's libraries by urls.
Before this change it may have been possible to do <import 'foo.sky'> and then
<script>import 'foo.sky'</script> and have it work!?

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/938623005
2015-02-20 11:08:28 -08:00
Eric Seidel
783bdda7e5 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
3b2ed6e627 Make it possible to create reasonable subclasses of Event
After this CL, authors can create custom subclasses of Event that actually work
in a reasonable way, including being able to dispatch.

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

Review URL: https://codereview.chromium.org/938003004
2015-02-19 23:19:06 -08:00
Adam Barth
ed5c15bf34 Make it possible to inherit from any constructable host object
This CL makes it possible for authors to extend any host object (e.g., DOM
objects) and to use those objects in all the usual places they can be used in
the API.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/936193005
2015-02-19 23:09:51 -08:00
Ojan Vafai
88f6d8d333 Move hit testing out of RenderLayer into RenderBox.
Change hit testing to walk over the render tree instead of
the RenderLayer tree. This is a step in the direction of
removing the RenderLayer tree entirely.

For now, there's a few calls back into RenderLayer that
will be removed in a followup patch. This patch also
breaks hit testing on transformed inlines. I'll be
removing the ability to transform inlines in a
followup patch anyways, so it's ok for hit testing
to give the wrong result temporarily here.

Almost all of this patch is just moving code from
RenderLayer to RenderBox. The primary substantive change
is in RenderBox::hitTestLayer. Instead of having
hitTestChildren calls, we call collectSelfPaintingLayers,
reverse sort by z-index (so we start at the top),
and then iterate over the result.

The test-case also exposes that we don't correctly hit
transformed elements inside inline-blocks. I went back as
far as 4153b8a515d54275934d4244aaf2d5a7a8fe3333 and the
bug still happened.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/945693002
2015-02-19 21:31:42 -08:00
Adam Barth
c1dfaa1b4f 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
Adam Barth
cd6b52b4a3 Make element.style["color"] work in Sky
This CL makes CSSStyleDeclaration a bit less painful to use by replacing the
crazy Java-style APIs with overloading operator[] and operator[]=.

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

Review URL: https://codereview.chromium.org/942553002
2015-02-19 13:06:01 -08:00
Adam Barth
0d5dc91906 querySelectorAll should return List<Element>
... instead of NodeList.

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

Review URL: https://codereview.chromium.org/943433002
2015-02-19 09:39:59 -08:00
Etienne Membrives
27b9b24399 Update from https://crrev.com/316786
List of manually-modified files:
gpu/command_buffer/service/in_process_command_buffer.cc
examples/sample_app/BUILD.gn
examples/sample_app/spinning_cube.cc
mojo/android/javatests/src/org/chromium/mojo/MojoTestCase.java
mojo/cc/context_provider_mojo.cc
mojo/cc/context_provider_mojo.h
mojo/common/trace_controller_impl.cc
mojo/gles2/command_buffer_client_impl.cc
mojo/gles2/command_buffer_client_impl.h
services/gles2/gpu_impl.cc
shell/android/apk/src/org/chromium/mojo/shell/MojoShellApplication.java
sky/engine/core/dom/Node.cpp
sky/shell/apk/src/org/domokit/sky/shell/SkyShellApplication.java
ui/events/latency_info.cc
ui/gfx/transform.cc
ui/gfx/transform.h
ui/gfx/transform_util.cc
ui/gfx/transform_util.h

Review URL: https://codereview.chromium.org/935333002
2015-02-19 17:27:12 +01:00
James Robinson
313c22a321 Remove last uses of InterfaceImpl<> in Sky C++ code
This switches to using StrongBinding<>s in sky's ContentHandlerImpl
and TestHarnessImpl implementations.

These are the last uses of the deprecated InterfaceImpl<> helper in
the mojo repo (more uses exist in other repos).

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/934403002
2015-02-18 18:17:50 -08:00
Adam Barth
9f44d53d88 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
5c1f4d1dab Add an implementation of url_loader.mojom using OkHttp
This CL is the beginnings of an implementation of url_loader.mojom using the
OkHttp library. OkHttp is a relatively simple HTTP client library for Android
that implements HTTP/1.1 and HTTP/2.0. We might want to use OkHttp to bootstrap
into a more full-featured network_service implementation based on //net.

R=jamesr@chromium.org

Review URL: https://codereview.chromium.org/930673002
2015-02-18 16:53:04 -08:00
Ojan Vafai
e72b889e5e Increase code coverage for RenderLayer::hitTestLayer.
Add tests for the NormalFlowChildren and transforms code paths.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/926823004
2015-02-18 16:07:35 -08:00
Hixie
34f90cea4b Dispatcher tests (tests the code in events.md)
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/936973002
2015-02-18 14:34:31 -08:00
Adam Barth
0c71f4552a Connect Sky and Ganesh in SkyShell
This CL contains enough plumbing for Sky to render content to the screen using
Ganesh in SkyShell. We're still missing the ability to load data off the
network.

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

Review URL: https://codereview.chromium.org/936883002
2015-02-18 13:15:36 -08:00
Adam Barth
576f0eb04a Remove the concept of document.documentElement
Now documents can have many element children, all created equal.

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

Review URL: https://codereview.chromium.org/928393003
2015-02-17 16:20:07 -08:00
Eric Seidel
04cd457d91 Make tests/clipping/canvas-rounded-corners.sky actually run.
Because we dump dart errors to LOG(ERROR) (stderr) instead
of console.log / stdout, tests with dart errors just "pass"
and we don't notice they're not running.

This was the case with canvas-rounded-corners.sky.

I don't think this test actually passes yet, despite it
claiming to, but I at least have made it run and not crash.

Required me commenting out a ton of CanvasRenderingContext2D, but
that's fine, it wasn't actually working and it's better to have
it be compiling valid dart.

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

Review URL: https://codereview.chromium.org/936563002
2015-02-17 12:25:15 -08:00
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