Commit graph

34186 commits

Author SHA1 Message Date
Adam Barth a5e01b1521 Add initializeFromShellProxy to application.dart
This CL adds the ability to initialize the Dart Application class with a shell
proxy (rather than with a MojoHandle). This change lets Sky use the Dart
bindings for Mojo.

This CL was reviewed on the SkyDart branch in
https://codereview.chromium.org/919883002/

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

Review URL: https://codereview.chromium.org/922083002
2015-02-12 23:36:40 -08:00
Adam Barth deedba409a 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 5f719fecde Extend the sky color picker example
Displays the last six selected colors.

BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/897683002
2015-02-04 09:30:47 -08:00
Hans Muller ae503019b7 A simple Sky color chooser example. The color-picker is
two components: color-wheel, and color-picker which adds
a div that displays the selected color. Data binding is
used to connect the color-wheel's "color" property to the
sample div's background-color.

BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/872993006
2015-02-02 09:01:47 -08:00
Adam Barth 249bb59f25 This CL adds an "appish" example to the Sky examples, including a drawer widget.
R=eseidel@chromium.org, esprehn@chromium.org

Review URL: https://codereview.chromium.org/886723002
2015-01-29 11:21:39 -08:00
Ojan Vafai 45d7d34530 Add a selection and outline to flights-app.
This is just to get basic paint coverage of selections
and outlines on positioned elements.

TBR=esprehn@chromium.org

Review URL: https://codereview.chromium.org/886683002
2015-01-28 21:48:28 -08:00
Rafael Weinstein 931f29c80e Fix city-list example after changes to scrolling.
Note that this patch only includes support for the wheel event.
I'll follow-up with a patch for scrolling/fling when I have a setup
on which I can verify that working.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/875473004
2015-01-28 16:56:25 -08:00
Eric Seidel cfd21dfd13 Add a very basic deploy script for mojo.
We could do something much more sophisticated for deploy in the future.

Also add #!mojo:sky_viewer to .sky file demos

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/885653006
2015-01-28 11:00:52 -08:00
Adam Barth 00842383fd 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 46334e2e32 Add wheel support to sky-scrollable
This CL plumbs wheel events through Sky again and uses them in sky-scrollable.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/876853005
2015-01-27 09:58:22 -08:00
Colin Blundell 73f0a8d121 Revert "Add a close box to flights-app toast."
This reverts commit ffcbc3b2f5417b09328eae4aeb8de2e5eab6324d.

This test broke sky_tests:

Regressions: Unexpected text-only failures (6)
  framework/flights-app.sky [ Failure ]

Example:

http://build.chromium.org/p/client.mojo/builders/Mojo%20Linux%20ASan%20%28dbg%29/builds/173/steps/Sky%20tests/logs/stdio

TBR=ojan

Review URL: https://codereview.chromium.org/880863002
2015-01-27 10:11:41 +01:00
Ojan Vafai 55b9f393c1 Add a close box to flights-app toast.
This is to get a case of having an outline on an
absolutely positioned, overflow:hidden, i.e. a
self-painting layer.

TBR=esprehn@chromium.org

Review URL: https://codereview.chromium.org/878873002
2015-01-26 22:54:39 -08:00
Ojan Vafai 09ffab7233 Fix border painting on self-painting layers.
Commit efc3afd428bd85fd3d12e0dc941b5eb7248ca30b broke it because
we'd computed an empty foreground layer. Now that background
painting is part of the foreground phase, we need to use the
background rect for clipping. As best I can tell, the
background rect is always >= the size of the foreground
rect, so it should be safe to use.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/876243002
2015-01-26 22:45:30 -08:00
Ojan Vafai 609cf2e8d9 Add a gratuitous outline to flights-app.
This is so we have minimal coverage of outline painting.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/878803002
2015-01-26 16:40:40 -08:00
Adam Barth 435b203406 Add a basic sky-scrollable element that scrolls
We still need to polish sky-scrollable, but it basically works.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/875953004
2015-01-26 13:29:38 -08:00
Elliott Sprehn 66e6949f46 module.exports should default to an empty object.
Per the spec in modules.md the exports property should default to an
empty object. We lazy allocate it so that modules that just replace it
don't create the empty object and then throw it away.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/872043003
2015-01-26 11:38:04 -08:00
Adam Barth 8260024b38 Move city-list data into a separate module
This way other scrolling demos can share the data.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/876763002
2015-01-26 09:41:25 -08:00
Adam Barth 451778fdce Move sky-box,-button,-checkbox,-radio out of their directories
Instead of having a separate directory for every Sky element, we should just
put them in the general framework directory. Once the framework is more
complicated, we'll probably want to organize it a bit better, but for now there
aren't enough files to justify having so many directories.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/874303003
2015-01-26 09:20:25 -08:00
Elliott Sprehn d439820922 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 106c532257 Remove touch events from Sky
We use pointer events instead.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/868133003
2015-01-23 12:41:56 -08:00
Elliott Sprehn 0b73de95da Don't set expression attributes before they're bound.
We were cloning elements with all the attributes that contained
expressions like attrName="{{ foo }}" which meant we'd go through the
reflection process converting that value and also call the
attrNameChanged() callback and the attributeChanged() with the braced
string which the element didn't really want to know about.

