* Check in ASLayout if size is valid for sizing instead of valid for layout
* Return constrainedSize from calculateSizeThatFits:
Remove invalid constrainedSize check within ASNetworkImageNode. Furthermore as ASDisplayNode does not return CGSizeZero anymore we have to give the display nodes we use in tests and are involving a stack spec an intrinsic content size.
* Remove extra constrainedSize handling in ASNetworkImageNode handling
* Change test to use FLT_MAX
* Initial commit to move [ASLayoutSpec children] from std::map to NSMutableArray
* Add NSFastEnumeration to ASLayoutable
* ASNullLayoutSpec is a Singleton now
* Move ASLayoutSpecPrivate in Private folder
* Move to NSArrayPointer and remove ASNullLayoutSpec
* Revert "Move to NSArrayPointer and remove ASNullLayoutSpec"
This reverts commit 9ab9cf7024b1f6e1984d84fe58af2b84e84cdf94.
* Move to childAtIndex: and setChild:atIndex:
* Deprecate preferredFrameSize
- Remove all support for preferredFrameSize in ASDK
- preferredFrameSize setter calls through and sets the width and height of the node
- preferredFrameSize getter tries to return a CGSize based on the width and height properties otherwise if this is not possible it throws
* Address comments
* Return CGSizeZero for preferredFrameSize unless width and height are ASDimensionUnitPoints
* Better comment for preferredFrameSize and remove lock in calculateSizeThatFits:
* Initial commit for adding a size constraint to ASLayoutable's
* Some more commits
* Fix sample projects in extra/
* Remove preferredFrameSize test of ASEditableTextNode
* Remove preferredFrameSize from examples_extra
* Add deprecation warning to -[ASDisplayNode preferredFrameSize]
* Add deprecation warning to -[ASDisplayNode measureWithSizeRange:]
* Commit
* Commit
* Remove ASRelativeSizeRange
* Make ASRelativeSize private
* Adjust examples
* Improve setting of -[ASLayoutable size] with points or fractions
* Add ASWrapperLayoutSpec
* Improve creation of ASRelativeDimension
* Add `preferredFrameSize` back and add deprecated logging
* Add `layoutSpecBlock` setter and getter and add locking for it
* Add better documentation and fix macros to create ASRelativeDimension
* Create new ASSizeRangeMake with just a CGSize as parameter
* Update Kitten and Social App Layout example
* Add layoutThatFits: and deprecate measure:
* Rename ASRelativeDimension to ASDimension
* Fix examples for ASDimension renaming
* Remove fancy height and width setter
* Fix ASDimension helper
* Rename -[ASLayout layoutableObject] to -[ASLayout layoutable]
* Update layout related methods and more clearer documentation around how to use it
* Deprecate old ASLayout class constructors
* Don't unnecessary recalculate layout if constrained or parent size did not change
* Use shared pointer for ASDisplayNodeLayout
* Fix rebase conflicts
* Add documentation and move implementation in mm file of ASDisplayNodeLayout
* Fix test errors
* Rename ASSize to ASLayoutableSize
* Address comments
* Rename setSizeFromCGSize to setSizeWithCGSize
* Improve inline functions in ASDimension
* Fix rebase conflicts
We don't call the block on every subnode if the node that is passed in ASDisplayNodePerformBlockOnEveryNode has shouldRasterizeDescendants enabled as it tries to iterate through the sublayer hierarchy, but there are no sublayers
* Attempt to reproduce supplementary crash
* Get closer with supplementary issue testing
* Alright! We have a repro!
* The investigation continues
* Fixed!
* Renamed range update callbacks
We finally settled on
didEnter/ExitDisplayState
didEnter/ExitPreloadState
didEnter/ExitVisibleState
This change is meant to unify the range update methods to relate to each
other and hopefully be a bit more self explanatory.
* Guarantee interface callbacks happen on main.
* move fetchData / clearFetchedData to default implementations
* Move deprecated methods to new deprecated category
* Don't bring in cocoapod change.
* Nits
* Capetalize
* Add failing test case
* [_ASDisplayLayer] If we skipped render due to being zero-size, enqueue a render when we get a real size
* Remove pointless import
* Revert "Revert "[ASLayoutSpec] Use childrenMap directly to prevent creating an NSArray within ASDK (#1937)""
This reverts commit 735b4ebd0872483044d98a5d05b43324e76fc8d4.
* Fix crash and add exception for mutating while using fast enumeration of ASLayoutSpec children
NSFastEnumeration is potentially quite dangerous in the wrong hands. In particular, it does not provide a safe mechanism for you to return temporary objects directly, and it does not provide any guarantee that you will be called when the enumeration has completed; therefore if we generate temporaries and store them in an instance variable, we will not necessarily be able to clean them up! This means fast enumeration methods should never be called within an autorelease pool or the autorelease pool be drained within the fast enumeration loop.
The reason is we store references to objects in the stackBuf struct by casting the child pointer to __autoreleasing id. If we pop the autorelease pool between calls to -countByEnumeratingWithState:objects:count:, it will die in a messy explosion of pointer dereferences and EXC_BAD_ACCESS.
* Add tests for ASDisplayNode and ASLayoutSpec fast enumeration
* Fix some concurrency problems detected by Xcode 8's new Thread Sanitizer.
Some of these changes are arguably just to silence the warnings from Thread Sanitizer.
* Fix several memory leaks in the unit tests.
A number of the unit test source files are compield with `-fno-objc-arc`. This was clearly overlooked when writing several of the unit tests.
Fixed by (mostly) switching to use of `-autorelease` for the problem code.
NOTE: This commit doesn't fix all the memory leaks found. There's still at least one leak in `-[ASDisplayNodeTests testSetNeedsDataFetchImmediateState]`, and several leaks in `ASBasicImageDownloader.mm`. I wasn't able to find a trivial cause to these, unfortunately.
This avoids CoreAnimation from capturing the name from a background thread deep within the internals
of AVPlayerLayer, which commits transactions off the main thread. If the main thread is also accessing
properties that require the lock, in very specific app architectures relying on AVPlayerLayer, this
can cause a deadlock.
The "name" property is primarily used by ASDK's unit test infrastructure, so I'm leaving it in place for
that purpose - and it may still be used for debugging, if someone wants to set it. It will remain
possible to get the node from a layer or view with asyncdisplaykit_node, and access name from there.