645 Commits

Author SHA1 Message Date
Ojan Vafai
a42e249b69 Remove dead position:relative code.
There are some cases in this patch where it's not
obvious that the code only applies to position:relative,
but the code asserts that it does. In those cases,
I trusted the asserts and deleted the code.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/938193004
2015-02-20 11:37:17 -08:00
Eric Seidel
c78cea7e54 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
Adam Barth
e89f321945 Remove CustomEvent from Sky
There's no point in CustomEvent anymore because authors can just subclass Event
themselves.

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

Review URL: https://codereview.chromium.org/941243002
2015-02-19 23:24:05 -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
Ojan Vafai
74290d5007 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
89db30494d Remove two more uses of NodeList
We now use List<Node> instead, which is more idiomatic.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/941913002
2015-02-19 21:10:20 -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
Adam Barth
a033a3261b Add back Element#getBoundingClient rect
Hans is using this in Modular and we don't have a great replacement at the
moment.

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

Review URL: https://codereview.chromium.org/942543002
2015-02-19 10:02:16 -08:00
Adam Barth
0c35024cef 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
3ec2270eb2 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
Ojan Vafai
3edb147679 Change the return value of RenderLayer::hitTestLayer.
All the code only cares about whether we hit, not
which layer we hit.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/939793003
2015-02-18 19:52:16 -08:00
Ojan Vafai
bd8d560b7a Merge RenderLayer::hitTest into RenderView::hitTest.
Only RenderView calls this method. The actual tree walk
happens in RenderLayer::hitTestLayer, which a followup
patch will move into RenderBox.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/939483005
2015-02-18 19:29:30 -08:00
Ojan Vafai
6b07257fb6 Merge hitTestLayerByApplyingTransform into hitTestLayer.
This makes hitTestLayer a bit larger at the benefit of making
the code a bit easier to follow and getting rid of the confusing
recursive call to hitTestLayer and the appliedTransform bool.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/937023002
2015-02-18 18:40:20 -08:00
Ojan Vafai
f9ddb1cabd 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
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
Adam Barth
3d8ffb7f52 Make it possible to load a WebFrame from a URL
Previously, the WebFrame need to be created with a data pipe consumer handle.
This CL makes it possible to create a WebFrame with a URL and have the engine
issue the network request.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/940703002
2015-02-18 12:57:51 -08:00
Przemyslaw Pietrzkiewicz
6ea43eee14 Drop unneeded build deps on /net.
BUG=456130
R=blundell@chromium.org

Review URL: https://codereview.chromium.org/940473002
2015-02-18 12:03:28 +01:00
Adam Barth
1312b93456 Use Dart_EmptyString
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/933843004
2015-02-17 16:20:39 -08:00
Adam Barth
dff66fb1b7 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
4790abe2f7 Remove the concept of pendingScripts from HTMLScriptRunner
We shouldn't need pendingScripts in ScriptRunner since
we should never be trying to run scripts when we're
not ready to run them.

However this wasn't completely true in the case of imports
there was code to have us break before any start tag after
an <import> was seen, but it was subtly wrong in that it
it would include the start-tag it was trying to break before
in the chunk it sent to the main thread.

This didn't run out to be the problem I was facing, but I fixed
it anyway.  The problem which was actually preventing me from
removing pendingScripts was adding a check inside
didRecieveParsedChunk... to check if imports were pending and
add the chunk to the list of pending chunks.

I also renamed m_speculations to m_pendingChunks since these
chunks are never speculative anymore.

We can't test the off-by-one import-breaking code with our
current system, but it would be trivial to test with a
self-closing custom element if/when we ever add custom
elements back to the system.

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/934083002
2015-02-17 16:13:30 -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
5c2c411c40 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
Adam Barth
374a768d5b Improve DartLoader error handling.
Before this if a dart import 404s, we crash.
This makes some minor improvements in our logging
for better diagnosis of future errors.

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/926753002
2015-02-14 20:18:00 -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
Ojan Vafai
0b9a9f98c2 Remove HitTestAction.
We no longer paint background and foreground separately,
so we don't need to hit test them separately.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/924273003
2015-02-13 21:08:59 -08:00
Ojan Vafai
04f9707e4f Remove HitTestFilter.
Background and foreground on a layer can't be hit indepdently
anymore, so merge them into a single hitTestContents call.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/924273002
2015-02-13 21:07:54 -08:00
Ojan Vafai
e0c039e035 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
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
Ojan Vafai
5e291c32e2 Prune HitTestResult and stop special-casing links.
Prunes a bunch of dead code from HitTestResult and
stops special-casing links for creating hand cursors.
This code already isn't working today anyways, so
in practice, there's no change in behavior.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/925933004
2015-02-13 14:17:42 -08:00
Ojan Vafai
1d3f70fc06 Remove unnecessary operator overload on RenderLayer::hitTest.
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/925903005
2015-02-13 14:12:38 -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
f2d2e80e59 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
Eric Seidel
c7d2352897 Add the c++ code part of bindings2/
This is all the bindings-level dart code we had to write
to enable Dart in Sky.  We wrote this over the last 2
weeks in:
https://github.com/eseidel/skydart

