212 Commits

Author SHA1 Message Date
Jason Simmons
9b84e6b8e9 Merge pull request #1255 from jason-simmons/skyanalyzer_pub_cache
Some cleanup of the Sky analyzer script
2015-09-22 09:29:27 -07:00
Hixie
ba41fd3538 More dartdoc for fn3, and sundry changes.
- move _uniqueChild earlier since a comment now mentions it earlier.
- reorder methods in Element to more closely reflect call order.
- change mount to be the place that sets the parent pointer, for consistency.
- make the lifecycleState a purely debug-time thing for consistency.
- make BuildableElement.unmount set dirty to false so that we won't
  build unmounted objects.
- rename "updated" to "newWidget" for clarity.
- change how we unmount things so that the slot is reset up to a
  RenderObjectElement, but not further, and don't reset the depth.
2015-09-21 17:44:15 -07:00
Adam Barth
12097bdde0 Remove uses of sky.GestureEvent 2015-09-21 17:05:45 -07:00
Adam Barth
051354ae1d Remove EventDisposition
All the use cases for EventDisposition are now addressed by the gesture
detection system.
2015-09-21 16:45:09 -07:00
Hixie
205335f0f0 Fix fn3 build errors
Add a LeafRenderObjectElement, fix a test to use the new contract.
2015-09-21 15:45:49 -07:00
Hixie
547c324d4b fn3 review
- adds dartdocs
- replaces config setter with didUpdateConfig() so that you can't replace
the config outside of the system
- renames didUnmount() with destroy().
- rename Component to StatelessComponent, ComponentConfiguration to
StatefulComponent
- move debug dump to end of file
- renamed _holder to _element
2015-09-21 15:42:18 -07:00
Adam Barth
d27f3d5251 Merge pull request #1259 from abarth/fn3_rebuild
fn3 shouldn't rebuild components that don't change identity
2015-09-21 15:05:14 -07:00
Collin Jackson
746134a3c9 Merge pull request #1214 from collinjackson/scale_tests
add a test for scale gestures
2015-09-21 14:47:50 -07:00
Jason Simmons
64f75399ef Some cleanup of the Sky analyzer script
* If no source path is provided, then run the analyzer on the Sky unit tests
* Fix the filter for errors found in pub cache packages
* Generalize the filter for the analyzer's "xx errors/warnings/hints found" status message

Also fix a test that caused a warning in the analyzer.
2015-09-21 14:14:30 -07:00
Jason Simmons
58b421aaf4 Ensure that EditableText always shows a cursor
Previously EditableText would render a text widget with no cursor if the text
value was empty.

Also adjust the height of the cursor widget to reflect the style's line
height, and update the cursor painting to match.
2015-09-21 14:12:55 -07:00
Adam Barth
b361a3b4a8 fn3 shouldn't rebuild components that don't change identity 2015-09-21 14:00:26 -07:00
Adam Barth
b9c06c0ade Make stateful components work in fn3 2015-09-21 11:02:36 -07:00
Ian Hickson
6a88ec6d71 Merge pull request #1248 from abarth/fn3
Prototype of fn3
2015-09-21 10:26:25 -07:00
Adam Barth
130a5cb6dc Fix analyzer warnings
We were just missing a few type casts in tests to make the analyzer happy.
2015-09-19 19:21:11 -07:00
Adam Barth
b4ff5ca6ae Prototype of fn3
This patch contains a prototype of a new widget framework. In this framework,
Components can be reused in the tree as many times as the author desires. Also,
StatefulComponent is split into two pieces, a ComponentConfiguration and a
ComponentState. The ComponentConfiguration is created by the author and can be
reused as many times as desired. When mounted into the tree, the
ComponentConfiguration creates a ComponentState to hold the state for the
component. The state remains in the tree and cannot be reused.
2015-09-18 23:17:52 -07:00
krisgiesing
93ebc9e417 Merge pull request #1242 from krisgiesing/master
Fix Rect intersection; add test
2015-09-18 15:28:35 -07:00
Kris Giesing
c52b6fb9e8 Fix Rect intersection; add test 2015-09-18 15:22:59 -07:00
jason-simmons
682116529e Merge pull request #1229 from jason-simmons/editable_text_placeholder_flex
In EditableText, wrap the placeholder text in a Row so it will expand to its parent's width
2015-09-18 14:24:26 -07:00
Jason Simmons
80b2c1732a In EditableText, wrap the placeholder text in a Row so it will expand to its parent's width
This will ensure that the width of an empty Input is consistent with the
width of an Input that contains text.

