526 Commits

Author SHA1 Message Date
Michael Schneider
f2bc63f05a
Add way to compile out ASTextNode + TextKit dependencies (#1242)
* Add way to compile out ASTextNode + TextKit dependencies

* Compile out ASExperimentalTextNode and fix tests
2018-11-23 09:13:15 -08:00
Michael Schneider
31125ff6cf
Add Video subspec (#1240) 2018-11-21 08:30:22 -08:00
Tim Norman
5be2213c50 Convert YGUndefined back to CGFLOAT_MAX for Texture layout (#1244)
* Convert YGUndefined back to CGFLOAT_MAX for Texture layout

* Update ASYogaUtilities.mm

Quick fix to brace style
2018-11-20 07:27:53 -08:00
ricky
9cf54e8e8b [ASDisplayNode] Propagate traits before loading a subnode (#1234)
https://github.com/TextureGroup/Texture/pull/886 enforces that some nodes are loaded before they are sent a visiblity event, but it was not propagating the trait collection before forcing the load.

We are propagating traits in `_setSupernode:` (which was happening after the forced load). I moved the possible forced load to `_setSupernode:`, after propagating traits but before any visibility states are changed.
2018-11-19 17:53:00 -08:00
Adlai Holler
2baa9438d7
Have node and controller share lock (#1227)
* Have node and controller share lock

* Do it different

* Restore prior method order

* Maybe store the reference

* Try that
2018-11-15 09:50:09 -08:00
Michael Schneider
8029632460
Fix A11Y for horizontal collection nodes in Texture (#1217)
* Fix A11Y for horizontal collection nodes in Texture.

Collections have their own handling in UIKit that we shouldn't mess with. As such no nodes that contain CollectionNodes should ever be treated as AccessibilityContainers.

* Update braces
2018-11-14 08:11:32 -08:00
Kevin
771c068ad6 Correct block self references to strongSelf (#1231) 2018-11-13 08:20:20 -08:00
Michael Schneider
39f25f661e
ASCATransactionQueue interface trashing improvements (#1216)
* ASCATransactionQueue interface trashing improvements

* Use weakSelf
2018-11-11 08:43:07 -08:00
Andrew Yates
fd047d681e Make ASEditableTextNode accessible to VoiceOver (#1162)
* Make ASEditableTextNode accessible to VoiceOver

* Update CHANGELOG

* Make ASEditableTextNode an accessibility container

* Remove initial fix

* Changelog

* Correct changelog entry

* Remove isAccessibilityElement as it’s a container

* Add isNodeLoaded checks

* Remove Changelog Changes
2018-11-10 08:41:58 -08:00
Michael Schneider
53368a5cb6
Remove CHECK_LOCKING_SAFETY check (#1225)
Locking assertions are always active now
2018-11-09 07:31:28 -08:00
Adlai Holler
56e69eac78
Initialize mutex assertion variables (#1226) 2018-11-08 13:07:46 -08:00
Adlai Holler
4cfc333d81
Clean up our mutex, fix try_lock not hooking into assert mechanism (#1219)
* Clean up our mutex

* Placement new import

* Privatize
2018-11-07 10:47:48 -08:00
Michael Schneider
7edaeab839 Fix warning using __builtin_popcount (#1218) 2018-11-07 07:01:19 -08:00
Adlai Holler
e392f832f4
Rework ASTraitCollection to Fix Warnings and Remove Boilerplate (#1211)
* Clean up trait collection to fix a ton of warnings and remove code

* Support Xcode 9 (iOS 11 SDK)

* Hack harder
2018-11-06 08:31:09 -08:00
Adlai Holler
5c9815f46d
ASThread: Remove Locker, Unlocker, and SharedMutex (#1213)
* ASThread: Remove Locker, Unlocker, and SharedMutex

* Remove extra line

* Kick the CI

* Move C++ down

* Fix thing
2018-11-05 13:26:36 -08:00
Michael Schneider
5909e27e37 Fix shouldTruncateForConstrainedSize in ASTextNode2 (#1214) 2018-11-05 13:16:36 -08:00
Huy Nguyen
e745aded7d
[ASImageNode] Fix a threading issue which can cause a display completion block to never be executed (#1148)
- Clear _displayCompletionBlock while we still have the node's instance lock. Because it may not be the same block by the time the lock is reacquired. In other words, it can happen that another thread sets a new display block after this thread releases the lock but before it reacquires it. And we don't want to clear out the new block.
- Reduce a lock/unlock pair which should help perf a tiny bit.
2018-11-04 16:28:48 -08:00
Kevin
a3194f8757 Allow configuring imageCache when initializing ASPINRemoteImageDownloader. (#1197)
* Allow configuring imageCache along with NSURLSessionConfiguration when initializing ASPINRemoteImageDownloader.

* Update CHANGELOG.md

* Update Source/Details/ASPINRemoteImageDownloader.m

Co-Authored-By: wiseoldduck <kevin@wode.com>

* Put class linkage tests behind #if DEBUG

* Remove silly nil check

* Add non-nil assert

* Update documentation
2018-11-04 09:26:57 -08:00
Michael Schneider
a34f45355e Revert #1023 (#1204)
We will revert #1023. The current solution introduces problems if we are unlocking before calling _completePendingLayoutTransition. _completePendingLayoutTransition needs to be happening in one transaction if called from _u_measureNodeWithBoundsIfNecessary.
2018-11-03 12:32:15 -07:00
Michael Schneider
ecfc7835da
Add experiment flag to skip layoutIfNeeded in enterPreloadState for ASM nodes (#1201) 2018-11-03 09:44:42 -07:00
Adlai Holler
d0ba092a77
Convert the codebase to Objective-C++ (#1206)
* Convert the codebase to Objective-C++ throughout. One language is better than two.

* Put it back

* Fix linker

* Point explicitly to updated Weaver to unblock build

* Revert "Point explicitly to updated Weaver to unblock build"

This reverts commit fdc25296e8794d4e6e56c35f5fe6da2be3f71dbc.

* Revert "Fix linker"

This reverts commit 7be25f91519b8497ef42de79f115bcfbdb965c39.

* Add in the frameworks

* no message

* Address spec lint warnings

* Fix tvos build

* Put that back

* Address Michael's review

* Add comment to kick CI
2018-11-02 12:04:14 -07:00
Michael Schneider
8822bae0d5
Follow up cleanup #trivial (#1203)
* Remove whitespace at the end of the line

* Fix indentation

* Wrap if check for assertion in ASDISPLAYNODE_ASSERTIONS_ENABLED

* Add testTextNodeSwitchWorksInMultiThreadEnvironment tests
2018-11-02 07:54:15 -07:00
Adlai Holler
0380b270bb
Address Xcode warnings about unguarded availability and implicit self retains (#1207) 2018-11-01 19:40:16 -07:00
Michael Schneider
fec14f8310
Fix logic cleaning data if delegate / dataSource changes and bring over logic to ASTableView (#1200)
* Cleanup in ASTableView datasource/delegate change

* Fix experiments logic

* Add changelog entry
2018-11-01 08:08:45 -07:00
ernestmama
055d27c45a ASTextNode2 to consider both width and height when determining if it is calculating an instrinsic size (#1196) 2018-10-31 14:06:48 -10:00
Kevin
be021434c8 Newline character support and truncated line sizing improvement. (#1193)
* Newline character support and truncated line sizing improvement.

For purposes of truncating text, respect explicit newlines.
Don't size to smaller than truncated line width unless we have to.

* Update CHANGELOG.md
2018-10-30 13:19:23 -07:00
Max Wang
99fd25c5b8 A11y for scrollnode (#1188)
* 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.

* Add a11y support for ASSCrollNode.

* Changelog

* Clean up.

* fix braces

* add test

* disable for ci
2018-10-29 16:07:50 -07:00
Michael Schneider
4260cc9828 Tweak a11y label aggregation behavior to enable container label overrides (#1199)
Modified the ASDisplayNode accessibility label to only aggregate its sub-nodes' labels when it doesn't have any explicit accessibility label set on itself. If an existing label is already present, it is instead treated as an override to the container's a11y label. Added relevant tests.
2018-10-29 08:35:00 -07:00
Kevin
6ea7f06d84 Fix shadowed var warning (and add clarity) #trivial (#1198)
* Fix shadowed var warning (and add clarity)

* Update ASTextLayout.m
2018-10-29 07:55:54 -07:00
Kevin
959dafc4a1 Update ASButtonNode.mm (#1194) 2018-10-29 07:35:45 -07:00
Michael Schneider
25a3d331ee
Correct linePositionModifier behavior (#1192) 2018-10-26 07:43:22 -07:00
Michael Schneider
8382edd7ef
Move AS_TEXT_ALERT_UNIMPLEMENTED_FEATURE into ASTextNodeCommon (#1191) 2018-10-25 08:47:22 -07:00
Max Wang
14681c00c4 Assert node did load before did enter visible way 1 (#886)
* fix SIMULATE_WEB_RESPONSE not imported #449

* Fix to make rangeMode update in right time

* access layer to load node before enter visible

* revert space
2018-10-24 12:58:57 -07:00
Michael Schneider
097790317e
Yoga integration improvements (#1187)
* Thread safety for Yoga layout

* Support baseline alignments for ASYogaLayout

* Refactor ASLayoutElementYogaBaselineFunc to not require yogaParent (its parent style is set into a private var on ASLayoutElementStyle before layout instead)

* Only set the accessibility element if the view is loaded

* Add nodeWillCalculateLayout to ASNodeController

* Update Changelog

* Address first comments
2018-10-24 10:27:58 -07:00
Michael Schneider
dab3281afa
Don’t handle touches on additional attributed message if passthrough is enabled (#1184)
* Don’t handle touches on additional attributed message if passthrough is enabled

* Cleanup

* Don't handle extra inAdditionalTruncationMessage within pointInside:withEvent:

* Update changelog

* Address comments
2018-10-24 07:49:58 -07:00
Michael Schneider
1d78a3d07f Directly use __instanceLock__ to lock / unlock without having to create and destroy a MutextUnlocker (#1185) 2018-10-23 05:30:54 -10:00
Michael Schneider
3d2a612487 Remove unnecessary ASWeakProxy import (#1186) 2018-10-23 05:25:03 -10:00
Huy Nguyen
9664364e4b Small fix in ASTextKitRenderer #trivial (#1167) 2018-10-21 11:50:16 -07:00
Michael Schneider
cb154f1471 Let ASNodeController conform to NSLocking (#1179) 2018-10-21 11:49:02 -07:00
Michael Schneider
776e475558
Expose a way to determine if a text node will truncate for a given constrained size #trivial (#1177)
* Expose textLayoutForConstraint:

- Expose textLayoutForConstraint:, but make unavailable on ASTextNode
- Refactor compatibleLayoutWithContainer:text: into a static method

* Instead of textLayoutForConstraint: expose shouldTruncateForConstrainedSize: in ASTextNode
2018-10-21 09:33:26 -07:00
Michael Schneider
c958812ed6
ASTableNode init method match checks from ASCollectionNode (#1171) 2018-10-20 09:45:19 -07:00
Michael Schneider
dc49ce0615
Move import of stdatomic to ASRecursiveUnfairLock implementation file (#1180) 2018-10-19 10:41:17 -07:00
Michael Schneider
2f3c0b42e3
Expose test_resetWithConfiguration: for testing purposes (#1175)
This makes it easier to write tests for specific configurations.
2018-10-19 07:39:45 -07:00
Jia Wern Lim
e6964d1ade [ASDisplayNode] Expose default Texture-set accessibility values as properties (#1170)
* Expose default Texture-set accessibility values as properties in ASDisplayNode.

Added relevant overrides and tests.

* Quick style fixes & add default a11y overrides to ASTextNode too.
2018-10-19 07:39:21 -07:00
Michael Schneider
b11ce52e9c
Add way to suppress invalid CollectionUpdateExceptions (#1173) 2018-10-18 09:35:36 -07:00
Michael Schneider
aa44d3175a
Fix define spaces (#1176)
Defines needs to right at the #
2018-10-18 09:35:04 -07:00
Michael Schneider
7ee2092dc3
Use interface state to manage image loading. (#1172) 2018-10-18 09:34:54 -07:00
Michael Schneider
27d50b03d8
Only initialize framework once, avoid multiple across tests (#1178) 2018-10-18 09:34:29 -07:00
Michael Schneider
d669be035b
Set the default values for showsVerticalScrollIndicator and showsHorizontalScrollIndicator (#1181)
The default values of showsVerticalScrollIndicator and showsHorizontalScrollIndicator should be YES to correspond with the UIKit flags.
2018-10-18 09:34:00 -07:00
Kevin
bfb22988f7 [ASTextNode2] Add improved support for all line-break modes in experimental text node. (#1150)
* ASTextNode2 rendering corrections.

ASTextNode2 was only setting truncationMode (lineBreakMode) on existing paragraph styles in attributedString (thus having no effect for the two non-truncating modes if there were not any existing paragraph style runs).

ASTextLayout (essentially YYTextLayout) was not rendering the two non-tail truncation lineBreakModes correctly. There's not much history on github but it appears to me that it was set up correctly at one time and then some additional code was added for unclear reasons that assumed any truncation was at the end of the string.

This commit corrects both issues.

* Update CHANGELOG.md
2018-10-17 13:26:45 -07:00