162 Commits

Author SHA1 Message Date
Adam Barth
d8d7db82a0 Really remove config.h
This CL generated by |sed -i '/sky\/engine\/config.h/d'| and a manual sweep to
catch some oddballs.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1206763002.
2015-06-23 23:15:28 -07:00
yzshen
e3fe2a2fcc Remove some InterfacePtr<> methods which directly deal with message pipe handles.
Users should use the corresponding methods dealing with
InterfacePtrInfo<>.

BUG=None
TEST=None
R=jamesr@chromium.org

Review URL: https://codereview.chromium.org/1118843003
2015-05-04 14:47:01 -07:00
Ojan Vafai
4fb43c315a Remove the x,y,width,height methods from HTMLImageElement.
They've already been removed from the idl.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1055323002
2015-04-06 11:39:48 -07:00
Ojan Vafai
7e1ca8fc6f Remove x,y,width,height from HTMLImageElement.
This conflicts with adding them to HTMLElement for custom layout.
I grepped the codebase and couldn't find any uses of these. The
big thing we lose here is a way to set width/height on an image
that automatically maintains aspect ratio, but that's something
we should move into a custom layout method anyways.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1060443002
2015-04-02 15:15:43 -07:00
Adam Barth
0dd797975c Remove <canvas>
Folks should use custom paint instead (see sky/engine/core/painting for a
sketch).

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1001913003
2015-03-25 16:15:05 -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
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
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
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
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
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
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
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
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
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
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
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
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
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
Scott Violet
e98fd07ffb Fixes crash in HTMLIFrameElement and exposes HTMLIFrameElement::src
HTMLIFrameElement was adding the observer in navigateView. If the same
HTMLIFrameElement navigated multiple times HTMLIFrameElement would
attach itself as an observer more than once. ObserverList doesn't like
this.

Also adds src as an attribute of HTMLIFrameElement so that I can do:
iframe.src = xxx
in script

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/885783002
2015-01-28 19:47:26 -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
Adam Barth
645a6a9d12 Remove dead code related to compositing from Sky
R=esprehn@chromium.org, eseidel@chromium.org

Review URL: https://codereview.chromium.org/865153004
2015-01-27 14:38:56 -08:00
Adam Barth
4f1ad264d9 Make it possible to navigate <iframes>
Also, add support for exposing services to <iframes>. This worked before but
now that [Client=...] is gone we need to create another message pipe.

R=sky@chromium.org

