121 Commits

Author SHA1 Message Date
Matt Perry
485523560f Add a MaskFilter interface to dart:sky to handle blur.
For this, I added back my previous CustomDart attribute for customizing the
generated Dart code of an interface.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1162843003
2015-06-02 17:26:32 -04:00
Matt Perry
e68fe5d33e Add TransferMode to dart:sky, and use it instead of passing ints around.
Also use Point in place of passing 2 ints to the DrawLooper API.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1158883004
2015-06-02 15:03:44 -04:00
Matt Perry
4f2d78a5bb Re-land "Add a Color class to dart:sky."
The previous patch broke the sky tests. I have updated the framework to use the new Color class.

R=jackson@google.com

Review URL: https://codereview.chromium.org/1159663003
2015-06-02 14:09:42 -04:00
Collin Jackson
4a8133b96a Fix generated code for callbacks where argument interface doesn't match implementation class name
R=mpcomplete@chromium.org, mpcomplete

Review URL: https://codereview.chromium.org/1163863002
2015-06-01 15:33:25 -07:00
Matt Perry
ffed692545 Revert "Add a Color class to dart:sky."
This reverts commit a413c8319fe9a46dc131f6efe275d014c9cb7eb9.

Reason: seems to have broken Sky tests:
Regressions: Unexpected crashes (2)
  raw/render_box.dart [ Crash ]
  raw/render_flex.dart [ Crash ]

TBR=jackson@google.com

Review URL: https://codereview.chromium.org/1143133007
2015-06-01 18:13:35 -04:00
Matt Perry
326e2324c9 Add a Color class to dart:sky.
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1161273004
2015-06-01 16:48:48 -04:00
John McCutchan
f0c5ab0b82 Roll Dart forward
BUG=
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1159443002
2015-05-28 07:45:06 -07:00
Matt Perry
1a07d29d7e Sky: Add a DrawLooper interface to the painting API to be used for shadows.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1144193006
2015-05-27 16:22:01 -04:00
Adam Barth
f179203848 Add support for testing content in SkyView
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1160763004
2015-05-27 13:14:08 -07:00
John McCutchan
7367e532b4 Move 'dart:mojo.internal' into sdk_ext directory of mojo package
BUG=
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1143073004
2015-05-21 11:02:43 -07:00
Matt Perry
4c5aee62cd Sky: different tack for custom Rect type in the Canvas API.
Rect is now a dart-only type, defined in its own .dart file. I use
DartConverter when passing a Rect into C++. I also special-cased Rect in the
IDL compiler so that it's passed by value, instead of allocating a new
Rect object on the heap.

This also adds a mechanism to add custom .dart files to dart_sky.dart - used by
Rect.dart.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1151673002
2015-05-20 17:58:38 -04:00
Adam Barth
3acb930b0a Attempt to fix bad dependency in Sky build
Several people have run into trouble building Sky because of a missing
dependency in the build. From inspection, it looks like this might fix the
issue, but it's hard to be sure without being able to reproduce the issue
locally.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1130353013
2015-05-19 15:44:36 -07:00
Adam Barth
9f8b9bb96d 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
Matt Perry
c69bcc245c 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
b017dfd995 Rationalize Dart mojo and sky package structure.
NOTE: This CL appears far larger than it actually is for two reasons:

1) Many files were moved around to use the Dart package directory structure.
2) Many .dart files had to have import paths updated.

- Organize mojo/public/dart so that it uses standard Dart package layout
- Organize mojo/dart/apptest so that it uses a standard Dart package layout
- Organize sky/sdk so that it uses a standard Dart package layout
- Create a mojo/testing package (used by unittests)
- Introduce the 'dart_pkg' gn rule which populates gen/Config/dart-pkg
- All internally vended Dart packages must have a corresponding dart_pkg rule
- It is now possible to use dependency_overrides: in pubspec.yaml to mix internal and external package dependencies (enables analyzer, editor, webstorm usage for internal developers).
- Package root for dart content handler ends with "packages/"
- Imports of mojo package uris no longer need the "public/dart"
- mojo/public/tools/dart_package.py is a clone of mojo/public/tools/gn/zip.py
- Sky tests no longer run 'deploy_sdk' script.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1132063007
2015-05-18 14:41:39 -07:00
John McCutchan
76da439f44 Add Observatory to sky dart_controller
- Bump Dart and Observatory DEPS to 45576 and 45565 respectively.
- Include 'dart:io' in snapshot
- Add 'dart:io' native bindings to sky bindings.
- Initialize 'dart:io' in sky dart_controller.
- Include Observatory and service isolate resources in build.
- Bring up service isolate.
- Start handle watcher isolate from service isolate (hides handle watcher isolate from debugger and Observatory).
- Hook up debugger.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1107803002
2015-05-06 15:36:12 -07:00
James Robinson
3507c90d4b Update from https://crrev.com/327068
This rolls in //base, //build and //sandbox/linux and updates other
things to match, in particular:

