83696 Commits

Author SHA1 Message Date
Hixie
842d46667a Docs: We renamed appendChild to append, so update this example which still uses the old name.
Review URL: https://codereview.chromium.org/685063006
2014-11-04 14:15:40 -08:00
Hixie
f9981b1300 Docs: We renamed appendChild to append, so update this example which still uses the old name.
Review URL: https://codereview.chromium.org/685063006
2014-11-04 14:15:40 -08:00
Adam Barth
a4ed8ae0a8 Add a microbenchmark for simple block layout
R=eseidel@chromium.org, ojan@chromium.org

Review URL: https://codereview.chromium.org/701813004
2014-11-04 13:35:03 -08:00
Hixie
1da15583c5 Docs: add an example that uses the current APIs to define an <element>
element; an example that uses that example to define some HTMLy
elements; and an example to use those HTMLy elements to display a
hello world doc. Highly incomplete WIP.

Review URL: https://codereview.chromium.org/698293003
2014-11-04 13:32:07 -08:00
Hixie
0d3b8f4cc9 Docs: add an example that uses the current APIs to define an <element>
element; an example that uses that example to define some HTMLy
elements; and an example to use those HTMLy elements to display a
hello world doc. Highly incomplete WIP.

Review URL: https://codereview.chromium.org/698293003
2014-11-04 13:32:07 -08:00
Hixie
61f4494e25 Specs: define registerElement() a little differently, so that the code
that uses it looks nicer; this moves the complexity to places that
register elements without using 'class' (e.g. the internals of
frameworks that create elements for defining elements)

Review URL: https://codereview.chromium.org/699083005
2014-11-04 12:16:49 -08:00
Hixie
a0a988fadf Specs: define registerElement() a little differently, so that the code
that uses it looks nicer; this moves the complexity to places that
register elements without using 'class' (e.g. the internals of
frameworks that create elements for defining elements)

Review URL: https://codereview.chromium.org/699083005
2014-11-04 12:16:49 -08:00
Hixie
01f3d8fa67 Specs: define registerElement() more carefully; add an 'end tag
parsed' callback; pass the element's module to the constructor when
constructing a custom element (these are rather experimental changes
and we may want to go a different way on this stuff)

Review URL: https://codereview.chromium.org/701873004
2014-11-04 11:57:02 -08:00
Hixie
160363c274 Specs: define registerElement() more carefully; add an 'end tag
parsed' callback; pass the element's module to the constructor when
constructing a custom element (these are rather experimental changes
and we may want to go a different way on this stuff)

Review URL: https://codereview.chromium.org/701873004
2014-11-04 11:57:02 -08:00
Adam Barth
49e1436a68 tests
Address comments

Add a basic parser benchmark

This CL adds a basic benchmark for the parser. There isn't a direct way to
exercise the parser in Sky, so we use imports.

This CL also adds a load event to <import> to determine when the import is done
loading.

R=eseidel@chromium.org

parser benchmark wip
2014-11-04 11:00:32 -08:00
Elliott Sprehn
d1382e4d41 Remove DOMImplementation.
Expose a Document constructor instead. This also exposes that
the TemplateBinding library might need more control over the
registration context for custom elements. For now we make all
documents share the same registration context.

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

Review URL: https://codereview.chromium.org/697363002
2014-11-03 23:18:39 -08:00
Ojan Vafai
79ea19ffc7 Remove margin collapsing.
Margin collapsing is a document-oriented feature. For applications
it just causes confusion and slowness.

margins.sky has failure output because offsetTop is returning the
wrong values. That's not new with this patch though. When I look
at it visually in skydb, everything seems to be in the right place.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/700743002
2014-11-03 21:30:40 -08:00
Ojan Vafai
82fe742ec2 Add the check layout framework for tests.
Also add a test for margins.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/699113002
2014-11-03 20:46:32 -08:00
Adam Barth
44ac35308c Don't GC message pipes that have an in-flight request
In mojom, there's a notion of a request/response pair. This CL teaches the JS
bindings not to GC a message pipe after a request has been issued but before
the response has been received.

R=hansmuller@chromium.org

Review URL: https://codereview.chromium.org/696373003
2014-11-03 19:05:48 -08:00
Adam Barth
0686c96cc5 Don't GC message pipes that have an in-flight request
In mojom, there's a notion of a request/response pair. This CL teaches the JS
bindings not to GC a message pipe after a request has been issued but before
the response has been received.

R=hansmuller@chromium.org

Review URL: https://codereview.chromium.org/696373003
2014-11-03 19:05:48 -08:00
Hixie
1befcbfe67 Specs: Drop the concept of late-bound elements. An element can never be upgraded.
This has the following implications:

 - There's no createElement() function any more. If you want to create
   an element from script, you have to use its constructor.

 - There's no async element registration. The parser will block until
   all the imports are imported when you use a tag name of a custom
   element that hasn't been registered yet, in case one of the imports
   defines it.

 - If you try to construct a non-registered element in markup, it
   turns into an <error> element.

 - <div>, <span>, and <error> are new built-in elements.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/695423004