Review URL: https://codereview.chromium.org/882723003
2015-01-27 10:35:52 -08:00
Elliott Sprehn
eb3e7d4b8b Get rid of Chrome, use Page.
This hides ChromeClient inside Page and gets rid of Chrome object.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/878673005
2015-01-26 18:06:24 -08:00
Elliott Sprehn
bd7bbc8967 Remove CSSCanvas values.
This was to support doing background: -webkit-canvas(#id) where you could then
get the canvas with document.getCSSCanvasContext(id) and draw into it which
is a poor form of custom drawing for elements. In Sky we'll have real custom
painting instead of just background images hacked in like this.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/876913002
2015-01-26 15:12:38 -08:00
Elliott Sprehn
765ef4ec8e Replace createTextNode with new Text().
Sky doesn't have this method (per spec).

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/879733002
2015-01-26 15:12:19 -08:00
Elliott Sprehn
c7c5328338 Remove InputMethodContext.
We'll probably want a really different API in sky, and this just makes
ElementRareData bigger for now and isn't hooked up to anything.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/880663002
2015-01-26 13:12:08 -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
e3f9e2de4b Remove more mouse-specific code
This CL removes a bunch of unused mouse-related code, including the
MouseRelatedEvent base class.

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

Review URL: https://codereview.chromium.org/873963003
2015-01-24 11:18:35 -08:00
Elliott Sprehn
0275d42ac7 Add the <t> element and ignore whitespace outside it.
We now only preserve the whitespace inside a <t> element inside
the parser. This removes the known n^2 from reattaching whitespace
which should make parsing and appending nodes faster. I also
removed the dead WhitespaceMode code from the parser, and made
the dom-seralizer.sky auto indent the markup so the test output
would be readable.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/867963006
2015-01-23 16:50:00 -08:00
Adam Barth
d7daaf4c7d Remove mouse events from Sky
We use pointer events now.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/870073003
2015-01-23 12:16:09 -08:00
Elliott Sprehn
ca9d4f1ab2 Consolidate callers to scheduleVisualUpdate.
Make everyone call through Document::scheduleVisualUpdate(). I also
removed some dead composited selection code that used this.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/865383003
2015-01-22 18:47:23 -08:00
Adam Barth
2c0b2f7ff9 Remove UseCounter
We'll eventually add this back but sometime in the future when we actually have
users.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/867903002
2015-01-22 18:26:55 -08:00
James Robinson
c0c8a41eb3 Remove [Client=] annotation from ServiceProvider
This removes the symmetrical nature of ServiceProvider and consistently
passes and uses a ServiceProvider + ServiceProvider& pair in places that
wish to bidirectionally expose services, such as the view manager.

The
view manager library now deals with InterfaceRequest<ServiceProvider>
and ServiceProviderPtr objects (i.e. c++ wrappers for handles) instead
of a concrete implementation of ServiceProvider to make it easier for
callers.

A number of places that were assuming a particular
ServiceProvider would always exist are updated to reflect the nullability
of the parameters in mojom and places that do not wish to ever look up
or provide services now pass nullptr instead of doomed pipe handles.

The JS application startup classes are reworked a bit to accomodate
exposing services on the third ConnectToApplication/AcceptConnection
parameter.

BUG=449432
R=abarth@chromium.org, sky@chromium.org

Review URL: https://codereview.chromium.org/858103002
2015-01-21 18:36:01 -08:00
Adam Barth
881b06dfc5 <iframe> should expose its mojo::ServiceProvider handle
After this CL, you can exchange services with the app loaded in the iframe by
calling takeServiceProvider() on the iframe element. That gives you the raw
handle, which you'll need to wrap in the appropriate mojom-generated interface.

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

Review URL: https://codereview.chromium.org/862943004
2015-01-21 16:24:58 -08:00
Elliott Sprehn
a489bb7128 Remove css !important
Sky doesn't have important, it just orders properties in the same order
as the rules you specified.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/860423004
2015-01-21 14:34:02 -08:00
Adam Barth
6f3a5a1496 Move the call to mojo::View::Embed to HTMLIFrameElement
This CL prepares us to expose the imported and exported service providers to
JavaScript. We can't quite do that yet becaues the API on mojo::View isn't
ready for us. However, we can get started by moving the call to Embed into
HTMLIFrameElement.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/793393003
2015-01-21 10:49:24 -08:00
Elliott Sprehn
0fcd743a64 Remove Element::textFromChildren().
Instead just use textContent() and teach HTMLStyleElement how to atomize
its children. I also added the optimization to Node::textContent so that
Text just returns its value instead of allocating a new buffer which
avoids malloc and copy when getting the textContent of text.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/864613002
2015-01-20 14:26:54 -08:00
Elliott Sprehn
b3e4c186ee Remove HTMLStyleElement::scopingNode().
It's not used.

TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/864533003
2015-01-20 14:26:43 -08:00
Elliott Sprehn
992eaea546 Remove attrs sky doesn't support.
This removes the attributes sky doesn't intend to support. It
removes references to the attrs, but leaves behind a lot of
plumbing that will be cleaned up in the future. This at least
removes the API surface.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/855803002
2015-01-16 19:42:52 -08:00
Elliott Sprehn
9bb2664b06 Get rid of ensureStyleResolver().
It doesn't have side effects anymore, and active documents always
have a StyleResolver.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/838003008
2015-01-16 17:49:32 -08:00
Ojan Vafai
d591ca1f14 Delete a bunch of noop paint invalidation code.
This deletes invalidateRect and all it's callers.
There are no logic changes, just deletes.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/842113005
2015-01-16 17:42:47 -08:00
Adam Barth
e89b1dda15 lowlevel/img.sky flaky crashes
We don't need to pump pending speculations if we don't have any.

R=esprehn@chromium.org, eseidel@chromium.org
BUG=447763

Review URL: https://codereview.chromium.org/852043003
2015-01-14 13:32:21 -08:00
Elliott Sprehn
e71cf28f76 Merge StyleSheetCollection into ScopedStyleResolver.
There's no reason to keep two identical lists of the sheets
and have this separate object. I also moved the updating
logic out of StyleResolver and into ScopedStyleResolver
which makes more sense. There's still some weirdness since
some global state still exists in the StyleResolver, but
that's something we can fix in future patches.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/852703002
2015-01-13 18:37:00 -08:00
Elliott Sprehn
c4ecc2236b Remove didRemoveAllPendingStylesheet.
Nothing calls this now, and sky has no concept of pending stylesheets.

TBR=ojan@chromium.org

Review URL: https://codereview.chromium.org/849773002
2015-01-12 20:33:20 -08:00
Elliott Sprehn
689b91c36d Replace sheet change methods with styleResolverChanged.
Unlike blink in sky we just want to mark tree scopes dirty. We can
remove these methods, the dirty tree scope tracking we'll add in
the future will take care of this.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/836893003
2015-01-12 18:23:55 -08:00
Ojan Vafai
a198a95ea6 Delete invalidateTreeIfNeeded.
This is just setting and clearing paint invalidation dirty bits.
Also remove a bunch of the paint invalidation dirty bits entirely.
There's plenty more to do.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/791023006
2015-01-12 13:29:12 -08:00