579 Commits

Author SHA1 Message Date
Adlai Holler
4829a8643d Improve System Trace Implementation #trivial (#368)
* Improve the kdebug, system trace integration

* Remove superseded subsystem

* Address review comments

* Please the license header gods

* Address harder

* Fix node block retaining collection view
2017-06-19 10:14:39 -07:00
appleguy
8c33a617ed [Yoga] Delete YOGA_TREE_CONTIGOUS gating and permanently enable. (#370)
[Yoga] Delete YOGA_TREE_CONTIGOUS gating and permanently enable. #trivial
2017-06-18 18:18:59 -07:00
appleguy
486410d7d6 [Yoga] Minimize number of nodes that have MeasureFunc set on them. (#369)
This has one important benefit: fixing the stretching behavior of spacer nodes.

In addition, it should help efficiency of Yoga and certainly minimize calls
to layoutThatFits:.

Next up for Yoga is a mostly-red diff, deleting the non-Contiguous code branches.
2017-06-18 18:18:12 -07:00
Adlai Holler
d9dec8fdf9 Fix memory leaks, add section-object support to new test harness (#360) 2017-06-16 09:25:16 -07:00
appleguy
55928f343d [Yoga] Rewrite YOGA_TREE_CONTIGUOUS mode with improved behavior and cleaner integration (#343)
* [Yoga] Rewrite YOGA_TREE_CONTIGUOUS mode with support for mixing with ASLayoutSpec.

After experimentation with the ASYogaLayoutSpec (or non-contiguous) approach to
integrating Yoga, test results and feedback from the authors of Yoga have shown
that this approach can't be made completely correct,

There are issues with some of the features required to represent Web-style
flexbox; in particular: padding, margins, and border handling have varience.

This diff is a first step towards a truly correct and elegant implementation of
Yoga integration with Texture. In addition to reducing the footprint of
the integration, which is an explicit goal of work at this stage, these changes
already support improved behavior - including mixing between ASLayoutSpecs
even as subnodes of Yoga layout-driven nodes, in addition to above them. Yoga
may be used for any set of nodes.

Because Yoga usage is limited at this time, it's safe to merge this diff and
further improvements will be refinements in this direction.

* [ASDKgram] Add Yoga layout implementation for PhotoCellNode.

* [Yoga] Final fixes for the upgraded implementation of the Contiguous layout mode.

* [Yoga] Add CHANGELOG.md entry and fix for Yoga rounding to screen scale.

* [Yoga] Minor cleanup to remove old comments and generalize utility methods.
2017-06-14 19:36:13 -07:00
Michael Schneider
13f6f14e9f Use ASTableView tableNode property instead of calling ASViewToDisplayNode (#361) 2017-06-14 19:26:43 -07:00
appleguy
81def94f6f [ASTraitCollection] Convert ASPrimitiveTraitCollection from lock to atomic. (#355)
* [ASTraitCollection] Convert ASPrimitiveTraitCollection from lock to atomic.

This resolves a deadlock case: https://github.com/TextureGroup/Texture/issues/353

* [ASTraitCollection] Use assignment operator instead of .store() for C++ atomic.
2017-06-14 13:55:52 -07:00
Adlai Holler
6b3f8f8ad7 Add support for keeping letting cell nodes update to new view models when reloaded. #trivial (#357)
* Add support for skipping reload if node decides it is compatible with new view model also

* Sort things right

* Put the order back

* No need for redundant expectation

* Fix license header

* Fix comment
2017-06-13 10:10:37 -07:00
Hannah Troisi
8861161d6c [Performance] Convert ASLayoutElementSize to atomic #trivial (#331)
* [Performance] Convert ASLayoutElementSize to atomic

* [ASLayoutElementStyle] Put locks around setter methods.

* Also add lock to setSize: internal method.
2017-06-12 21:31:37 -07:00
Adlai Holler
83111de0cc Add first-pass view model support to collection node. #trivial (#356)
* Add first-pass view model support for collection node. Much more to come!

* Address issues

* Update the gorram license header

* Dear lord
2017-06-12 16:50:33 -07:00
Adlai Holler
c297060113 Add a unit test for double-initial-load issue (#352) 2017-06-12 13:13:49 -07:00
Adlai Holler
8af1538a5b Add a Flag to Disable Main Thread Assertions #trivial (#348)
* Add a thread-flag for disabling main thread assertions

* Fix the license header
2017-06-11 18:53:20 -05:00
Adlai Holler
c9e4b98a55 Upgrade ASLayoutElementContext to an Object #trivial (#344)
* Upgrade ASLayoutElementContext to an object

* Address feedback from Huy
2017-06-10 00:25:39 -05:00
Huy Nguyen
05e9bdd092 Small changes required by the coming layout debugger (#337)
* Small changes required by the layout debugger
- `ASDisplayNode` can be told to not flatten its layout immediately but later on. The unflattened layout is also stored in a separate property. It's needed for inspecting not only display nodes but also layout specs used to compute a layout tree.
- `ASLayout` can be told to always retain its sublayout elements. This is needed especially for layout specs since they are usually not retained after an ASLayout was computed.

* Update CHANGELOG

* Address comments
2017-06-08 10:47:50 -07:00
Michael Schneider
13c467b2f4 Fix internal Linter warnings #trivial (#340)
* Fix internal Linter warnings

* Remove explicit copy for block as let us just use the default one
2017-06-08 10:45:03 -07:00
Kasper Weibel Nielsen-Refs
786ac15e15 [Yoga] Refer to proper path name and use module import (#306)
* Change header path to fix https://github.com/TextureGroup/Texture/issues/25

* Use module import

* Update ASDisplayNode+Beta.h
2017-06-06 17:11:36 -07:00
Hannah Troisi
9ca01b2beb [ASCollectionView] synchronous mode (#332)
* [ASCollectionView] synchronous mode

* add to changelog

* Update ASDataController.mm

* Update ASCollectionNode.mm
2017-06-06 14:55:00 -07:00
appleguy
00013aadab [ASDisplayNode+Layout] Add check for orphaned nodes after layout transition to clean up. (#336)
It is rare that this code has any effect, but I've discovered a case in which it occurs.

This task tracks moving this code to a DEBUG-only assertion: https://github.com/TextureGroup/Texture/issues/335
2017-06-06 12:38:37 -07:00
Adlai Holler
a9837f2dc8 Replace NSMutableSet with NSHashTable when Appropriate #trivial (#321)
* Use NSHashTable to avoid needless -hash and -isEqual: calls

* Mark debug-only methods as such for clarity

* Address feedback
2017-06-05 16:33:37 -07:00
Garrett Moon
d5f10652c6 Fixes an issue with GIFs that would always be covered by their placeholder (#326)
Also adds a subclass override for when the animated image is set.
2017-06-02 16:13:36 -07:00
Adlai Holler
4d0eeb64d8 Rejigger Cell Visibility Tracking (#317)
* Rejigger visible elements tracking

* Put the assertion back

* Remove unused stuff

* Make it stronk
2017-05-30 10:25:13 -07:00
appleguy
6a28b740e6 [Cleanup] Small fixes to improve conformance for strict compiler settings #trivial (#320) 2017-05-29 18:11:18 -07:00
Adlai Holler
b7cd0b1656 Cleanup ASAsyncTransaction a little bit (#316) 2017-05-29 16:27:30 -07:00
appleguy
b285ece35f [Yoga] Implement ASYogaLayoutSpec, a simplified integration strategy for Yoga. (#270)
* [Yoga] Implement ASYogaLayoutSpec, an experimental alternative to full-tree integration.

This approach allows us to avoid any ASDisplayNode.mm integration points.
However, it is not yet proven to be possible to achieve correctness with this approach.

The entry point (to start calculating), and the measurement function inputs, lack
the full expressiveness of ASSizeRange; we need to make sure that workarounds like
using style.minSize are successful in simulating the behavior of a full Yoga tree.

* [Yoga] Fix file comments, move towards <ASLayoutElement> support.

* [Yoga] Important fix for simplified, non-contiguous Yoga integration.

* [Yoga] Complete implementation of manual memory management (__bridge_transfer, YGNodeFree)
2017-05-29 15:39:24 -07:00
Adlai Holler
7961aa919a Cleanup ASDisplayLayer (#315) 2017-05-29 15:38:27 -07:00
Flo
be956e91c6 [ASCollectionNode] Fix missing properties and layoutInspector #trivial (#305)
* [ASCollectionNode] Set the layoutInspector from the pendingState in didLoad.

* [ASCollectionNode] Forward scroll properties from the view.
2017-05-29 13:43:29 -07:00
appleguy
f7b9855da7 [ASDisplayNode] Revise assertion to log until Issue #145 is addressed. (#313)
[ASDisplayNode] Revise assertion to log until Issue #145 is addressed. #trivial
2017-05-29 10:59:11 -07:00
Garrett Moon
6b54d052e9 Fix non layout (#309)
* Lock released between add to pend controller and modifying pend state

The existing design is pretty fraught with error. We should probably
rethink this but in the meantime, this fixes a bug where calling
setNeedsLayout can start failing for nodes.

Essentially the method ASDisplayNodeShouldApplyBridgedWriteToView has
a side effect of registering a node to apply it's pending state *if*
it doesn't currently need the pending state applied. My guess is this
was to avoid continually registering the node and this behavior actually
helped expose this bug.

The bug: after the node is registered for flushing it's state, several
code paths released the lock before applying that state to the pending
state object. Before it could re-obtain the lock to apply it to the pending
state, the pending state controller flushed it on the main thread.

On subsequent calls to setNeedsLayout, the pending state had pending state
already (from previous calls which missed the flush) and thus wasn't
registered for future flushing.

* Add changelog
2017-05-26 14:59:02 -07:00
Adlai Holler
f8c16b7f3a Catch Invalid Layer Bounds in a Nonfatal Assertion #trivial (#308)
* Add a non-fatal assertion for setting invalid layer bounds.

* Update message
2017-05-24 12:56:08 -07:00
Michael Schneider
8a9c6e8145 Remove assertion in calculateSizeThatFits: and add a log event (#299) 2017-05-23 08:14:26 -07:00
Michael Schneider
a6c3517cf6 IGListKit related headers need to be in the module all time now (#300) 2017-05-22 09:50:11 -07:00
Huy Nguyen
6db8cc1551 ASBatchFetching to not round scroll velocity (#294)
- Doing so causes remaining time to be slightly inaccurate.
2017-05-19 15:07:08 +01:00
Huy Nguyen
6aa5ad7703 Only call -layout and -layoutDidFinish if the node is already loaded (#285)
* Only call -layout and -layoutDidFinish if the node is already loaded

* Minor change

* Update CHANGELOG
2017-05-19 15:06:26 +01:00
Sergey Petrachkov
0e4d48acb7 [ASVideoNodeDelegate] fix for #291 crash (#292)
* Fixed bug where ASVideoNodeDelegate error reporting callback would crash an app because of not responding to selector;

refs #291

* updated changelog.md

* fixed typo in const name of ASVideoNodeDelegate method in delegate flags;

refs #292
2017-05-18 12:27:16 +01:00
Adlai Holler
d30c35787c Fix Alignment of Hashed Structs (#287)
* Fix alignment of ASImageNodeContentsKey struct to fix hashing

* Change the change log by logging a change

* Add the world's stupidest explicit cast

* Actually its simpler
2017-05-17 18:08:50 -07:00
Huy Nguyen
8c45eaefce [Batch Fetching] Add ASBatchFetchingDelegate (#281)
* Add ASBatchFetchingDelegate
- In addition to checking remaining leading screens, ASBatchFetching now also calculates a remaining time and consults its delegate if needed.
- The delegate can override the decision of ASBatchFetching, for example based on remaining time and average time of past batch requests.

* Fix up tests

* Update CHANGELOG
2017-05-17 13:26:30 +01:00
Adlai Holler
432018cfdc Ignore Relayout Requests for Deleted Cell Nodes (#279)
* Data Controller: Ignore relayout requests for elements that have been deleted in the mean-time.

* Bolster our logchange

* Add sanity check
2017-05-16 11:31:15 -07:00
Adlai Holler
9c07aff695 Remove unused cell node method (#278) 2017-05-15 16:36:29 -07:00
Adlai Holler
7df1a20c5f Simplify Layout Transition State #trivial (#269)
* Port the changes to the latest master

* Remove extra s
2017-05-15 16:33:44 -07:00
Adlai Holler
a1b6fd2cd7 Fix documentation warnings (#276) 2017-05-15 13:31:20 -07:00
Michael Schneider
b32e69d64b [Layout] Extract layout implementation code into it's own subcategories (#272)
* Extract layout code into ASDisplayNode categories

* Category renaming and documentation

* Changelog

* Change header
2017-05-15 11:10:59 -07:00
Adlai Holler
9d84b9e635 Fix release builds (#271) 2017-05-14 15:52:06 -07:00
Adlai Holler
d4725a51f2 Add Experimental Text Node Implementation (#259)
* Add experimental text node implementation, based on YYText

* Fix warnings and alert when unimplemented experimental features are used.

* Address feedback from review

* Extend the cthulog

* Update license headers
2017-05-14 12:02:07 -07:00
Adlai Holler
6d113f7a9d Use pthreads to back ASLayoutElementContext instead of std::map (#268) 2017-05-14 10:08:22 -07:00
Adlai Holler
538a02f119 Simplify Override Checking, Only Do It When Assertions Are Enabled #trivial (#253)
* Simplify our override checking, only do it when assertions are enabled

* Move those functions under the ASSERTIONS_ENABLED check
2017-05-11 11:42:15 -07:00
Adlai Holler
f2c85fdc32 Fix Collection Item Index Path Conversion (#262)
* Fix the conversion order for collection index paths

* Update the changelog
2017-05-11 10:44:21 -07:00
Sergey Petrachkov
4b114e841b added error reporting callback to ASVideoNode (#260)
* added error reporting callback to ASVideoNode

* updated Changelog.md

* updated code according to review notes:

- preserved two-spaces indentation;
- extended error reporting callback with key and asset, updated method call;
2017-05-11 12:23:12 +01:00
ricky
002f470331 [ASTextKitFontSizeAdjuster] Replace use of boundingRectWithSize:options:context: with boundingRectForGlyphRange: inTextContainer: (#251)
* [ASTextKitFontSizeAdjuster] Replace use of boundingRectWithSize:options:context: with boundingRectForGlyphRange: inTextContainer:

`boundingRectWithSize:options:context:`  started returning different values for the same strings between iOS 10.2 and iOS 10.3. Switching to using `NSLayoutManager`’s `boundingRectForGlyphRange: inTextContainer:` fixed this. It also makes sure we are consistent with what `ASTextKitTailTruncater` uses.

* updated changelog
2017-05-10 18:40:22 -07:00
Huy Nguyen
34397235bb Add missing import and define in ASLog (#257) 2017-05-10 17:09:07 -07:00
Adlai Holler
0143e3291a Improve Ancestry Handling, Avoid Assertion Failure (#246)
* Improve our handling of ancestry

* Increase chungalunga
2017-05-09 18:27:54 -07:00