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
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
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
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
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
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
-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
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
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
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
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
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
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