Also add a unit test for the Input widget and a way for tests to provide mock
implementations of Mojo services such as the keyboard.
2015-09-18 13:46:31 -07:00
Adam Barth
4467a268ce Move theme into material.dart
Also, introduce Colors and Typography to hold the material colors and the
typography declarations. Previously we expected clients of these libraries to
import them into a namespace, but that doesn't play nice with re-exporting them
from material.dart.
2015-09-18 09:57:21 -07:00
Hixie
499d832259 Handle the case of a Widget being moved down
When we sync() a Component, we need to clear the old Component's _child
pointer, otherwise if we reuse that Component we'll get confused about
what the old child is.
2015-09-17 17:23:20 -07:00
Hixie
b1e64571e6 Fix removal logic in widgets
We were not removing children if they were more recently synced than we
were. This makes no sense. We should remove all children unless they
were synced this very generation already (in which case they'll be
somewhere else in the tree by now).
2015-09-17 13:30:27 -07:00
Collin Jackson
6dd58b2108 add a test for scale gestures 2015-09-17 12:45:13 -07:00
Adam Barth
41b8ffd623 Create gestures.dart
This patch is part of a sequence of patches towards fewer top-level libraries.
In this patch, the gesture libraries are combined into one gestures.dart
library.
2015-09-16 18:25:00 -07:00
Ian Hickson
ebf71f59d6 Merge pull request #1191 from Hixie/flex
FlexAlignItems.stretch didn't stretch
2015-09-16 13:09:08 -07:00
Adam Barth
699fa2415c Merge pull request #1194 from abarth/drawer_gestures
Move Drawer to GestureDetector
2015-09-16 12:38:28 -07:00
Adam Barth
74f7d9efee Move Drawer to GestureDetector
This fixes an issue in the stocks app in horizontal mode where you could both
scroll and drag the drawer at the same time.
2015-09-16 12:33:51 -07:00
Hixie
07e010de1b FlexAlignItems.stretch didn't stretch 2015-09-16 12:22:37 -07:00
Hixie
cd6c4da3c6 Refactor rendering_tester
RenderView has to be a singleton for sanity during tests, otherwise they
all end up in the dirty lists and we end up pumping all of them each frame.
2015-09-16 12:03:57 -07:00
Hixie
dfd821e595 Ignore generation of child if child is unchanged
Also:

 - don't mark a node as from the new generation if it is dirty, since we
   know it still has to be built.

 - establish the rule that you can't call setState() during initState()
   or build().

 - make syncChild() return early for unchanged children.

 - update the tests, including adding a new one.
2015-09-15 13:20:37 -07:00
Ian Hickson
942d1fa6ac Merge pull request #1157 from Hixie/minor-fixes
Minor cleanups (spelling mistakes, unneeded casts)
2015-09-14 12:11:31 -07:00
Adam Barth
b0c300e526 Add dartdoc for proxy_box.dart and other code in rendering
Almost done adding dartdoc to the rendering layer.
2015-09-14 10:35:31 -07:00
Hixie
0376c35ae4 Minor cleanups (spelling mistakes, unneeded casts)
Rename Outter to Outer.