*) Update build_v8.patch
*) Add junit, mockito and roboelectric to DEPS for android test rules
*) Update DEPS for grit
*) Fix up various GN files for os->target_os rename
*) Fix up a few places that were using //base/float_util to use std::isnan
*) Fix up a few places using ApiCompatibilityUtil to use Android SDK directly

as well as a few miscellaneous fixes.

Many portions based on ncbray's work in
https://codereview.chromium.org/1108173002/

R=ncbray@chromium.org
TBR=ncbray@chromium.org

Review URL: https://codereview.chromium.org/1124763003
2015-05-05 16:31:51 -07:00
John McCutchan
ee061ddf28 - Rename "nodefer" to "immediate" (gets rid of double negative in "nodefer: false").
- Immediate close means that anything pending will be discarded.
- Plumb immediate all the way down to the handle watcher close call.
- When an EventStream is closed because no one is listening for events, close immediately.
- Don't call Dart_NewSendPort with ILLEGAL_PORT in sky embedder.
- Bump DEPS to include fixes for Dart_NewSendPort and profiler signal handler executing after shared object is unloaded.
- Fixes https://github.com/domokit/mojo/issues/79

R=zra@google.com

Review URL: https://codereview.chromium.org/1060193002
2015-04-07 12:59:58 -07:00
Siva Annamalai
9f0601b18e gen_snapshot now generates two snapshot buffers, one for the vm isolate
and another for a regular isolate. These changes account for that change
in the mojo and sky snapshot generation scripts and the controller files.

R=zra@google.com

Review URL: https://codereview.chromium.org/1047883002
2015-04-02 11:31:29 -07:00
Zachary Anderson
d83427c165 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
81233b6df9 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
Zachary Anderson
3cc4de9295 Dart: Rename mojo:X -> dart:mojo.X
This is to better support integration with Dart SDK tools.

BUG=
R=erg@chromium.org

Review URL: https://codereview.chromium.org/998933005
2015-03-11 16:22:21 -07:00
Eric Seidel
e3a8059796 Fix all dartanalyzer errors in dart:sky except the Native ones.
I also fixed all warnings. :)

This is the only error remaining:
[error] Native functions can only be declared in the SDK and code
that is loaded through native extensions

My understanding is that we need to do something similar to:
https://codereview.chromium.org/950063002/
in order to work around the 'native' issue.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/981733009
2015-03-05 13:36:48 -08:00
Zachary Anderson
b3b197fcf8 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
Eric Seidel
ab273a8433 Make splash animations abort on scroll.
I also fixed the transform hack in material-element to clean
up after itself.

I also discovered that our namedSetter implementation did not
handle null (it crashed) while doing this.  I fixed that
and tested my fix.

This runs great on a Nexus 5, but poorly on an Nexus 10.

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/956753002
2015-02-24 17:20:18 -08:00
Rafael Weinstein
e53bba60a5 Add dart_invoke to tonic for calls into App code.
This patch adds utility functions which provide a single choke point for calling into sky application code. For now this is only serving the purpose of having a common trace event for calls into app code.

R=abarth@chromium.org, abarth
BUG=

Review URL: https://codereview.chromium.org/941153003
2015-02-24 12:11:19 -08:00
Adam Barth
085b988e6a Make it possible for sky-element to register any tag name
... instead of hard-coding "example".

