Commit Graph
25 Commits
Author SHA1 Message Date
ricky d085cd6349 [ASDisplayViewAccessibility] A few accessibility improvements (#1812)
* [ASDisplayViewAccessibility] A few accessibility improvements

This diff includes a few improvements for accessibility in Texture.

* When determining a node’s accessibility elements, ignore any elements that are hidden, transparent, or out of the window. This matches UIKit’s behavior.
* When sorting the accessible elements and their origins are equal, give precedence to elements with shorter accessibility frames, followed by elements with narrower widths.
* Allow the ability to customize the comparator block that sorts the accessibility elements
* Create an experiment to stop caching accessibilityElements in `_ASDisplayView`. If we cache elements, we will require users to clear the cache (by calling `setAccessibilityElements` to get the side effect of clearing the cache) when nodes change their hidden state or opacity. This seems like a lot to request of the user. We will put this in an experiment so we can see the perf implication is both when using voice over and when not using voice over.

A few other notes:
* I got rid of the `ASAccessibilityElementPositioning` protocol in favor of passing `NSObjects` to the sort comparator. `NSObject` implements the informal `UIAccessibilityProtocol` and therefore has an `accessibilityFrame` property.
* I removed `static` from the `SortAccessibilityElements()` method definition. This allows me to declare it as `extern` in test it via unit tests.
2020-05-06 11:10:35 -07:00
trufflinandrgupta-pinterest 70613a655a Pruning ASExperimentalRemoveTextKitInitialisingLock code. (#1766)
* Remove code for unused ASExperimentalRemoveTextKitInitialisingLock experiment.

* Prune some additional unnecessary references.

Co-authored-by: rgupta-pinterest <59977334+rgupta-pinterest@users.noreply.github.com>
2020-01-28 14:37:55 -08:00
Greg Bolsinga c67acab290 Remove ASExperimentalTransactionOperationRetainCycle (#1547)
* Remove ASExperimentalTransactionOperationRetainCycle
2019-06-13 15:42:24 -07:00
Garrett Moon a3f25d05f9 Remove the text rendering experiment. (#1531)
* Remove the text rendering experiment. It decreased rendering speeds at a negligible improvement to OOMs.

* Adopt new ASGraphicsCreateImageWithOptions API
2019-06-03 08:56:31 -07:00
Michael Schneider 08d5e81e3b Remove ASExperimentalDisableAccessibilityCache (#1515)
* Remove ASExperimentalDisableAccessibilityCache

* Some more removal
2019-05-29 09:38:01 -07:00
Huy Nguyen e1859a1029 Ship ASExperimentalImageDownloaderPriority (#1480) 2019-05-21 22:23:24 -07:00
Huy Nguyen bf82b56253 Ship ASExperimentalFixRangeController (#1486) 2019-05-06 17:20:16 -07:00
Wu Zhong 5aef12d4fb Try to remove global lock when initialising TextKit components (#1455)
* Try to remove global lock when initialising TextKit components

* Adding experiment flag to dis/enable lock of textkit component

* Adding tests

* code clean

fix typo

Make remove lock optional

Keep locks

code clean
2019-04-22 11:29:34 -07:00
Michael Zuccarino 27cc0f2717 Experiment with disabling ASViewController background dealloc (#1420) 2019-03-25 14:11:04 -07:00
Huy Nguyen 09365b90ee Fix bug in ASRangeController that causes some cell nodes of a collection view which is about to becomes invisible to load their backing view/layer and render (#1418) 2019-03-22 06:40:18 -07:00
ernestmama 6f44c3921e Remove experimental features (exp_skip_a11y_wait && exp_new_default_cell_layout_mode) (#1383)
* Remove experimental features

* prevent blocking main thread

* remove small content all together as none is the default

* Update ASExperimentalFeatures.h
2019-03-11 13:34:35 -07:00
Garrett Moon 9b80eabd8f Adds support for using UIGraphicsImageRenderer in ASTextNode. (#1384)
* Adds support for using UIGraphicsImageRenderer in ASTextNode.

In many cases this reduces the backing store of text nodes by 1/2.

* Guard for UIGraphicsRenderer availability.

* Comma
2019-03-09 07:55:46 -08:00
Huy Nguyen d102ec81ee Experiment with different strategies for image downloader priority (#1349)
Right now when an image node enters preload state, we kick off an image request with the default priority. Then when it enters display state, we change the priority to "imminent" which is mapped to the default priority as well. This means that requests from preload and display nodes have the same priority and are put to the same pool. The right behavior would be that preload requests should have a lower priority from the beginning.

Another problem is that, due to the execution order of -didEnter(Preload|Display|Visible)State calls, a node may kick off a low priority request when it enters preload state even though it knows that it's also visible. By the time -didEnterVisibleState is called, the low priority request may have already been consumed and the download/data task won't pick up the new higher priority, or some work needs to be done to move it to another queue. A better behavior would be to always use the current interface state to determine the priority. This means that visible nodes will kick off high priority requests as soon as -didEnterPreloadState is called.

The last (and smaller) issue is that a node marks its request as preload/low priority as soon as it exits visible state. I'd argue that this is too agressive. It may be reasonble for nodes in the trailing direction. Even so, we already handle this case by (almost always) have smaller trailing buffers. So this diff makes sure that nodes that exited visible state will have imminent/default priority if they remain in the display range.

All of these new behaviors are wrapped in an experiment and will be tested carefully before being rolled out.

* Add imports

* Fix build failure

* Encapsulate common logics into methods

* Address comments
2019-03-08 08:11:03 -08:00
Garrett Moon fce6f23b97 Launches switching ASNetworkImageNode callbacks to global queue. (#1369)
* Launches switching ASNetworkImageNode callbacks to global queue.

* Good catch configuration tests!
2019-03-07 09:47:56 -08:00
Adlai Holler efeb3d2749 Add an experimental flag to use native dispatch_apply (#1345)
* Add an experimental flag to use native dispatch_apply instead of our core count * 2 approach. This has shown performance wins in some profiling.

* Add in other places
2019-02-21 12:33:39 -08:00
Huy Nguyen f1801388be Add experiments to skip waiting for updates of collection and table views under some circumstances (#1311)
* Add experiment to skip waiting until all updates of collection/table view are committed in -accessibilityElements

The wait was introduced in #1217 which blocks the main thread until updates are proccessed. We suspect this causes perf regressions accross the app and need to confirm this via an experiment.

* Add option to skip default behavior of ASCellLayoutMode

* Fix unit test

* Fix unit test in another way

* Remove import

* Minor change

* Add ASCellLayoutModeSyncForSmallContent

* Update unit tests

* Remove unnecessary change

* Remove unnecessary changes
2019-01-24 10:13:54 -08:00
Huy Nguyen 17e56042d3 Add a way to opt out of always-clear-data behavior in ASCollectionView and ASTableView (#1284) 2018-12-20 13:47:58 -08: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
Adlai Holler b136e84b4e Add an experimental framesetter cache in ASTextNode2 (#1063)
* Add an experimental framesetter cache in ASTextNode2, and stop keeping framesetters around

* Update configuration schema

* Fix imports

* Fix import again and remove set statement
2018-08-04 07:33:53 -07:00
Adlai Holler a0e5f4c002 Create an experiment to remove extra collection teardown step (#975)
* Create an experiment to remove extra collection teardown step, simplify delegate proxy

* chagelog

* Remove detritus
2018-06-19 08:32:02 -07:00
Adlai Holler 8b890f07be Create a new dealloc queue that is more efficient (#931)
* Fork dealloc queue in an experiment

* Fix and put back

* Use the right selector

* Go simpler

* Clarify name

* Type inference

* Use CFTypeRefs like a boss

* Improve comments

* License header
2018-05-22 09:06:24 -07:00
Garrett Moon 3981f1724e #trivial Add forgotten experiment into Schemas/configuration.json (#912) 2018-05-11 17:25:25 +01:00
Adlai Holler d97065ca39 Update configuration schema (#893) 2018-05-05 09:48:19 -07:00
Adlai Holler 4bbbd725de Introduce ASRecursiveUnfairLock and tests (#858)
* Introduce ASRecursiveUnfairLock and tests

* Document it and put underscores to scare people away

* Increment changelog

* Integrate it with ASDN::Mutex behind experiment

* Rename the experiment

* Love these license headers oh so much

* Move internal header because we have to

* Address Jon's feedback
2018-03-28 11:29:50 -07:00
Adlai Holler 27fac9f586 Create a centralized configuration API (#747)
* Update the dangerfile

* Make a trivial change to test new dangerfile

* Try out the new value with another trivial change

* Add a configuration API to make a unified place for pulling config from clients safely

* Specify properties for delegate

* Finish removing text experiment global enable

* Generate the config file

* Clean up configuration to fix tests

* Work on making it serializable

* Finish it up

* Fix example code

* Update sample project

* Clean up a few things

* Align with new project order

* Make it faster and update license header

* Add an option to specify your config at compile time

* Update another license header

* Add a version field, and bring interface state coalescing into configuration

* Update CA queue code

* Update CATransactionQueue tests

* Turn transaction queue on by default (for now, see comment)

* Update the tests

* Update the tests AGAIN

* Remove unused ordered set
2018-03-25 12:52:57 -07:00