2014-11-03 16:52:47 -08:00
Hixie
8193b29f3f Specs: Drop the concept of late-bound elements. An element can never be upgraded.
This has the following implications:

 - There's no createElement() function any more. If you want to create
   an element from script, you have to use its constructor.

 - There's no async element registration. The parser will block until
   all the imports are imported when you use a tag name of a custom
   element that hasn't been registered yet, in case one of the imports
   defines it.

 - If you try to construct a non-registered element in markup, it
   turns into an <error> element.

 - <div>, <span>, and <error> are new built-in elements.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/695423004
2014-11-03 16:52:47 -08:00
Adam Barth
386a980a85 Convert the directory listing to run on top of the platform
Previously we were using string concatenation to build up the directory
listing. Now we fetch some JSON from the server and use data binding to inflate
a directory listing.

This exmaple doesn't work yet because we're missing support for
template@repeat, but hopefully we'll get that soon.

Also, added support for setRequestHeader to XMLHttpRequest.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/688413005
2014-11-03 12:53:38 -08:00
Adam Barth
f8ef5ecdcc Convert the directory listing to run on top of the platform
Previously we were using string concatenation to build up the directory
listing. Now we fetch some JSON from the server and use data binding to inflate
a directory listing.

This exmaple doesn't work yet because we're missing support for
template@repeat, but hopefully we'll get that soon.

Also, added support for setRequestHeader to XMLHttpRequest.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/688413005
2014-11-03 12:53:38 -08:00
Adam Barth
ca52266ce8 Replace <link rel="import"> with <import>
This CL is just a search-and-replace.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/694423002
2014-11-03 12:34:57 -08:00
Adam Barth
175f8fdfe8 Replace <link rel="import"> with <import>
This CL is just a search-and-replace.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/694423002
2014-11-03 12:34:57 -08:00
Adam Barth
5473994cea Basic implementation of <import>
This CL adds basic support for the <import> elements. We're using the same imports
machinery as <link rel="import">, which simplifies this patch substantially.

Currently we support both <link rel="import"> and <import>. Once this CL lands, I'll
update all the existing modules and then we can drop support for
<link rel="import">.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/681983005
2014-11-03 10:14:09 -08:00
Adam Barth
5e4631f922 Add --use-osmesa flag to skydb
This flag lets us run skydb under Chromoting.

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

Review URL: https://codereview.chromium.org/697943002
2014-11-03 09:33:34 -08:00
Hixie
956d7b3efc Specs: make element registrations be per-module, define how they are
exported and reexported, rename 'interface' to 'class' in the IDL, add
constructors to all registered elements

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/695043002
2014-10-31 16:18:46 -07:00
Hixie
d00fcdf621 Specs: make element registrations be per-module, define how they are
exported and reexported, rename 'interface' to 'class' in the IDL, add
constructors to all registered elements

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/695043002
2014-10-31 16:18:46 -07:00
Elliott Sprehn
35cd5fd3e2 Remove Element#attributes.
We now implement getAttributes() such that it returns
a new set of Attr isntances on every call as well.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/697773002
2014-10-31 15:10:53 -07:00
Adam Barth
80c734eefc Switch "html" Mojo modules to the Sky module system
These never really worked with HTML imports. This CL updates them to use a more
modern version of the Sky module system so we can delete the old this.exports
pattern.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/697723003
2014-10-31 14:46:40 -07:00
Adam Barth
d11c879659 Make clicking links work in SkyDB
Now the SkyDebugger implements NavigatorHost and actually navigates the
mojo::View. This CL pulled a big refactor of sky/tools/debugger to separate out
MojoMain from debugger.cc.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/690363002
2014-10-31 13:17:15 -07:00
Viet-Trung Luu
60314d529b mojom: Remove braces from module statements and make them come first.
So, instead of:

import "bar.mojom";
module foo {
  ...
}

You'll do:

module foo;
import "bar.mojom";
...

(Note that the grammar in the parser doesn't capture the ordering
constraint. It's hard to do so while keeping the grammar LR(1) AFAICT.
So instead we enforce the ordering "manually".)

Also delete mojo/spy/PRESUBMIT.py since it's broken. We'll delete
mojo/spy separately.

R=jamesr@chromium.org

Review URL: https://codereview.chromium.org/687793004
2014-10-31 12:59:52 -07:00
Rafael Weinstein
fe0d6c747f Add initial SkyElement & city-list example
BUG=
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/698653002
2014-10-31 12:29:42 -07:00
Eric Seidel
4899c54110 Fix urls under /sky to work again
Turns out that the /sky mapping to the gen
directory was interfering with our new pattern
of mapping the actual /sky directory.