After this patch we create a "clone source node" which is a copy of the
original element without the attributes that have the expressions and
use that when cloning, then we assign the properties using data binding
later.

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

Review URL: https://codereview.chromium.org/868973002
2015-01-22 17:04:10 -08:00
Adam Barth fbc45545df Change background-repeat default to no-repeat
Previously, if you had a generated background image and a translucent (or
rounded) border, we would draw the image nine times because we would inflate
the fill rect to draw behind the border. With no-repeat, we only draw the image
once.

This saves 4.5% of record time on flights-app.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/844193009
2015-01-21 16:42:26 -08:00
Elliott Sprehn 8c9486fc71 Reuse the DOM in the <fps-counter>.
Instead of storing primitive values which makes the data
binding system throw away DOM each time we update each slot
lets just use objects and shift + pop. This means very little
data binding churn.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/802153004
2015-01-15 22:02:35 -08:00
Elliott Sprehn 42a7db75ec Turn on harmony arrays and regexp.
adamk@ says these are pretty stable.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/845403009
2015-01-15 17:12:17 -08:00
Elliott Sprehn b9aac0ada7 Add two way data binding.
All reflected attributes two way bind on SkyElement, so now doing
<sky-element name="sky-input" attributes="value:string"> is enough
to get two way binding on the value attribute so users doing
<sky-input value="{{ inputValue }}"> will get the inputValue property
updated as the user types.

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

Review URL: https://codereview.chromium.org/850383002
2015-01-15 15:03:44 -08:00
Adam Barth ed73bbb5ee Fix fips-counter in touch-demo.sky
TBR=ojan@chromium.org

Review URL: https://codereview.chromium.org/813133010
2015-01-15 11:11:38 -08:00
Adam Barth f3d9715455 Add a fps-counter widget to some Sky demos
This CL makes some Sky demos more interesting and adds an fps-widget to see how
fast they run.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/803283006
2015-01-14 15:50:59 -08:00
Adam Barth c57eec3baa Remove outdated hack from flights-app
We don't need this hack anymore.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/853593002
2015-01-13 16:41:20 -08:00
Hixie 7598f1fd3c Examples: move markAsLaidOut() to just before the return, so the asserts work
Specs: introduce layoutDescendants() to avoid work when a layout
manager is unaffected by its childrens' intrinsic dimensions
Examples: update for layoutDescendants() change
Specs: add "lifetime" to resolver settings so that a transition can
avoid having to dirty every consumer of the property every frame when
it only needs to update the objects that are changing that frame
Specs: expose the parents on AbstractStyleDeclarationList subclasses
Specs: fix documentation around autoreap
Specs: fix definition of setProperty()
Specs: clean up the dimension-related logic of layout managers

Review URL: https://codereview.chromium.org/850593003
2015-01-13 11:25:24 -08:00
Adam Barth 6646821d57 Add support for touch events to sky_viewer
This CL adds conversion routines for touch events to sky_viewer so that Mojo
touch events actually show up in the platform.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/847873003
2015-01-12 15:18:16 -08:00
Hixie fcec023701 Specs and Docs: minor updates to fix mistakes I found when proof-reading
Review URL: https://codereview.chromium.org/845053002
2015-01-09 13:46:58 -08:00
Elliott Sprehn 4002105ad9 console.error when using unknown attributes in templates.
Log an error whenever an element has an unknown attribute in a template.
This means you can't use generic attributes like Polymer, but we
probably want to discourage that anyway since attribute selectors should
be avoided for most things.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/845523004
2015-01-08 16:52:12 -08:00
Adam Barth d58e6de7b2 Add the #!mojo to spinning-square.sky
TBR=jamesr@chromium.org

