* Rename ASDN C++ namespace to "AS." Referring to the framework as ASDisplayNode is pretty out-dated and verbose. See CoreAnimation which usees CA for their internal namespace.
More using
* More cases
* Improve separation of code for layout method types
* Address PR comments
- Delegate to layout spec engine if the node is a layout spec node but yoga engine was asked for calculate the layout
- Change ASLayoutType to ASLayoutEngineType
- Improve layout engine fall through code
* Apply recommended warnings
* Squelch designated initializer warning in ASViewController
* Remove unused compiler flag
clang: warning: argument unused during compilation: '-fno-objc-arc-exceptions' [-Wunused-command-line-argument]
* Fix warning about overriding an instance variable within a category
Instance method 'methodOverrides' in category from _ASDisplayView.o overrides method from class in ASDisplayNode.o
* Remove use of NSHashTable for interface state delegates #trivial
* Stray line
* One more case
* Add code to let people have more delegates
* Do it more
* fix SIMULATE_WEB_RESPONSE not imported #449
* Fix to make rangeMode update in right time
* remove uncessary assert
* Fix collection cell editing bug for iOS 9 & 10
* Revert "Fix collection cell editing bug for iOS 9 & 10"
This reverts commit 06e18a10596622ff8a68835c95a23986d7bf61ea.
* Fix interface state not update correctly during layer thrash
* add change log
* [License] Simplify the Texture license to be pure Apache 2 (removing ASDK-Licenses)
With permission of the Facebook Open Source team, we are simplifying the Texture
license so that clients can rely on the Apache 2 terms that most of Texture is
already covered by. This means that code originally forked from AsyncDisplayKit
will be re-licensed from "BSD 3-clause + PATENTS v2" to Apache 2 without a
PATENTS file.
After getting confirmation that the updates to these core files look good, we'll
propagate this new license header to all files (in this same PR) and get sign-off
from all parties before landing.
* [License] Update all Texture source files to be pure Apache 2.
* Changelog entry for Apache 2 license update.
* Revert "[License] Update all Texture source files to be pure Apache 2."
This reverts commit ffa0fbbba9717d871dd16c4b07539f2f8208fc2b.
* [License] Update all Texture source files to be pure Apache 2, maintaining copyrights.
* [License] Update CONTRIBUTING, README, Podspec & Dangerfile.
* Remove objc association & weak proxy from node -> controller relationship
* Rename ASNodeController+Beta.m to ASNodeControllerx+Beta.mm
Currently we can't import ASDisplayNodeInternal from C
* Update project pointers
* Rename ASNodeControllerx+Beta.mm to ASNodeController+Beta.mm
- Rename `ASDisplayNodeAssertLockUnownedByCurrentThread` to `ASAssertUnlocked`, and `ASDisplayNodeAssertLockOwnedByCurrentThread` to `ASAssertLocked` -> shorter and hopefully easier to distinguish between the two.
- Add assertions to `_locked_` and `_u_` (i.e "unlocked") methods.
- Turn `CHECK_LOCKING_SAFETY` flag on by default. After #1022 and #1023, we're in a good shape to actually enforce locked/unlocked requirements of internal methods. Our test suite passed, and we'll test more at Pinterest after the sync this week.
- Fix ASVideoNode to avoid calling `play` while holding the lock. That method inserts a subnode and must be called lock free.
- Simplify `_loaded(node)` to only nil-check `_layer` because regardless of whether the node is view or layer backed, the layer should always be set if loaded. Use it throughout.
- Other minor changes.
* Adds support for having multiple interface state delegates.
Hopefully in a performant way.
* Switch to respondsToSelector for int del instead of separate object
* Add CHANGELOG
* Make ASDisplayNode+InterfaceState.h public
* Huy's comments
* Don't even bother removing since it's a weak hash table.
* [ASDisplayNode] Add safeAreaInsets, layoutMargins and related properties to ASDisplayNode
* Add layoutMargins bridged to the underlying view
* Add safeAreaInsets bridged to the underlying view
* Add fallback calculation of safeAreaInsets for old iOS versions
* Add automaticallyRelayoutOnSafeAreaChanges and automaticallyRelayoutOnLayoutMarginsChanges properties
* Add additionalSafeAreaInsets property to ASViewController for compatibility with old iOS versions
* Provide safeAreaInsets for layer-backed nodes.
This also fixes tests.
* Fix crash when insetsLayoutMarginsFromSafeArea is set from a background thread
* Changes requested at code review:
* Update documentation for layoutMargins and safeAreaInsets properties. Suggest that users set the automaticallyRelayout* flags to ensure that their layout is synchronized to the margin's values.
* Fix accessing ASDisplayNode internal structures without a lock.
* Add shortcut in -[ASDisplayNode _fallbackUpdateSafeAreaOnChildren] to skip a child when possible.
* Add shortcut in ASViewController to avoid fallback safe area insets recalculation in iOS 11. Fix fallback safe area insets recalculation when the additionalSafeAreaInsets are set.
* Add debug check that a view controller's node is never reused without its view controller, so the viewControllerRoot flag value is always consistent.
* Use getters instead of reading ivars directly in -layoutMarginsDidChange and -safeAreaInsetsDidChange.
* Minor change in CHANGELOG
* Minor change in ASDisplayNodeTests.mm
* Make display node, layout spec, and style conform to NSLocking so that users/subclasses can access their locks
* Update the changelog
* Align slashes
* Put it back, when we're in ASDisplayNode
* Go a little further
* Put back the changes I didn't mean to commit
* Kick the CI
* Fix yoga build
* Put back non-locking change
* Address comments from Scott
* fix SIMULATE_WEB_RESPONSE not imported #449
* Coalesce interface state updates to ASCATransactionQueue before CATransaction commit.
This will avoid duplicate interface state delegate calls caused by view repeatly added/removed to/from hierarchy during controller animation transition.
* fix tests for new run loop queue
* Support for disabling ASCATransactionQueue
* Fix didExitHierarchy to use ASCATransactionQueue.
* merge range managed and none range managed for didExitHierarchy
* Revert "merge range managed and none range managed for didExitHierarchy"
This reverts commit f807efaa65ed5dbdb6622d06da542e01a53715fa.
* merge range managed and none range managed for didExitHierarchy
* remove metadata
* abstract queue to impl class methods
* Add tests
* Fix test fail because of shared object.
* guard _pendingInterfaceState access with lock
* name refactor
* Refactor from comments https://github.com/TextureGroup/Texture/pull/788/\#pullrequestreview-94849919
* Apply InterfaceState immediately after ASCATranactionQueue is processed and before next runloop started.
* refactor
* no op to start CI build
* remove unused var and kick off tests
* change lisence
* remove code for weak ref
* add change log and adjust license
* Added attributed versions of accessibilityLabel, accessibilityHint and accessibilityValue
* Follow conventions for property types
* Use curly braces
* Update changelog
* Follow conventions for property types in UIView+ASConvenience.h
* Add compatibility for Xcode 8
* Use isEqualToString instead of pointer comparison
* Only allocate attributed strings once. Use _setAttributedAccessibilityToViewAndProperty only for attributed properties.
* [ASCornerRounding] Initial (untested) implementation of ASCornerRounding features.
* [ASCornerRounding] Working version of both clip corners and precomposited corners.
* [ASCornerRounding] Improve factoring and documentation of corner rounding features.
* [ASCornerRounding] Some final fixups.
* Add entry to changelog for .cornerRoundingType
After consulting Apple documentation and working with some a11y experts,
we've found that aggregating objects that have a11y labels but are not
themselves interactable is significantly preferred for these users.
It makes it much quicker to navigate scrolling content if VoiceOver only
stops to select entire cells, and then allows drilling down into the cell
to select individual components. This implementation achieves that behavior.
We should consider enabling isAccessibilityContainer by default on ASCellNode.
This would be an improvement for 95% of a11y use cases. Aggregation can be
enabled or disabled on any node.
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.
* [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.
* [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.
* 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
* [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)
* [ASDisplayNode] Convert isSynchronous to an Objective-C atomic BOOL.
This reduces lock contention, and should also fix a very rarely seen deadlock.
* [ASDisplayNode] Implement a std::atomic-based flag system for superb performance
Although Objective-C atomics are equally fast, or better that std::atomic when
access through method calls, for the most intense use cases it is best to avoid
method calls entirely.
In ASDisplayNode, we could benefit significantly from avoiding both method calls
(already true today) but also avoid locking the mutex, for both CPU and contention
gains.
There will still be many methods that need locking for transactional
consistency - however, there are currently dozens of accessor methods that could
avoid frequent lock / unlock cycles with use of atomics, and other usages of the
ivars directly where locking could be delayed until after early-return conditions
are checked and passed.
We have to check in this case if the supernode of the subnode is indeed the _node that executes a layout transition. It can happen that a node already did a layout transition and added this subnode, in this case the subnode would would be removed from the new node instead of _node.