So now we use a more restrictive mapping pattern
of only mapping /sky/services, similar for
/mojo/services and /mojo/public.

Fixed an exception of not finding _sky_server
when a custom sky_server was already running.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/692163002
2014-10-31 11:46:02 -07:00
Adam Barth
5e8e6e226e Add instructions for building Release to HACKING.md
R=ojan@chromium.org, eseidel@chromium.org

Review URL: https://codereview.chromium.org/693163003
2014-10-31 11:44:03 -07:00
Eric Seidel
3d7beea154 Attempt to make skydb more user-friendly
Automatically shut-down the sky_server when quitting.
Always start the skyserver at the mojo-root
instead of the parent directory to the path.
Log when starting a sky_server outside the mojo root.
Re-use already running sky_servers when possible.

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

Review URL: https://codereview.chromium.org/679333005
2014-10-31 10:32:31 -07:00
Hixie
bcb841290f Specs: Simplify the platform by only having one shadow tree per element.
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/694613002
2014-10-31 10:16:37 -07:00
Hixie
3687a4515b Specs: Simplify the platform by only having one shadow tree per element.
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/694613002
2014-10-31 10:16:37 -07:00
Raph Levien
bb55fc47a5 am 474b009e: Move coverage bitmap from FontCollection to FontFamily
* commit '474b009ef443dbb82c1f93688613b9853ab1b396':
  Move coverage bitmap from FontCollection to FontFamily
2014-10-31 00:37:02 +00:00
Eric Seidel
2c27800c53 Add support for directory listings in sky_server.
Unfortunate these aren't very useful since we
can't actually click on links, nor do navigations
work anyway...

TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/690133002
2014-10-30 15:38:30 -07:00
Eric Seidel
b0120fd284 Make it possible to change the viewport size
This makes it possible to change the viewport size
which mojo is using.  The sky debugger uses this new
API to set the viewport to something closer to mobile
instead of 800x600 ancient desktop size. :)

Still the (800, 600) constant is prevelant throughout
mojo (just search for it) and mojo does not seem to
fully update when the viewport size changes, so we actually
only see 320x600 pixels instead of 320x640 in
sky debugger after this change.

Mostly this change is about validating that this is the
correct way to plumb this information.

R=sky@chromium.org

Review URL: https://codereview.chromium.org/692693002
2014-10-30 14:20:45 -07:00
Adam Barth
dc0521fb43 Add support for Element#getAttributes
As described in //sky/specs/apis.md

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/691893002
2014-10-30 13:55:59 -07:00
Adam Barth
681ec14ced Use module.exports rather than this.exports
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/687263005
2014-10-29 15:21:28 -07:00
Eric Seidel
aa58f474f5 Add a very minimal CSSAgent
Also fixed the exception caused by IndexedDB being
missing.  It was there, just not used by inspector.sky.

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

Review URL: https://codereview.chromium.org/662523003
2014-10-29 14:14:06 -07:00
Adam Barth
a93fd66157 Fix line numbers in JavaScript stack traces
Instead of calling the function constructor to compile script in Sky, we now
concatenate strings. This has the advantage of making the line numbers
generated in error messages correct but the disadvantage of being a hack. I've
filed https://code.google.com/p/v8/issues/detail?id=3624 to request a proper
API for this purpose.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/688033003
2014-10-29 14:00:57 -07:00
Hixie
4f47cb9215 Docs: call superclass constructors in radio.sky example
Review URL: https://codereview.chromium.org/689763003
2014-10-29 13:45:20 -07:00
Hixie
676f8185ad Docs: call superclass constructors in radio.sky example
Review URL: https://codereview.chromium.org/689763003
2014-10-29 13:45:20 -07:00
Hixie
5482eece0f Docs: Update radio.sky to use the specced API for shadow roots
Review URL: https://codereview.chromium.org/692563003
2014-10-29 13:10:33 -07:00
Hixie
3c9e2c9dd2 Docs: Update radio.sky to use the specced API for shadow roots
Review URL: https://codereview.chromium.org/692563003
2014-10-29 13:10:33 -07:00
Adam Barth
f1aae9495a Add a basic XMLHttpRequest implementation
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/690803002
2014-10-29 12:48:16 -07:00
Raph Levien
474b009ef4 Move coverage bitmap from FontCollection to FontFamily
This will significantly reduce memory usage and also speed the creation
of new font families. In particular, the coverage bitmaps for the fonts
in the fallback stack will be computed once in the Zygote, rather than
separately in each app process.

Bug: 17756900
Change-Id: I66f5706bddd4658d78fe5b709f7251ca9d2ff4f8
2014-10-29 12:34:50 -07:00
Eric Seidel
3d85f63717 Slight simplification to prompt code
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/678833004
2014-10-29 12:15:34 -07:00
Eric Seidel
535672268c Don't show sky_server logs to the skydb console
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/692593004
2014-10-29 11:03:54 -07:00