69 Commits

Author SHA1 Message Date
Adam Barth
52becafbb9 Rebaseline tests after console spam reduction
TBR=tonyg@google.com

Review URL: https://codereview.chromium.org/1239983002 .
2015-07-16 09:43:12 -07:00
Adam Barth
ecc5134416 Remove package:sky/framework
Please use package:sky/widgets instead.

R=ianh@google.com, eseidel@google.com

Review URL: https://codereview.chromium.org/1221883002.
2015-06-30 12:01:54 -07:00
Hixie
da3e55c837 Add a test for the sector app.
This also moves the test for stocks into a new tests/examples/
directory, where we can put tests that test the examples.

TBR=abarth

Review URL: https://codereview.chromium.org/1182223004.
2015-06-17 15:44:20 -07:00
Hixie
1339d2bcc5 Clean up the tests to be more maintainable.
- removes the unit testing framework from tests that don't use it
- use 'async' where that makes the code less convoluted

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1192003003.
2015-06-17 15:10:06 -07:00
Adam Barth
a2b8ddd5c5 Settings menu item in stock2 doesn't work
The underlying problem is that we lacked a RenderObjectWrapper for the
RenderView, which meant we couldn't handle changing the RenderObject that was
the root of the RenderView. This CL introduces a RenderViewWrapper and uses it
in a new AppContainer widget root. This change allows us to make App a
non-magical Component that is inserted into the AppContainer in the newly
introduced runApp function.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1184823006.
2015-06-17 12:36:56 -07:00
Hans Muller
61b71a6f32 Styling for text fragments
This is a completion of Eric's WIP patch:
https://codereview.chromium.org/1179663005/

Low level support for creating a paragraph that contains
runs of styled text. The styles may be nested.

The Paragraph and RenderParagraph classes have been
replaced by Inline and RenderInline. Styled text is defined
with a tree of InlineText and InlineStyle objects.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1177833012.
2015-06-16 16:48:08 -07:00
Hixie
350f16c93e Rename UINode to Widget.
Also, move a widget example from examples/raw/ to examples/widgets/

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1190793002.
2015-06-16 11:09:16 -07:00
Hixie
a22064a7a3 Remove RenderSizedBox.
Make old users of RenderSizedBox use RenderConstrainedBox.
Change the semantics of BoxDecoration.apply* to actually apply the provided constraints to the current constraints, rather than the previous behaviour of merging them neutrally.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1189603003.
2015-06-15 15:51:56 -07:00
Adam Barth
219ead3718 Rename all the things
This CL moves the bulk of the SkyView code out of the |framework| directory
because the |framework| directory was redundant in Dart package import
declarations.

TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1177383006.
2015-06-13 09:46:52 -07:00
Hixie
be5a2f8bc5 Fixes tests, logic, and analyzer warnings due to recent checkins.
- Fix the expectations file for stocks, since floating action button changed how it was being drawn.
- Fix edges theme data to not use a rounded rect path for canvas material.
- Add debugging hooks for TextStyle, and fix a warning.

TBR=eseidel

Review URL: https://codereview.chromium.org/1187483003.
2015-06-12 13:25:35 -07:00
Eric Seidel
518ecd24e5 Add support for text styles.
This is a completion of Hans's WIP patch:
https://codereview.chromium.org/1176133002/

Makes it possible for us to style text in fn2 apps.

The title style in the toolbar doesn't look quite right
but as far as I can tell its the same color as the
old typography code produced.  Will need further investigation.

Fixes #213

R=abarth@chromium.org, jackson@google.com

Review URL: https://codereview.chromium.org/1178913003.
2015-06-12 12:28:52 -07:00
Hixie
406d7dbae1 Make it possible to test that the stock app doesn't crash on startup and paints the basic scaffold more or less correctly.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1177043008.
2015-06-11 15:36:40 -07:00
Eric Seidel
92fd88b73f Fix RenderParagraph to respect text color.
I don't think this is the final API we're going to use.

I suspect we'll add a TextStyle struct to hold
color and size, etc. which back-ends into CSS like
this does today.

Currently no one uses this color even though it exists.

This is one step towards fixing:
https://github.com/domokit/mojo/issues/213

R=ianh@google.com