R=abarth@chromium.org, jamesr@chromium.org
BUG=454613

Review URL: https://codereview.chromium.org/918333002
2015-02-12 13:42:11 -08:00
Adam Barth
c6dce9ad07 Add DartController and friends
This CL adds the DartController and associated classes. These classes let you
load and execute dart code.

R=rafaelw@chromium.org
BUG=454613

Review URL: https://codereview.chromium.org/921903002
2015-02-12 13:34:45 -08:00
Adam Barth
128591574e Build sky/engine/tonic
This CL adds a dependency from Sky to DartVM.  We need to remove Sky from the
ASAN build because DartVM doesn't currently build in ASAN (see https://code.google.com/p/dart/issues/detail?id=22121).

R=rafaelw@chromium.org
BUG=454613

Review URL: https://codereview.chromium.org/919463004
2015-02-12 13:18:25 -08:00
Rafael Weinstein
2a5e18ff64 Merge the tonic layer from skydart branch back to master
The tonic layer is analogous to "gin" for v8. It provides wrappers and helpers around common dart types and implements the basic infrastructure for allowing dart wrappers around sky DOM objects to have proper GC behavior.

R=abarth@chromium.org
TBR=eseidel
BUG=

Review URL: https://codereview.chromium.org/924593002
2015-02-12 12:55:01 -08:00
Eric Seidel
c0b8517544 Add a new bindings2/scripts directory for Dart bindings
These bindings were developed over the last 2 weeks on:
https://github.com/eseidel/skydart
They started as copies of the Dartium scripts (aka dart/tools/dom):
https://code.google.com/p/dart/source/browse/#svn%2Ftrunk%2Fdart%2Ftools%2Fdom
Which in turn started as a forked copy of Blink's
binding generation scripts from some years ago.

This is still way more python than we need to generate
bindings for SkyDart, but it's a start.

Reviews were done for many (but not all) of the patches.

I'll add the bindings2/ code and build system wiring
in further patches. Landing the new directories one at a
time so that it's easier to read through.

R=abarth@chromium.org, jamesr@chromium.org
BUG=454613

Review URL: https://codereview.chromium.org/914413004
2015-02-12 12:22:38 -08:00
Adam Barth
82c1ea5adc Remove bindings-dart
This code was a drop from Dartium and isn't used. It will be replaced with code
from the SkyDart branch.

TBR=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/918273002
2015-02-12 10:07:28 -08:00
Hans Muller
47bf46b00e 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
50527025ca 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
Ojan Vafai
effdf28e11 Remove position:relative.
The use-cases we care about are met better by translate2d.
Remove the parsing so that people writing on sky don't
depend on it. Followup patches will remove the functionality.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/904613005
2015-02-06 12:46:04 +11:00
Ojan Vafai
6ee8440f27 Walk render tree instead of render layers for paint.
This is the first step of getting rid of RenderLayer.
Instead of walking the RenderLayer tree, wall the RenderObject
tree and add any layers encountered to a vector to paint later.

This patch just consolidates and move the code from RenderLayer
to RenderBox and then changes the children painting to
iterate over the vector. Therefore we walk the RenderObject tree.
We still call out to RenderLayer in a bunch of places.
A followup patch will get rid of those.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/899753003
2015-02-06 11:38:25 +11:00
Adam Barth
1f8dd823f9 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
Tony Gentilcore
2c277b5653 Fix render bounds of iframes on devices with a pixel ratio != 1.
BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/896233002
2015-02-04 08:57:10 -08:00