667 Commits

Author SHA1 Message Date
Rafael Weinstein
3ed20172df Fix tracing for Document::updateRenderTree
R=abarth@chromium.org, abarth
BUG=

Review URL: https://codereview.chromium.org/949313002
2015-02-24 12:15:40 -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
Benjamin Lerman
b9b9b08f94 Update from https://crrev.com/317530
TBR=qsr@chromium.org
BUG=461092

Review URL: https://codereview.chromium.org/952893003
2015-02-24 16:42:13 +01:00
Ojan Vafai
920920310e Delete RenderLayerModelObject.
Merge most of it into RenderBox. Only RenderBoxes can have
layers now. This also meant a bit of code could be cleaned up
since some virtuals (e.g. updateFromStyle) are no longer needed
since they're only called on RenderBoxes.

collectSelfPaintingLayers is the only bit that's moved into
RenderBoxModelObject instead of RenderBox. That's because we
need to be able to recurse down into RenderInlines since they
may contain RenderBoxes that have selfPaintingLayers.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/953673002
2015-02-23 17:24:38 -08:00
Ojan Vafai
c93e7093c1 Never layer-ize RenderInlines.
This removes support for opacity, filters and clip-path
on RenderInlines. If you want inline content that uses
these properties you need to use an inline-block. We
may want to add back support for opacity or filters
on inlines eventually, but we'd implement it differently
and right now they're getting in the way.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/950963003
2015-02-23 16:40:15 -08:00
Scott Violet
15d7cd9b47 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
Rafael Weinstein
6871080f93 Bypass the cache from sky MojoFetcher
R=abarth@chromium.org, abarth
BUG=

Review URL: https://codereview.chromium.org/951063003
2015-02-23 15:23:04 -08:00
Eric Seidel
ec267de8d9 Revert "Pull chromium at 2c3ffb2355a27c32f45e508ef861416b820c823b"
This reverts commit 75d3e86468813c450c36d2320bbd7a8b2e2ba9c4.

Android mojo_shell fails to run.  It can'd find the
AndroidHandler class.  Unclear what part of this change is causing
this.  jamesr and I spent a while trying to figure out, but we're
reverting this for now to unblock the rest of the team working
on android development.

Hopefully the paris team will be able to bail us out here when
they wake. :)

R=jamesr@chromium.org,qsr@chromium.org,davemoore@chromium.org

Review URL: https://codereview.chromium.org/951673002
2015-02-23 14:42:04 -08:00
Dave Moore
afd52997cc Pull chromium at 2c3ffb2355a27c32f45e508ef861416b820c823b
BUG=
R=jamesr@chromium.org

Review URL: https://codereview.chromium.org/946243002
2015-02-23 13:03:11 -08:00
Adam Barth
b6f511c6a9 Port Sky widgets demo to Dart
This CL updates sky-box, sky-button, sky-checkbox, sky-input, and sky-radio to
work in Dart. We don't have a data binding system yet, so there's a bit more
plumbing in the code.

This CL adds support for sky-element@attributes, which lets you specify which
attributes your element supports. We use this information to synthesize getters
and setters for those attributes and to dispatch to mumbleChanged methods when
the attributes change.

I've also wrapped the widgets demo itself in a sky-scrollable so the whole
thing scrolls.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/946813005
2015-02-23 08:30:36 -08:00
Adam Barth
fe31fd0e4c 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
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
16db84fde1 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
a267c39c01 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
0c37a8a322 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
788bb15b3b Address TODOs in the new layer painting and hit testing.
-ASSERT(layer()->parent()) in all the transform codepaths since
the RenderView cannot have a transform.
-Early return if the content rect does not intersect the
damage rect in the painting code. We don't need to do
any of the filter and/or transparency dance if we're
not going to paint anything. This also allowed for
removing the shouldPaintContent bool.
-Remove a random style() null check that can't be hit.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/950553002
2015-02-20 18:19:29 -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
dd5a9c9831 Delete sky/engine/core/dom/custom
This code is unused now that we have sky/engine/core/dom/custom2 working.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/950523002
2015-02-20 17:12:54 -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
Ojan Vafai
8ba8641a1d 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
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
178be1d89d Remove almost all clients of isHTMLElement
This CL is progress towards deleting the concept of an HTMLElement entirely. We
won't actually get all the way there in this CL series, but we're getting
closer. This CL also will let us make custom elements just be Elements instead
of HTMLElements.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/942933003
2015-02-20 12:06:15 -08:00
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