32 Commits

Author SHA1 Message Date
Adam Barth
a2aedc2d68 Move XMLHttpRequest#responseText to a getter
Moving this property to a getter lets the implementation of the object change
the value but prevents clients of the API from changing the value, which is the
expected behavior.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/746953002
2014-11-21 00:09:50 -08:00
Adam Barth
1766fb0ba7 Hide XMLHttpRequest's private state using Symbol
It's not really hidden because you can reflect out the symbols, but this is a
start. We might use a WeakMap in the future if we really need hiding.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/753473002
2014-11-21 00:00:44 -08:00
Adam Barth
1b91a2db4e Convert xmlhttprequest.sky to use classes
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/753453002
2014-11-20 23:27:53 -08:00
Yury Semikhatsky
e599443dc2 Don't send duplicate responses for debugger commands in Sky
This fixes following error in DevTools front-end:
"Protocol Error: the message with wrong id. "
and makes breakpoint persist between debugging sessions.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/746453002
2014-11-20 20:17:18 +03:00
Eric Seidel
c04c091978 Make breakpoints not crash sky
They still don't work, but at least they don't crash.

TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/742583004
2014-11-18 17:39:21 -08:00
Eric Seidel
0ca1069cd4 Add support for Page.getResourceTree
Unfortunately we don't yet have a way to walk into
imports, so this only is the first-level of the
source tree, but this is a huge step forward.

You can now click to set breakpoints, however
setting breakpoints crashes sky.

I had to fix Console.log to flush stdout
so that I could actually debug my timing-out test.

Also had to fix Chai to dump differences for deepEqual.

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

Review URL: https://codereview.chromium.org/732413004
2014-11-18 15:53:13 -08:00
Eric Seidel
593c8f8de3 Wire up more of the DebuggerAgent
The debugger can now correctly break on exceptions
and show the corresponding line in the inspector.

It correctly understands which scripts are internal
to sky and does not pause during them.

There is still a ton to make work here
(including stacktraces which I have not tested),
but basic functionality seems to work.

The current implementation is not smart enough to
unpause the inspector when the frontend disconnects.

BUG=434510,434513
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/727593004
2014-11-18 15:05:05 -08:00
Eric Seidel
a511ef074a Teach XHR how to handle relative urls.
Hixie says window.URL may not exist yet in the
sky specs, but I'm sure we'll need something like it.

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

Review URL: https://codereview.chromium.org/729913003
2014-11-18 11:15:56 -08:00
Elliott Sprehn
0ae7b5288f Improve SkyElement.
- Don't stamp the template repeatedly when attaching.
- Don't use __proto__
- Store the template in an external map instead of a property on the prototype.
- Add a created() callback.
- Allow creating a SkyElement with no associated <template> or ShadowRoot.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/715203002
2014-11-12 12:32:39 -08:00
Eric Seidel
a1bf7bae10 Make it possible to have multiple InspectorBackends
This will make it possible to connect a c++
inspector backend in addition to the JS one.

We lose the feature of running multiple inspector
servers in this patch, but we weren't using that feature
and could easily add it back if we plan to use it.

This patch has a *ton* of boilerplate code due
to crbug.com/431911, hopefully that will be fixed
soon and we can delete all the Impl nonsense.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/710043004
2014-11-11 10:29:21 -08:00
Benjamin Lerman
2cdc639a09 Change mojo url to always use mojo:foo instead of mojo://foo
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/701933004
2014-11-06 17:23:18 +01:00
Rafael Weinstein
b492557ddf fix file-browser
R=eseidel@chromium.org, abarth
BUG=

Review URL: https://codereview.chromium.org/705683002
2014-11-04 15:21:57 -08:00
Elliott Sprehn
11b2b24722 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
Adam Barth
1d55401b57 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
6002422526 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
4240a776a4 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
d07561b6cf Fix SkyElement
Adam broke this when trying to refactor it. This CL is just a partial revert of his
CL.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/689243003
2014-11-03 10:15:38 -08:00
Elliott Sprehn
5330701999 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
0b40ab943e Clean up SkyElement
There's no reason to wrap this script in an anonymous function. Sky modules
already run inside their own scope.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/692253002
2014-10-31 14:58:38 -07:00
Adam Barth
03114dfa7e 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
Rafael Weinstein
11130c9880 Minor tweaks to sky/framework/README.md 2014-10-31 14:41:52 -07:00
Rafael Weinstein
7f221ff756 add README.md
BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/695963003
2014-10-31 14:37:32 -07:00
Rafael Weinstein
8279e8603b 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
Adam Barth
e3d78d7306 Convert more this.exports to module.exports
TBR=esprehn@chromium.org

Review URL: https://codereview.chromium.org/685323003
2014-10-29 15:25:41 -07:00
Adam Barth
83f05ff8bf 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
46a584b4d3 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
243555a99e Add a basic XMLHttpRequest implementation
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/690803002
2014-10-29 12:48:16 -07:00
Eric Seidel
9e09e175f9 Add basic console support to Sky's inspector.
I think longer-term we want to instead fork
InjectedScriptSource.js:
http://blink.lc/blink/tree/Source/core/inspector/InjectedScriptSource.js
since a ton of the "remote object" logic could be shared
between Blink and Sky here.

Since we're trying to talk exactly Chrome's inspector
protocol we should start from the Blink JS as much as possible.

That said, this is enough to get the Chrome devtools
inspector to talk to sky and have the console handle
basic commands!

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/674823003
2014-10-29 08:47:10 -07:00
Adam Barth
b1f39b7c1b Move framework/inspector/server to services/inspector
Moving the inspector WebSocket proxy server out of the framework directory
simplifies the mappings for the HTTP servers.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/687673004
2014-10-28 15:38:23 -07:00
Eric Seidel
6e77ef1031 Fix the inspector and integrate it with skydb
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/690433002
2014-10-28 13:18:17 -07:00
Adam Barth
e72e95ebf6 Re-enable the inspector tests
These work again.

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

Review URL: https://codereview.chromium.org/683083004
2014-10-28 12:54:22 -07:00
Adam Barth
f0c80dc8cc Add beginnings of an inspector backend for Sky
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/687673003
2014-10-28 10:46:47 -07:00