Previously, they always started at the center of the RenderInkWell. Now we
remember the local coordinates we computed during the hit test and provide that
information when handling the event.
R=ianh@google.com
Review URL: https://codereview.chromium.org/1180553002.
This also removes one bit of magic to make it more obvious what on is
going on during a sync, which should hopefully help.
Components have to decide if they support being stateful or not. If
they do, then they must implement syncFields() and have mutable
fields; if they don't, then they must have final fields. This isn't
particularly enforced, though.
This also renames _willSync() to _retainStatefulNodeIfPossible(), for
clarity, and fixes some minor style issues and one typo that was
breaking the drawer.
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1174023003
This CL replaces the (non-working) components2 InkWell with some code based on
the ink_well example. There are at least two issues with the implementation:
1) The ink splash always starts at the center of the well because we don't have
a facility for converting from global to local coordinates, which means we
can't tell where the tap occurred in the local coordinates we need to use
for painting.
2) When used inside a MenuItem, the in splash disappears shortly after
starting, presumably because the button starts highlighting, which causes a
component rebuild and somehow we lose the RenderInkWell instance.
I plan to address these issues in subsequent CLs.
R=ianh@google.com
Review URL: https://codereview.chromium.org/1172033003.
StockRows are now a relatively simple application of flex layout.
The up/down arrows are now rendered within a circle, like
the original version. The arrows are a little bigger,
because.
R=ianh@google.com
Review URL: https://codereview.chromium.org/1165223005.
We already know how to talk to the network_service from Dart
via fetch.dart. Might as well use that for Image loading
as well insetad of having ImageLoader do it.
As part of this I've renamed *ImageLoader to *ImageDecoder
and moved all the image loading logic into Dart. This required
me to teach the idl system about mojo handles so that I could
pass the resulting MojoHandle from fetch.dart up through to
ImageDecoder.
R=abarth@chromium.org, jackson@google.com, hansmuller@google.com
Review URL: https://codereview.chromium.org/1173703002.
This CL splits getIntrinsicDimensions into getMinIntrinsicWidth,
getMaxIntrinsicWidth, getMinIntrinsicHeight, and getMaxIntrinsicHeight so that
we can properly shrink-wrap the stocks app menu. This CL just contains the
refactoring. The use in stocks app will come in a later CL.
R=ianh@google.com
Review URL: https://codereview.chromium.org/1167293003
The popup menu is displayed in the wrong location with the wrong width, but it
does draw. I've also removed the checkbox because the flex container was
causing me trouble. I'll add it back in a later CL.
R=ianh@google.com
Review URL: https://codereview.chromium.org/1166153002
This includes making SizedBox default to infinite size, and making
Container default to containing one infinite-sized SizedBox. That way,
you can use an empty Container as a spacer in a flex box.
The rendering doesn't quite work, because of a bug in flex whereby it
doesn't shrink-wrap its contents in the cross-direction, it fills the
parent. Collin is on that.
R=jackson@google.com
Review URL: https://codereview.chromium.org/1163633003
I had to complicate the IDL bindings generation to allow passing an array of
colors. Without these changes, we'd try to convert the dart object to
Vector<SkColor>, which C++ thinks is Vector<unsigned>, and we'd use the wrong
converter. So I added some template grease to force it to use a
Vector<CanvasColor> converter.
R=eseidel@chromium.org
Review URL: https://codereview.chromium.org/1152963009
Also, make the scaffold code more generic (with slots in a map,
instead of dedicated members for each slot).
This may eventually benefit from being split into a general
"multislot" superclass and a scaffold-specific subclass, but for now
it'll do.
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1152163007
This CL is a first pass at implementing container in fn2. In this approach,
Container is a Component that builds a number of RenderNodeWrappers depending
on what is needed.
R=ianh@google.com
Review URL: https://codereview.chromium.org/1158983005
Prevously we listened for events on the document and then walked up the
component hierarchy looking for EventListenerNodes. Now we do something similar
by hooking the event dispatching logic in the AppView.
R=eseidel@chromium.org
Review URL: https://codereview.chromium.org/1153343004
We'll eventually turn this into a full fn2 component, but for now it's just an
example.
To make this work, I created a schedule.dart as a start to implementing
scheduler.md. For now, I've kept the API similar to the web platform so that
the old world can continue use it backed by sky.window.requestAnimationFrame.
R=eseidel@chromium.org
BUG=
Review URL: https://codereview.chromium.org/1145973009
This dramatically simplifies the layout model.
I haven't gone through and simplified the existing functions, we should probably go through and figure out if they can be cleaned up a bit.
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1161983004
I had to add back document.createText() since new Text()
does not work in the new world yet.
LayoutRoot is a new Dart-exposed class which holds the Frame and
all associated machinery, sufficient to trigger a restyle
and layout of the subtree.
This is all kinda hacky and I'm sure likely to cause many
crashes if folks call random methods on these disconnected
trees.
But this makes it at least possible to paint text for now
and we can improve this in the coming days.
This really should have Adam's review. It's hugely hacky
but I'd like to negotiate out with him the timeline on
which we should fix some of these hacks.
R=ianh@google.comTBR=abarth@chromium.org
Review URL: https://codereview.chromium.org/1148253003
- makes the event logic not involve a boolean return value (since we ignored it anyway)
- splits the event handling logic into two steps, hit testing and event dispatch
- introduces an App class on the Dart side to factor out the interaction with the C++ side
- ports sector-layout and simple_render_tree to the new App infrastructure
- port simple_render_tree to the new event handling logic
- implement hit testing for the sector-layout demo
R=eseidel@chromium.org
Review URL: https://codereview.chromium.org/1143343004
- the circle now fills the screen
- you can set dimensions on the solid color node
- debugging printfs and rects are gone
- the protocol is changed so that for sectors, you position before you size (since your size and your childrens' positions all depend on your own position)
TBR=abarth
Review URL: https://codereview.chromium.org/1154213003
This only handles really basic cases and doesn't understand
justification, wrapping, and so on. Submitting for code
review so I can get some early feedback before I invest
more time into making it correct.
R=ianh@google.com, abarth
Review URL: https://codereview.chromium.org/1151293002
Changes:
- adds a couple of radio buttons to the drawer menu list.
- makes menu items support being tapped and reporting the tap.
- hooks up the checkbox to actually support being checked.
- changes the drawer menu items to make more sense in a stock app.
R=eseidel@chromium.org
Review URL: https://codereview.chromium.org/1137373004
This exposes most methods from Skia's C canvas API to Dart. For now, SkRect and
SkMatrix are represented simply as an array of floats, which requires a
conversion at the bindings layer. More complex types like SkPath are still TODO.
R=eseidel@chromium.org
Review URL: https://codereview.chromium.org/1144483002
This adds a new abstract 'Canvas' which is similar to SkCanvas.
PaintContext implements Canvas while still having its
own commit() method to cause the paint actions to apply to
the Element for the next frame.
This adds a new PictureRecorder which also implements Canvas
and has an endRecording() method which returns a Picture
(another new interface) which can be held from Dart.
There is also now a rootPicture setter on Document which takes
a Picture and will then make the Document draw that Picture
until changed.
This piggybacks on the existing custom painting system
which adds the painting at background-and-borders paint
time so technically if you both set rootPicture as well as
construct a DOM you will draw the DOM on top of your picture. :)
R=mpcomplete@chromium.org
Review URL: https://codereview.chromium.org/1122423009
- 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
- make the ScrollBehavior instance long-lived, rather than recreating
it each time we update the list contents.
- have OverscrollBehavior track the total height of the contents and
the height of the scrollable region, so that it can determine when
to stop scrolling down.
- teach OverscrollBehavior about how to determine when to stop
scrolling down, and how to bounce when it's too far down.
- replace the 'energy' concept in Particles with a method that sets
the energy and direction at the same time, instead of assuming that
the direction is always positive when setting energy.
- make FixedHeightScrollable lists track the number of items in the
list and have them update their ScrollBehavior regarding this
information as it changes.
- track how many items are currently showing in the list stock list.
R=eseidel@chromium.org
Review URL: https://codereview.chromium.org/1097373002
Currently, if you then scroll down N items with a filter set, we select which
stock to show by taking the entire list of stocks, skipping the first N, then
filtering the list, then selecting as many stocks as needed to fill the list.
So suppose the list is A, B, Cx, Dx, Ex, F, and the filter is "x", and you've
scrolled down 1 item.
Currently we'd show Cx, Dx, Ex.
Scroll down 1 again.
We still show Cx, Dx, Ex.
What we _should_ show is Dx, Ex if you've scrolled down 1, and just Ex if you've
scrolled two.
This patch fixes this. We now skip rows _after_ filtering. This fixes
the bug whereby if you set a filter then fling the list, we show the
same item over and over as if in a loop.
R=eseidel@chromium.org
Review URL: https://codereview.chromium.org/1057603006
Text can only only inside paragraphs and inlines. This patch makes it
so we stop putting such text nodes in the render tree at all if their
parent is not a paragraph or an inline.
This is the final step in making it so that we don't create anonymous
renderers, which fixes a crash in the new custom layout code.
R=eseidel@chromium.org
Review URL: https://codereview.chromium.org/1077473002
-Make display:flex, flex-direction: column, flex-shrink: 1 the default.
-Simplify StyleAdjuster::adjustStyleForAlignment to remove special cases we
won't need as we make flex the default and remove absolute positioning.
-Fix a bug this exposed in column flexboxes where we'd apply the wrong edge
of border/padding/margin.
-For now leave the default of align-items:stretch. The main change here is
that iframe/img will do width:auto the same as blocks (i.e. the width of
the parent). I think this is a good change, but we'll have to see how it feels
in practice.
R=eseidel@chromium.org
Review URL: https://codereview.chromium.org/1061163002
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
When the StocksApp menu is showing, the user shouldn't be able to interact with
the rest of the app. Instead, taps outside the menu should dismiss the menu.
This CL makes that happen by adding a ModalOverlay on top of the app. We might
want to do something fancier in the future using event delegation, but this
works for now.
R=rafaelw@chromium.org
Review URL: https://codereview.chromium.org/1031093002
This CL teaches PopupMenu how to animate out as well as in. Also, I've changed
the PopupMenuItem animations to be driven from the PopupMenu itself, which
makes it easier to run the animation in reverse when closing the menu.
TBR=rafaelw@chromium.org
Review URL: https://codereview.chromium.org/1033913002
This CL cleans up stock_app.dart to better separate concerns now that we have
StyleNode. Also, this CL introduces IconButton, which will grow to include an
ink effect in the future, and makes the background of the search bar white.
R=ojan@chromium.org
Review URL: https://codereview.chromium.org/1007893005