* [ASTextNode] Reset _composedTruncationText when attributedText is updated
Current issue:
1) Set `attributedText` in `ASTextNode` with whiteColor
2) `_composedTruncationText` gets updated to take on this new color attribute
3) Set the `attributedText` with greenColor
4) The `_composedTruncationText` gets updated with the new attributes, but does NOT overwrite any existing attributes — i.e., does not overwrite the white color with green. Comment from `_locked_prepareTruncationStringForDrawing:`:
`
// Add any of the original string's attributes to the truncation string,
// but don't overwrite any of the truncation string's attributes
`
* michael’s suggestion
* Fix trait collection handling in ASCollectionElement
- Don't store a trait environment directly and request it when needed. The environment is often the cotaining collection/table node. Asking it for a trait collection is an upward tree traversal and can cause deadlocks. This reverts #2963.
- If the environment changes during a change set update, notify all visible elements about the change. This fixes#2959.
* Address comments
Although we may not want to support this property long-term, there are some usages of it
that are difficult to avoid. Specifically because the complexity it adds is both low,
and contained to a small area of the code that would be easy to remove it, it would be
great to support this.
The usage relates to apps that require the Interop protocol, and are architected to expect
a few methods / protocols being implemented on the UICollectionView class itself. It does
not directly override ASCollectionView behaviors. So hypothetically, it would also work
if it were possible to set ASCollectionView's superclass.
Instead, the app is making its own subclass descend from ASCollectionView and use the interop
APIs, even in environments where there are no ASCellNodes ever returned.
* [ASMultiplex/NetworkImageNode] Ensure ASImageProtocols are not called with nil arguments.
* [ASBasic/PINRemoteImageDownloader] Do not check for nil downloadIdentifier needlessly.
* [ASImageCacheProtocol] Make synchronouslyFetchedCachedImageWithURL URL nonnull.
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.
- Before this commit:
- Bridged properties are accessed to construct a recursive description without considering thread affinity.
- We have multiple methods that does the same thing: generates a debug description.
- After this commit:
- Bridged properties are accessed without triggering thread affinity assertions.
- We have only one method that provides debug description of a node. It is then used to construct a recursive description.
* Improve locking situation in ASDisplayNode subclasses
* Adress first number of comments
* Don’t hold the lock while calling _updateComposedTruncationText
- Avoid returning a NaN flexShrinkAdjustment.
- Bail early (instead of assert) if a line has a positive `flexFactorSum` but then no flexible item can be found via flex adjustments, for example because the flexible items have zero size.
- Continue flexing other lines when one line is inflexible.
- Add unit test for the first 2 fixes.
- UICollectionViewFlowLayout asks its delegate, which is ASCollectionView, for reference size of headers and footers. If a header or footer is unavailable, its backing collection element will be nil and a zero size should be returned immediately.
* Align touch and tracking system in ASControlNode to UIControl
Currently the touch and tracking system of ASControlNode does not align with the system of UIControl. ASControlNode does not even consider `beginTrackingWithTouch:withEvent:` or `continueTrackingWithTouch:withEvent:`.
This commit will change the ASControlNode logic around touch event handling and tracking to align with UIControl.
* Add assertion for layer backed nodes that would like to add an action target for a control event
* Adress comments
* Set the node to not opaque if it’s wrapping an UIActivityIndicatorView
* Add check for subclass of UIVisualEffectView to see if the node needs to be opaque