Review URL: https://codereview.chromium.org/1162573007
2015-06-08 15:22:18 -07:00
Adam Barth
f179203848 Add support for testing content in SkyView
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1160763004
2015-05-27 13:14:08 -07:00
Hixie
9466cbbcb4 [Effen] remove the last traces of the 'display' property from the effen component library.
Previously, the fn "Text" class rendered as a single block of text.
Now, there's a "Paragraph" class that contains "TextFragment"s, and "Text" is just a component that places a single TextFragment into a single Paragraph.
This allows other components, notably the Input component, to build more complicated paragraphs of styled text, without using 'display'.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1139123007
2015-05-14 15:21:29 -07:00
Hixie
396a04df4a [Effen] Use the checkbox widget in the stocks app.
- add a checkbox to the stock app, so that we're testing the checkbox widget
  (it's not currently wired up to anything, that can come later)
- make InkSplash use FlexContainer so that we can use flex in the popup menu items
- make effen's Text be more similar to Image and Container, so that it can be styled
- make layout.dart's RenderCSSText correctly support being styled
- also fixes a bug with the stock list where we were rendering one too few a row when scrolling
- check in the code to dump the DOM so I don't have to keep remembering how to do this

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1134163003
2015-05-12 14:39:43 -07:00
Hixie
02045e37a4 [Effen] Move 'flex' out of CSS also. (mark II)
This introduces a new kind of ContentNode similar to Style but which
instead of changing the styles that apply to the node, provides new
settings to apply to the "parentData" structure.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1122413006
2015-05-12 10:40:43 -07:00
Hixie
bba43773e2 [Effen] Update test for recent fn change.
We dropped Anchor support, and the markup changed a bit (mostly it got debug='' attributes to help debug output).
TBR=eseidel

Review URL: https://codereview.chromium.org/1129883004
2015-05-08 14:05:45 -07:00
Hixie
f46c5d49d4 Fix the test broken by https://codereview.chromium.org/1078973002 by
making sure the basic.sky test exposes the right (new) DOM now that
text is always wrapped in a display:paragraph div.

BUG=85
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1083443002
2015-04-10 15:04:54 -07:00
Eric Seidel
5a8da4db70 Update test expectations
This test was failing because I changed the url.
The new url is correct.  Sorry for not running the tests
before committing.

https://codereview.chromium.org/1065073002/
https://github.com/domokit/mojo/issues/81
TBR=ojan@chromium.org

Review URL: https://codereview.chromium.org/1075603002
2015-04-08 12:25:07 -07:00
Eric Seidel
cb473bbf48 Attempt to de-flake tests/framework/basic.sky
new Image() is likely to cause the image to try
and load as soon as the underlying Image element
is inserted into the real DOM.

This at least points it at a real image so that
it won't dump 404 response text into the test
output if the image load kicks off before the test
completes.

Example:
http://build.chromium.org/p/client.mojo/builders/Mojo%20Linux%20NaCl/builds/1130/steps/Sky%20tests/logs/stdio

R=ianh@google.com, ojan@chromium.org

Review URL: https://codereview.chromium.org/1065073002
2015-04-07 15:53:19 -07:00
Hixie
98af3d0dee Issue 1043283003 changed the framework class names but I missed the test.
R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1056663002
2015-04-01 13:49:05 -07:00
Adam Barth
e8907cd059 Remove flights example
Flights is not longer a good example of something you can build wity Sky.
Restore the flights-app-pixel test and move the assets needed for the test into
the tests directory.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1034953003
2015-03-26 13:28:23 -07:00
Rafael Weinstein
36ad366ba0 [Effen] Add a basic layout test
BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1038583003
2015-03-25 10:53:51 -07:00
Rafael Weinstein
3c70e47312 Removing Sky JS Framework tests
BUG=
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1023213003
2015-03-20 14:04:34 -07:00
Eric Seidel
8be96a9e8d Move sky-*.sky into framework/elements
We're not actively developing these at the moment.

I could also just delete them, not sure if we're ready for that yet.

TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/999873002
2015-03-11 13:50:09 -07:00
Adam Barth
0c35024cef querySelectorAll should return List<Element>
... instead of NodeList.

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

Review URL: https://codereview.chromium.org/943433002
2015-02-19 09:39:59 -08:00
Etienne Membrives
8076312a7d Fix Sky tests
R=qsr@chromium.org

Review URL: https://codereview.chromium.org/940983002
2015-02-19 18:14:13 +01:00
Adam Barth
f2d2e80e59 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
Ojan Vafai
9ce3ec9139 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
1265ead597 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
Ojan Vafai
b4c4004f56 Merge outline paint phases into the foreground phase.
Mostly just mechanical changes. The one surprising bit
is that RenderLayer no longer needs to explictly paint
outlines. I tested manually that before this patch,
the paintOutline call in RenderLayer was needed for
outlines on positioned elements and that after this
patch it's not.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/878023002
2015-01-27 17:45:04 -08:00
Adam Barth
63b6ffb281 Normalize import paths for Sky modules
This CL simplifies the sky_server to only map the build directory into /gen,
which will make the deploy script simpler. This CL updates all the imports to
use the /gen prefix when referring to generated files.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/881093003
2015-01-27 17:04:40 -08:00
Adam Barth
7087239480 Rebaseline tests after removing RenderLayerScrollableArea 2015-01-27 10:25:45 -08:00
Colin Blundell
f8aeeb7a7e 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
7f9fb852f9 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
d3ea308c89 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
480ca1d4dd 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
Elliott Sprehn
0275d42ac7 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
Elliott Sprehn
9612dcf25f 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
49e664d6ac 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
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