Change _sync() in StatefulComponent to assert the argument type in the
signature rather than in the code.
2015-09-14 10:28:28 -07:00
Adam Barth
129238ed27 Merge pull request #1138 from abarth/fewer_settings
Disentangle FontSize from Settings
2015-09-11 13:12:48 -07:00
Adam Barth
b89d790a84 Disentangle FontSize from Settings
Instead, just store the default font sizes in statics. These statics are
constants for now, but we'll probably make them configurable at some point.
2015-09-11 12:51:27 -07:00
Andrew Wilson
844cf1fac7 Merge pull request #1131 from apwilson/shrinkwrap
Shrink wrap when constraints are infinite.
2015-09-11 12:37:51 -07:00
Andrew Wilson
380cfb265f Shrink wrap when constraints are infinite. 2015-09-11 12:12:59 -07:00
Adam Barth
fddfe574c4 Merge pull request #1127 from abarth/scroll_drag
Rename scroll.dart to drag.dart
2015-09-11 10:59:10 -07:00
Adam Barth
99bc146642 Merge pull request #1133 from abarth/paragraph_builder
ParagraphBuilder should be able to build a paragraph
2015-09-11 10:59:02 -07:00
Adam Barth
3d3c50b2cf Rename scroll.dart to drag.dart
The gesture is now called "drag". The library name should match.
2015-09-11 10:55:54 -07:00
Hans Muller
1e18c38380 Uncomment the Dismissable unit test that checks for a #1068 fix 2015-09-11 10:44:38 -07:00
Hixie
5125bd5d0b Change how we decide if two nodes can sync.
If it's a StatefulComponent, then it's ok to reuse it so long as it
hasn't been initialised.

If it's a regular Component or a TagNode, then it's always ok to reuse.

If it's a RenderObjectWrapper, then it's ok to reuse so long as it
doesn't have a renderObject.

To put it another way, this changes how we prevent the following
nonsensical situations from arising:

 - Sync two stateful StatefulComponents together
 - Sync two RenderObjectWrappers with RenderObjects together

When either of those cases happen, we just drop the old one on the
ground and use the new one unchanged.
2015-09-11 10:26:36 -07:00
Adam Barth
403441d2ab ParagraphBuilder should be able to build a paragraph
This patch start down the road of implementing text layout and painting without
the DOM. We can construct a basic paragraph consisting of a single run of text
and we can get through layout without crashing.
2015-09-11 10:23:15 -07:00
Hans Muller
639f9d9b06 Finish converting Dismissable from Listener to GestureDetector
Dismissable now only depends on GestureDetector.

Added a unit test that verifies that issue #1068 has been fixed. It's commented out for now.

Cleaned up VelocityTracker.cc et al a little.
2015-09-11 09:37:55 -07:00
Adam Barth
63101e49bc Fold fling gesture into onDragEnd
That way the fling engages in the same direction as the scroll. For example, if
you have a horizontal scroll nested inside a vertical scroll, the fling will
take place in the same direction as the scroll.
2015-09-10 12:38:11 -07:00
Adam Barth
2234294dd4 Remove "disqualified" concept
Allows a non-initialised stateful component to be used as a source of
settings more than once. Instead of asserting that it was only being
used once, we assert that once you are stateful you don't get used as a
bag of settings, which is the real thing we were trying to avoid.

A lot of code ends up using StatefulComponents as a source multiple
times in a row, and before this would fail.

Patch by Ian Hickson
2015-09-09 17:17:03 -07:00
Adam Barth
6fc343a097 Remove package:sky/base
These files really belong on other libraries.
2015-09-08 10:59:07 -07:00
Adam Barth
25b8039958 Merge pull request #1076 from abarth/docs_animation
Introduce package:sky/animation.dart
2015-09-08 09:51:14 -07:00
Adam Barth
b356d14635 Introduce package:sky/animation.dart
Move the animation libraries into src/animation and change importers to use
package:sky/animation.dart. Also, move scheduler.dart into the animation
library so that the animation library can be self-contained.
2015-09-08 09:44:01 -07:00
Hixie
0a37e06b4d Fix breakage caused by sync-across-removal patch.
This makes the sync code stop if it would have to rearrange the
RenderObjects. I'll make it handle the cross-RenderObject case, as well
as the insertion-sync case, in subsequent patches.
2015-09-08 09:28:08 -07:00