4846 Commits

Author SHA1 Message Date
Adlai Holler
0380b270bb
Address Xcode warnings about unguarded availability and implicit self retains (#1207) 2018-11-01 19:40:16 -07:00
Kevin
fde47a5e28 Add tests for accessibility (#1205) 2018-11-01 08:10:44 -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
Andrew Yates
eab0fc200b Migrate placeholder example project from 1.0 to 2.x (#1164) 2018-10-17 08:02:47 -07:00
Michael Schneider
072df8962c
Fix mismatch in UIAccessibilityAction selector method (#1169)
* Fix mismatch in UIAccessibilityAction selector method

* Update changelog
2018-10-17 08:02:10 -07:00
Huy Nguyen
393ca818b0 Update Jekyll to 3.6.3 (#1165)
Seeing a warning from GitHub that suggests to update Jekyll because of this vulnerability:

> Jekyll through 3.6.2, 3.7.x through 3.7.3, and 3.8.x through 3.8.3 allows attackers to access arbitrary files by specifying a symlink in the "include" key in the "_config.yml" file.

[CVE-2018-17567](https://nvd.nist.gov/vuln/detail/CVE-2018-17567)
2018-10-16 10:04:58 -07:00
Huy Nguyen
7cdfacca4a
Update documentation of ASNetworkImageNodeDelegate #trivial (#1163)
`-imageNodeDidStartFetchingData:` and `-imageNodeDidFinishDecoding:` are always called on main thread, and the documentation should reflect that.
2018-10-14 09:16:47 -07:00
Max Wang
17f24aad3d Mismatch name experimental features (#1159)
* 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 mismatch of name array and experimental features

* add more tests

* remove nslog

* add change log

* fix tests
2018-10-11 12:01:37 -07:00
Huy Nguyen
70329f5730
ASTextNode2 to ignore certain text alignments while calculating intrinsic size (#1166)
ASTextNode2 uses ASTextLayout to calculate its layout and bounding rect. When the constrained width that is used for layout calculation is inf/max (e.g when the node is inside a horizontal stack), ASTextLayout doesn't ignore its right/center/natural text alignment but takes it into account. That results in an unreasonable size (and position).

Fix by detecting when the node is calculating intrinsic size and force its layout alignment to be left. Other alignments should still work when the max width is finite/reasonable.
2018-10-10 21:40:22 -07:00
Max Wang
affddb0e96 Set default tuning params (#1158)
* 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.

* Only test when photo library is enabled.

It will fail to build if photo library is disabled cause the test is
depending on it.

* Add ChangeLog.

* set default tuning parameters for collection/table node

* add change log

* Move to framework private.

* Apply to tableNode

* trigger ci

* fix directory

* fix file link
2018-10-10 10:46:33 -07:00
Michael Schneider
a3763c9c91
Fix crash if setting attributed text on multiple threads (#1141) 2018-10-09 07:39:38 -07:00
Eric Jensen
565da7d493 Add missing NS_NOESCAPE in overwritten methods (#1139)
Fixes -Wmissing-noescape warnings
2018-10-04 09:33:08 -07:00
Huy Nguyen
e70325563a
Only clear ASCollectionView's data during deallocation (#1154)
This is a follow up on #1136. Our experiment results show that clearing data frequently is the cause of our #1 crash. @maicki and I believe that this is because if the collection view is being used, silently clearing its data without notifying the backing UICollectionView can put it out-of-sync and causes mayhem next time the collection view processes a batch update. If you look at the stack trace closely, you'll notice that the crash doesn't occur on the same run loop that clearData is called. This made it extremely tricky to investigate and identify the root cause.

Another interesting question would be whether or not we want to clear the data during deallocation at all, since the data will be cleared out soon anyway.
2018-10-03 16:14:01 -07:00
Michael Zuccarino
9588692361 Clean up timing of layout tree flattening/ copying of unflattened tree for Weaver (#1157)
* Simpler Huy fix for more efficient delayed flattening of the layout tree

* Nit

* Remove pbx changes

* Update CHANGELOG.md

* Add note about change in timing of _flattenedLayout capture
2018-10-03 14:49:15 -07:00
ernestmama
5e0579308d Rollout ASDeallocQueueV2 #trivial (#1143) 2018-10-01 11:20:12 -07:00
Max Wang
f656dbbedd Guard photo library with macro for tests (#1147)
* 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.

* Only test when photo library is enabled.

It will fail to build if photo library is disabled cause the test is
depending on it.

* Add ChangeLog.
2018-09-28 09:14:52 -07:00
Huy Nguyen
5dd5611c2c
Add missing comma in ASExperimentalFeatures #trivial (#1137) 2018-09-20 15:46:39 -07:00
Michael Schneider
4708522bd0
Add ASExperimentalSkipClearData #trivial (#1136)
* Add ASExperimentalSkipClearData

* Move the experiment check within the if clause
2018-09-20 09:22:18 -07:00
Eric Jensen
696f344301 Fix compilation warnings #trivial (#1132)
* 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
2018-09-20 07:54:10 -07:00
ernestmama
71ef0fc3ed Fix downloader method name mismatch #trivial (#1134) 2018-09-19 13:07:06 -07:00
Adlai Holler
ceed2d2008 Remove reliance on shared_ptr for ASDisplayNodeLayouts (#1131)
* Remove reliance on shared_ptr for ASDisplayNodeLayouts

* Fix up

* Fix in yoga

* Back to let

* Returns inner pointer

* Trivial change to kick the CI
2018-09-19 11:23:19 -07:00
Michael Schneider
cd608c9b18
Remove necessity to use view to access rangeController in ASTableNode, ASCollectionNode (#1103) 2018-09-19 07:51:46 -07:00
Adlai Holler
69ed9562df
Remove ASRectMap, which is not worth its own weight (#1127) 2018-09-18 11:58:24 -07:00
Adlai Holler
d2984ced8d Make yoga & layout specs faster by eliminating some copies (#1128) 2018-09-18 07:26:29 -07:00