28 Commits

Author SHA1 Message Date
Elliott Sprehn
a55bb9341f Make flights-app-pixels pass again.
TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/868443002
2015-01-21 14:30:26 -08:00
Adam Barth
f339e86f95 Delete blink::ImageQualityController
Instead, always use InterpolationLow. In Skia, that boils down to bilinear,
which is fast on GPUs. We should eventually let authors control the
interpolation quality in case they want pixelation, etc.

This CL saves 6.3% on Layer::RecordPicture for flights-app.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/860843006
2015-01-21 11:29:41 -08:00
Ojan Vafai
554ccd0de1 Deflake flights-app.sky.
We need to wait for the images to load.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/817853006
2015-01-15 17:40:48 -08:00
Elliott Sprehn
5ef6774cd9 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
Elliott Sprehn
0a258c1921 Allow on-* event handlers on <sky-element>.
Now instead of calling addEventListener inside the created() callback you just
add on-{eventName} attributes to the <sky-element> around your element
definition. The attribute defines what method on your element to call when the
event with {eventName} is dispatched through your element.

Implementing this required refactoring how sky-element.sky stored information
from each registered element. Now instead of storing just a map of templates
we store a map of ElementRegistration objects which have metadata about the
element. Future patches will combine this system with the element registration
system in sky-binder.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/845283003
2015-01-12 18:25:22 -08:00
Ojan Vafai
8cdbb99aa9 Deflake flights-app-pixels.sky.
We were dumping pixels before the images loaded.
Instead, dig into the shadow root and only
dump the pixels once all the images have loaded.

This isn't an awesome solution for a real app,
but it's good enough to deflake this test since
all the images happen to be one shadow root deep.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/792883008
2015-01-09 19:05:32 -08:00
Ojan Vafai
81fe9184ff Fix renderName on RenderBlock and RenderParagraph.
RenderBlock should indicate when something is an inline-block.
RenderParagraph should not print out RenderBlock.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/828433004
2015-01-08 17:14:17 -08:00
Elliott Sprehn
a25c88d9c6 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
Ojan Vafai
9629178ee6 Make a reftest for the flights app.
This way we get some broad pixel test coverage.
Do this by dumping the png from the flights app,
uploading it to google storage and then having
the reference file load the uploaded file.

This isn't a good long-term solution. Long-term
we should dump paint commands (or some other
textual representation) and/or make more targetted
reftests that don't need pngs. As such, the process
for doing this is painful and manual. If we decide
we want to have pixel tests properly, we'll want
to do something more automated obviously.

Also, turn on the discard_transparency bool when
encoding the pngs. Otherwise, the png is lossy
and none of this works.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/836363003
2015-01-07 11:40:27 -08:00
Elliott Sprehn
6d61fe6ce8 Automate reflected properties in SkyElement.
Now you can use the attributes attribute on <sky-element> that
accepts a set of name:type comma separated pairs to control
the reflected attributes. ex. attributes="size:number"

Each attribute creates a getter and a setter on the element that returns
the correct type and will coerce the string attribute values into the
right type. It also correctly hooks into the data binding system.

A new callback is added: {name}Changed(oldValue, newValue) which will
be invoked whenever the attribute with that name changes and gets the
correctly coerced type values. See the <sky-radio> or <sky-checkbox>
widgets for examples of using the new callback.

Number attributes default to 0, booleans to false, and strings to empty
string. There is no way provided to set a different default, for that you
can use hasAttribute in the created callback to conditionally set a value.
Don't just assign the property there otherwise you'll overwrite the value
from the parser.

Another behavior change from making this work is that now attributeChanged()
is called for each attribute, even when the element is created by the
parser.

Overall this allows a nice simplification to the <sky-button>,
<sky-radio> and <sky-checkbox> widgets.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/836923002
2015-01-05 20:12:58 -08:00
Elliott Sprehn
ceb4dbc927 Fix detached callback and add isAttached to SkyElements.
There was a typo in the name of the detached callback which is now fixed,
and also allow querying if an element is attached.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/806133003
2015-01-05 12:54:43 -08:00
Elliott Sprehn
213c093956 Add a basic SkyBinder test.
TBR=ojan@chromium.org

Review URL: https://codereview.chromium.org/831033002
2015-01-02 19:56:45 -08:00
Elliott Sprehn
d3fbe58e94 Add shadowRootReady callback for SkyElement.
This is called right after stamping the template into the ShadowRoot.
This is a useful place to querySelector/getElementById for elements
inside the ShadowRoot.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/817053002
2014-12-19 14:01:49 -08:00
Elliott Sprehn
c7d8c77498 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
Eric Seidel
a9776838ee Add POST support to XHR as well as .status and statusText support
Also fixed all the XHR tests to actually run and work
I learned from elliot that the it function has to
take a "done" argument to be treated asynchronously.

My utf8 conversion is a hack, but we deleted
window.TextEncoder (it was a module) when we forked.
We could resurrect TextEncoder (and probably should)
but I've left that for a separate change.

I also augmented sky_server to have a special /echo_post
handler so we can test POST requests.

R=esprehn@chromium.org
BUG=

Committed: 5ef81d249b

Review URL: https://codereview.chromium.org/810523002
2014-12-16 11:20:40 -08:00
Eric Seidel
1fb39d65dd Revert "Add POST support to XHR as well as .status and statusText support"
This reverts commit 5ef81d249b841f44c9593ffb0158d64c7e0febfc.

This appeared to make 5 XHR tests timeout.  Not sure why yet.
TBR=esprehn@chromium.org

Review URL: https://codereview.chromium.org/808663002
2014-12-15 18:37:44 -08:00
Eric Seidel
6f33a75051 Add POST support to XHR as well as .status and statusText support
Also fixed all the XHR tests to actually run and work
I learned from elliot that the it function has to
take a "done" argument to be treated asynchronously.

My utf8 conversion is a hack, but we deleted
window.TextEncoder (it was a module) when we forked.
We could resurrect TextEncoder (and probably should)
but I've left that for a separate change.

I also augmented sky_server to have a special /echo_post
handler so we can test POST requests.

R=esprehn@chromium.org
BUG=

Review URL: https://codereview.chromium.org/810523002
2014-12-15 16:09:51 -08:00
Eric Seidel
e2271c6dfa Fix test expectations
TBR=ojan@chromium.org

Review URL: https://codereview.chromium.org/800103002
2014-12-12 12:53:01 -08:00
Eric Seidel
6bd317d504 Add responseType='arraybuffer' support to XHR
Also moved existing XHR tests from tests/services
to tests/framework to better match the location
of the XHR code itself.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/805503002
2014-12-12 12:03:50 -08:00
Ojan Vafai
7a37fa8c09 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
Elliott Sprehn
8409c0e386 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
Benjamin Lerman
9894ef82e0 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
b9a6e48dcb 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
36d65ae442 Fix test expectations.
After fixing flexbox margin and padding I didn't rebaseline the tests.

TBR=ojan@chromium.org

Review URL: https://codereview.chromium.org/710423002
2014-11-11 13:52:50 -08:00
Rafael Weinstein
8195427269 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
Rafael Weinstein
3eb5be249e Remove ArrayFuzzer from observe.sky test (was timing out).
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/695413003
2014-11-03 12:49:41 -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
Rafael Weinstein
40ce06f206 Added tests for observe.sky
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/694323003
2014-11-03 10:41:34 -08:00