Review URL: https://codereview.chromium.org/840133002
2015-01-08 16:47:32 -08:00
Elliott Sprehn dfba1a80ac Prevent expandos on all SkyElements.
Expandos make v8 sad, lets not allow them.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/835353004
2015-01-08 15:30:18 -08:00
Adam Barth 8ac50c62ca Implement <sky-input>
This CL contains a basic input element.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/831353003
2015-01-08 13:22:00 -08:00
Scott Violet ed3cbb541e Changes magic sequence to '!#mojo ' and strips 'mojo ' when building url
Prior to this change the magic sequence was '#!mojo:' and the url of the content handler app included mojo:. This works only for mojo: urls, but we want
other schemes. So, the magic sequence is now '#!mojo ' and 'mojo ' is not part of the resulting url.

R=aa@chromium.org

Review URL: https://codereview.chromium.org/821403003
2015-01-08 10:19:52 -08:00
Hixie 79a529c6d9 Specs: custom element constructor argument shouldn't clash with the module-global 'module' identifier
Review URL: https://codereview.chromium.org/829133003
2015-01-07 14:39:58 -08:00
Eric Seidel f8cce94873 Fix home.sky's #! to modern style
TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/844443004
2015-01-06 17:05:30 -08:00
Hixie 9d70f573e4 Specs: registerElement(registerElement(...)) failed to work as expected
Review URL: https://codereview.chromium.org/836153005
2015-01-06 13:23:04 -08:00
Elliott Sprehn 00f2a53738 Improve the appearance of <sky-checkbox>
The unicode char never showed up for me, lets do what polymer does for
now.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/836723006
2015-01-05 14:28:16 -08:00
Elliott Sprehn e1e7110716 Add declarataive event handlers.
Now inside the <template> of a SkyElement you can use
on-eventName="method" on any element to add event listeners.

For example you can write <sky-button on-click="handleClick">
and then define handleClick(event) on the element class that
contains the button.

In adding this and tests I also realized that property bindings
were not setup on the initial call to bind(), which is now
fixed in this patch (See change to Node.prototype.bind).

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

Review URL: https://codereview.chromium.org/812713005
2014-12-19 13:10:16 -08:00
Elliott Sprehn ea93d43e64 Fix widgets demo.
It was missing the as attribute for the SkyElement import.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/789703007
2014-12-18 13:32:35 -08:00
Eric Seidel be756e7329 Add super-basic sky widgets.
Eventually we'll want to replace these with something
fancier like polymer, but this exercise helped us
find several bugs in the engine as well as
removed one more blocker from using Sky to
replace mojo/views usage in mojo/examples.

R=esprehn@chromium.org
BUG=443439

Review URL: https://codereview.chromium.org/809233002
2014-12-18 13:01:43 -08:00
Elliott Sprehn 5f6c32c247 Make SkyElement more classy.
The syntax for implementing a SkyElement is now:

<sky-element name="element-name">
<template>
  <!-- template here -->
</template>
<script>
module.exports = class extends SkyElement {
  attached() {
     // ...
  }
  // .. methods here ..
}.register();
</script>
</sky-element>

The register() static method on SkyElement subclasses calls
document.registerElement() and returns the generated constructor.
It uses the parent <sky-element>'s name attribute to set the name
of the element.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/788943003
2014-12-16 16:28:28 -08:00
Rafael Weinstein 8cd1801dc7 Fix Animations, Remove Compostior Animations.
This patch (re)hooks up animations so they start and removes the infrastructure required by blink to synchronize the compositor and main threads.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/772673002
2014-12-02 14:37:55 -08:00
Rafael Weinstein 76ef4db5e4 fix the fix to city-list example autoscroll
TBR=esprehn

Review URL: https://codereview.chromium.org/760403002
2014-11-27 12:44:24 -08:00
Rafael Weinstein 034e19300d Fix bug in city-list autoscroll
TBR=esprehn

Review URL: https://codereview.chromium.org/759483003
2014-11-24 18:27:49 -08:00
Rafael Weinstein a0df465d10 Add auto-scroll option to sky city-list example
TBR=esprehn

Review URL: https://codereview.chromium.org/758753003
2014-11-24 16:15:19 -08:00
Adam Barth 7da267c48b Add a basic example of a spinning square
This example will let us test basic animation performance.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/748853004
2014-11-21 13:27:09 -08:00
Hixie 173b73535b Docs: fix the hitTest() logic for display:toolbar since it doesn't use size 0x0 for its hidden children
Review URL: https://codereview.chromium.org/741313002
2014-11-20 15:50:43 -08:00