We do this by adding a custom constructor for Element that gets the |tagName|
property off the instance.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/943153002
2015-02-21 08:02:32 -08:00
Adam Barth
73b76dcca9 Rename Sky's custom2 to custom
We've removed the old implementation of custom elements. We can move the new
implementation into the proper place and give the classes their proper name.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/946083003
2015-02-20 17:35:47 -08:00
Adam Barth
7d00bd5e06 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
Adam Barth
5efcc9a6d8 Add support for |any| to Sky's code generator
We now expand |any| to DartValue (which exists) as opposed to ScriptValue
(which does not).

Also, fill in a few missing pieces in tonic that will be used by custom
elements.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/942993002
2015-02-20 12:19:54 -08:00
Adam Barth
0a6bdfed49 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
f562073fe2 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
Adam Barth
b0ef81ac95 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
Hans Muller
63dd3c3f5a Dart Bindings: ApplicationConnection
Replaced the Dart ServiceProvider class with a version
of ApplicationConnection that can both provide services
and connect to (request) them. ApplicationConnection
objects are returned by the Application ConnectToApplication()
method and they're passed to the Application AcceptConnection()
method.

R=zra@google.com

Review URL: https://codereview.chromium.org/934253003
2015-02-18 14:17:54 -08:00
Eric Seidel
5e47f9a8f2 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
Eric Seidel
7c33481af9 Fix the tests after my previous commit.
This actually makes [Named] work, previously it was
generating invalid dart.

TBR=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/931273002
2015-02-17 11:09:27 -08:00
Eric Seidel
9aba803749 Add support for named arguments to our bindings generation.
This doesn't yet support having both named and optional
arguments, but once I have an example of that it should
be trivial to add.

I also cleaned up the generation a little so the generated
dart file looks nicer. :)

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/923093003
2015-02-17 11:00:07 -08:00
Adam Barth
24b3a12e95 Throw exception for null listener in addEventListener
We appear to be missing a null check here as well.

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

Review URL: https://codereview.chromium.org/937443002
2015-02-17 10:49:52 -08:00
Adam Barth
f7e974680c 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
Adam Barth
c6b03b42e5 Program _uriBaseClosure into the DartVM
Turns out you need a base URI to make the unit testing framework behave in a
sane way.

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

Review URL: https://codereview.chromium.org/926163002
2015-02-13 14:41:31 -08:00
Adam Barth
2d006b8294 Actually stop Sky from linking with V8
We don't use V8 anymore. There's no reason to link it in.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/918263003
2015-02-12 21:16:55 -08:00
Adam Barth
52b56750a1 Rename sky/engine/bindings2 to sky/engine/bindings
There's only one bindings system now.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/915293003
2015-02-12 20:16:17 -08:00
Adam Barth
30de02064c Remove unused V8 integration code in Sky
We don't build this code anymore.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/922053002
2015-02-12 19:44:16 -08:00
Adam Barth
e962904c7a Remove TRACE_EVENT indirection through blink::Platform
Normal trace events already go directly to base. This CL removes the remaining
trace events that were still indirected through blink::Platform. These were
just the half-finished inspector timeline trace events, which currently aren't
actually hooked up to anything.

This CL also removes the redunant "convertable to trace format" wrappers and
moves their one remaining use over to just using the version in base directly.

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

Review URL: https://codereview.chromium.org/889823002
2015-01-30 08:47:46 -08:00
Elliott Sprehn
fa70bea051 Remove CustomElementDescriptor.
In Sky we only need the localName of an element to describe
what it is. Remove this abstraction which is just a thin wrapper
around AtomicString.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/885713004
2015-01-28 20:46:24 -08:00
Adam Barth
54809a8877 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
Elliott Sprehn
8760fdb944 Remove the global event property.
Sky doesn't have inline event handlers so this is just slowing down
event dispatch. I also simplified the event dispatch code a little.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/873983005
2015-01-26 13:55:29 -08:00
Elliott Sprehn
30c38af903 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
da75d15a1b Merge HTMLDocument into Document
HTMLDocument is the same as Document. We can merge them.

R=eseidel@google.com

Review URL: https://codereview.chromium.org/871383002
2015-01-25 23:48:53 -08:00
Adam Barth
aaa8e08ba2 Remove window.history
Instead, Sky content should use navigator.mojom.

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

Review URL: https://codereview.chromium.org/873973002
2015-01-24 00:59:40 -08:00