37534 Commits

Author SHA1 Message Date
Benjamin Lerman
9e84736edf Fix sky shell.
This add the missing RequestNavigateHistory method on sky::Engine.

It is currently not implemented.

TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/957973003
2015-02-26 10:46:25 +01:00
Adam Barth
9194603990 Add missing dependency from Eric's last commit
TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/952213005
2015-02-25 15:36:24 -08:00
Eric Seidel
5a69a1edca Make WebView::close not crash and start to fix navigation in SkyShell
However WebView::close() no longer crashes.  close() is never called
in MojoShell since mojo can't shutdown yet.

I tried closing the existing WebView and replacing it
but somehow that caused it to only draw red.  After a while
of looking at this with abarth we decided to just load into
the same WebView for now.

Eventually we should do something smarter where we start the
provisional load and only replace the webview once the new one is
ready, but that's a later CL.

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/952273003
2015-02-25 15:25:17 -08:00
Zachary Anderson
29dad69899 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
Adam Barth
24c33e48dc Share sky::PlatformImpl bettween sky_viewer and SkyShell
This should let SkyShell load images.

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

Review URL: https://codereview.chromium.org/959773005
2015-02-25 14:26:53 -08:00
Roozbeh Pournader
4c4af7f4dc Disable HarfBuzz's fallback to compatibility decompositions
Previously, HarfBuzz's default fallback to compatibility
decompositions resulted in Mathematical Alphanumeric Symbols getting
rendered as normal letters and digits when there was no font
available to render them. This patch disables that fallback, to
ensure they are displayed as tofus.

Based on a patch by Behdad Esfahbod.

Bug: 19202569
Change-Id: I357f172302448d4ab0b24efc86119f1977b5996b
2015-02-25 13:30:08 -08:00
Ojan Vafai
f5c662cbbd Fix clipping of content outside the bounds of the window.
https://codereview.chromium.org/899753003 incorrectly passed down the
RenderView's clipping rect all the down through transforms instead of
using the one from the LayerPaintingInfo, which is adjusted for transforms
as you recurse down the tree.

TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/957643002
2015-02-24 20:40:10 -08:00
Eric Seidel
aa1d4db99c Fix display of fonts in SkyShell
Originally reviewed for the branch on:
https://codereview.chromium.org/945083002

TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/953933004
2015-02-24 17:43:54 -08:00
Eric Seidel
6fa805515e Add support for VIEW intents to SkyShell.
This was landed on the skyshell branch and I forgot to pull it over:
https://codereview.chromium.org/946583003

TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/954893002
2015-02-24 17:39:36 -08:00
Eric Seidel
c6f997085c 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
Ojan Vafai
9d1f53dfb7 Cleanup transform-related methods in RenderLayer.
-Get rid of paintsWithTransform.
-Remove currentTransform. It was only ever called with
IncludeTransformOrigin and on non-null transforms.
-Remove renderableTransform. It was only called on
non-null transforms.
-Remove a layer()->parent() branch. The ASSERT had been
added in a previous patch, but the branch wasn't removed.
-Inline makeMatrixRenderable. It was only called in one
place.
-Add a test to make sure that transform origin is corrrectly
excluded from the transform computedStyle.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/958463002
2015-02-24 14:31:48 -08:00
Przemyslaw Pietrzkiewicz
8da87cd781 Serve skydb on localhost instead of 0.0.0.0.
This patch makes skydb http server available only for local connections.

BUG=460908
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/945663003
2015-02-24 18:10:15 +01:00
Przemyslaw Pietrzkiewicz
6ba70f9530 http_server: accept full NetAddress in CreateHttpServer.
This patch allows to specify a full NetAddress on which the server is to
be set up.

This is needed to decide between running the server on externally
visible address (like http_handler would like) and localhost (like skydb
would like).

No change in behavior of existing clients in the Mojo repo should occur.
A follow-up patch will switch some of the clients from 0.0.0.0 to
localhost.

BUG=460908
R=qsr@chromium.org

Review URL: https://codereview.chromium.org/953513002
2015-02-24 17:33:42 +01:00
Colin Blundell
04f7cb9a0b Add ApplicationDelegate::Quit()
This CL adds ApplicationDelegate::Quit(), which ApplicationImpl calls
before shutting down the main run loop. In this function, an
ApplicationDelegate should shut down anything that relies on the main
run loop being active.

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

Review URL: https://codereview.chromium.org/947253003
2015-02-24 14:06:47 +01:00
Adam Barth
da65a22fca Add a script to download material design assets from gs
We're going to use these assets to make pretty demos of Sky but not every
developer needs them in their working copy.

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

Review URL: https://codereview.chromium.org/951063006
2015-02-23 17:25:43 -08:00
Scott Violet
46d78892e7 Gets HTMLIFrameElement::embedViewManagerClient to work with dart
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/948943002
2015-02-23 15:29:22 -08:00
Adam Barth
1a9ba34816 Remove outdated examples and framework pieces
None of this code runs in the current Sky. Some of it never ran.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/951673003
2015-02-23 15:09:36 -08:00
Adam Barth
0650e9d727 Update HACKING.md 2015-02-23 10:12:05 -08:00
Adam Barth
16bd322935 Morph "appish" example into a "stocks" app
We'll flesh this example out over time to demo a bunch of our widgets.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/954503002
2015-02-23 09:30:11 -08:00
Adam Barth
e33c3ffadf Port sky-drawer to Dart
Also, port the "appish" example to exercise the drawer.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/942413002
2015-02-23 08:30:58 -08:00
Adam Barth
0d038b1a0d Port sky-scrollable to Dart
This CL ports sky-scrollable to the new sky-element.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/950603002
2015-02-21 09:56:22 -08:00
Adam Barth
8b94fd7798 Add a basic sky-element custom element
After this CL, you can use <sky-element> to describe custom elements. The
current iteration is very basic and is hardcoded to "example", but its a start.

This CL renames the |init| function to |_init| to prevent importers from
calling it directly. Also, we now pass the <script> element to |_init| to give
some context.

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

Review URL: https://codereview.chromium.org/950493003
2015-02-20 21:45:36 -08:00
Ojan Vafai
7c79bbf6bc Delete a bunch of dead python code.
Just deleted the obvious bits and verified that
test_sky, skydb and pretty-diff still work.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/946753002
2015-02-20 21:09:15 -08:00
Ojan Vafai
fdfd7c60f9 Add a dedicated pretty-diff command.
This will let us delete webkit-patch and a bunch of
python code and it will save me some annoyance at
needing to type "webkit-patch pretty-diff" all
the time.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/944193003
2015-02-20 21:01:04 -08:00
Ojan Vafai
e86f8777ae Remove the concept of staticly positioned absolutes.
On the web, if you set position:absolute, but not
top/right/bottom/left, then the absolute goes where it
would have gone if it wasn't positioned. The use-cases for
this are slim and it introduces a lot of complexity to the
engine.

Also changes behavior in the presence of direction:rtl.
On the web, direction:rtl and top/left:auto would
sometimes set right:0. Instead we always position at
0,0 if the opposing values are auto.

This removes the code for this positioning and allows
simplifying a bunch of dirty bit handling code since
we don't need to setNeedsLayout if lines move around
or wrap differently.

The test cases did change their output, but the new
positioning all looks correct to me.

Review URL: https://codereview.chromium.org/944073006
2015-02-20 20:26:59 -08:00
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