Commit graph

16114 commits

Author SHA1 Message Date
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
Hixie eedc2410f2 Specs: Simplify the paint model. Now you are not responsible for
actually telling your child to paint, you just say where it would
paint. The platform then takes care of making sure all the dirty nodes
have their paint() methods called.

Review URL: https://codereview.chromium.org/744843003
2014-11-20 15:30:30 -08:00
Hixie edcbad7686 Specs: update the layout and paint schemes to match discussions better
Review URL: https://codereview.chromium.org/745863002
2014-11-20 13:58:53 -08:00
Ojan Vafai 85817b24a0 First step at getting rid of anonymous blocks and continuations.
-Add RenderParagraph and display:paragraph. This is the only
render type that's allowed to contain inlines or text.
-If you put text nodes directly in a non-paragraph, wrap them
in an anonymous paragraph. This may not be the place we want
to end up, but it's a good stopgap to make it so we don't
crash in this case.
-Make StyleAdjuster force that non-paragraph blocks only contain
RenderBlock subclasses and that paragraphs and inlines only contain
inlines.
-Considerably simplify addChildIgnoringAnonymousColumnBlocks
now that we only create anonymous blocks for the case of
text nodes in non-paragraphs. Also get rid of the behavior
where we try to group multiple nodes into a single
anonymous block.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/729693003
2014-11-17 18:39:52 -08:00
Hixie 2556b66620 Specs: Define when needsLayout is reset (also, some unrelated markdown fixes)
Review URL: https://codereview.chromium.org/732243002
2014-11-17 15:43:31 -08:00
Rafael Weinstein 1496dcfafa Fix bad reference in city-list
TBR=esprehn
BUG=

Review URL: https://codereview.chromium.org/730283002
2014-11-17 14:57:15 -08:00
Hixie fd1e8ff53d Specs: Fix markdown errors
Review URL: https://codereview.chromium.org/730273002
2014-11-17 14:54:01 -08:00
Hixie 30ba272a0a Docs: copy/pasta left a type annotation from the IDLs in an example
Review URL: https://codereview.chromium.org/732163003
2014-11-17 14:24:33 -08:00
Hixie 8d2b5c3b1d Specs: make sure all layout/paint/hitTest APIs are relative to the right coordinate space
Review URL: https://codereview.chromium.org/725203007
2014-11-17 13:55:45 -08:00
Hixie 1316326183 Docs: duplicate ID in example
Review URL: https://codereview.chromium.org/735533002
2014-11-17 13:41:41 -08:00
Hixie 48b49a8cbe Specs: default exports to {} rather than document, since it makes writing modules saner
Review URL: https://codereview.chromium.org/730223002
2014-11-17 13:08:09 -08:00
Elliott Sprehn fe9b9d21d4 Add a version of flights that's made of components.
Also add a test, this checks nested Shadow DOM and <content> with
and without select.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/725763003
2014-11-14 15:00:12 -08:00
Hixie 3d06e2a4e7 Specs: hit testing (and some cleanup)
Review URL: https://codereview.chromium.org/727993002
2014-11-14 14:35:55 -08:00
Hixie f8340b77ef Specs: Initial hack at extensible style/layout
Review URL: https://codereview.chromium.org/716013002
2014-11-13 14:00:46 -08:00
Benjamin Lerman af585507a0 Revert "Add a version of flights that's made of components."
This reverts commit e8fdb90bca3120d1c991256a2adf83a8315bf867.

This CL breaks the linux bots:
https://chromegw.corp.google.com/i/client.mojo/builders/Mojo%20Linux/builds/216/steps/mojob%20test/logs/stdio

TBR=esprehn@chromium.org

Review URL: https://codereview.chromium.org/722103002
2014-11-13 09:59:26 +01:00
Elliott Sprehn a1d1c3e4fb Add a version of flights that's made of components.
Also add a test, this checks nested Shadow DOM and <content> with
and without select.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/724613002
2014-11-12 18:42:24 -08:00
Elliott Sprehn f9a8fd51ee Add the flights app scaffolding demo.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/720593002
2014-11-11 16:37:04 -08:00
Rafael Weinstein 4fd0160716 Add city-list example tests to sky
BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/708633002
2014-11-05 17:58:57 -08:00
Hixie f1f2a12b97 Docs: Experimental 'button' widget, work in progress
Review URL: https://codereview.chromium.org/700023003
2014-11-04 17:27:58 -08:00
Rafael Weinstein 018e6ba3bb fix file-browser
R=eseidel@chromium.org, abarth
BUG=

Review URL: https://codereview.chromium.org/705683002
2014-11-04 15:21:57 -08:00
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 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 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