2327 Commits
Author SHA1 Message Date
Michael Schneider 3e89cf0067 [ASTextNode] Fix ASTextNode shadow is not rendering (#2042)
* Passing through shadow in renderer attribute

* Fix memory leak setting shadow color
2016-08-15 16:07:30 -07:00
Michael Schneider 0e32802900 [ASThread] Add SharedLocker and SharedUnlocker that uses a shared pointer for the mutex (#2047)
* Add SharedLocker and SharedUnlocker that uses a shared pointer for the mutex

* Move ASTextKitContext to use Shared Locker
2016-08-15 16:06:54 -07:00
Scott Goodson 4c55f9555c Revert "[Layout Transition API] Simplify applying layout transition (#1886)"
This reverts commit 678df37017.
2016-08-04 19:28:07 -07:00
Michael Schneider 4d71887432 Merge branch 'master' into releases/p6.9 2016-08-02 10:16:02 -07:00
Michael Schneider d5cbe33686 Revert "[ASLayoutSpec] Use childrenMap directly to prevent creating an NSArray within ASDK Part 2 (#2021)"
This reverts commit d5a7c19522.
2016-08-02 10:10:36 -07:00
Hannah Trosi 953e2dbcaa Merge branch 'master' into releases/p6.9 2016-08-01 19:43:41 -07:00
Michael Schneider d5a7c19522 [ASLayoutSpec] Use childrenMap directly to prevent creating an NSArray within ASDK Part 2 (#2021)
* Revert "Revert "[ASLayoutSpec] Use childrenMap directly to prevent creating an NSArray within ASDK (#1937)""

This reverts commit 735b4ebd08.

* Fix crash and add exception for mutating while using fast enumeration of ASLayoutSpec children

NSFastEnumeration is potentially quite dangerous in the wrong hands. In particular, it does not provide a safe mechanism for you to return temporary objects directly, and it does not provide any guarantee that you will be called when the enumeration has completed; therefore if we generate temporaries and store them in an instance variable, we will not necessarily be able to clean them up! This means fast enumeration methods should never be called within an autorelease pool or the autorelease pool be drained within the fast enumeration loop.

The reason is we store references to objects in the stackBuf struct by casting the child pointer to __autoreleasing id. If we pop the autorelease pool between calls to -countByEnumeratingWithState:objects:count:, it will die in a messy explosion of pointer dereferences and EXC_BAD_ACCESS.

* Add tests for ASDisplayNode and ASLayoutSpec fast enumeration
2016-08-01 18:08:48 -07:00
Michael Schneider 3a1a987dbe Fix not propagating updating and propagating down the layout transition id if a subnode is added (#2018)
If a node was added to a supernode, the supernode could be in a layout pending state. All of the hierarchy state properties related to the transition need to be copied over as well as propagated down the subtree. This is especially important as with Implicit Hierarchy Management adding subnodes can happen while a transition is in fly
2016-08-01 09:44:02 -07:00
Scott Goodson 4abe306005 Merge branch 'master' into releases/p6.9 2016-07-31 18:44:05 -07:00
Scott Goodson 735b4ebd08 Revert "[ASLayoutSpec] Use childrenMap directly to prevent creating an NSArray within ASDK (#1937)"
Something interesting going on here with ARC / Objective-C++ that we are investigating and will re-land.

This reverts commit c90ed08d10.
2016-07-31 18:43:20 -07:00
Scott Goodson d006d38f84 Merge branch 'master' into releases/p6.9 2016-07-31 18:30:48 -07:00
Michael Schneider c797fdf23a Use children directly instead of fast enumeration of ASEnvironment object (#2015) 2016-07-31 18:29:38 -07:00
Scott Goodson 589efefcf2 [ASDimension] Disable assertions for Percent values being between 0.0 and 1.0.
This triggers on existing code that needs to be updated, but also there is some investigation
needed as to whether it is a valid use case to have a >1.0 value in order to position greater-than-bounds elements.
2016-07-30 23:44:46 -07:00
Scott Goodson 06580a4a07 Revert "add assertion for ASRelativeDimensionTypePercent value to be between 0-1 (#2009)"
This reverts commit ff2c47c415.

Reverting for 6.9 as this is currently incompatible with Pinterest.
2016-07-30 18:59:06 -07:00
appleguy 965fe05c11 [ASDisplayNode] Ensure that nil can never be returned from -measureWithSizeRange: (#2014)
* [ASDisplayNode] Ensure that nil can never be returned from -measureWithSizeRange:

This can happen in rare cases when multiple relayouts occur while a transition is being measured.

* [ASDisplayNode] Use ternary operator style for nil check.
2016-07-30 18:04:08 -07:00
gazreese e0ada479a0 [ASVideoPlayerNode] Expose the UIActivityIndicatorViewStyle to clients (#1911) 2016-07-29 11:09:38 -07:00
Michael Schneider c90ed08d10 [ASLayoutSpec] Use childrenMap directly to prevent creating an NSArray within ASDK (#1937)
* Use childrenMap directly to prevent creating an NSArray in ASDK for ASLayoutSpec children

* Add locking for parent property in ASLayoutSpec

* Remove unnecessary import

* Add newline

* Add NSFastEnumeration to ASEnvironment and ASDisplayNode / ASLayoutSpec

* Change NSMutableArray initializer to arrayWithCapacity:

* Move ASLayoutSpec+Private.h into Private folder

Fixes building with Swift

* Remove lock for ASLayoutSpec parent
2016-07-29 10:53:31 -07:00
Michael Schneider 678df37017 [Layout Transition API] Simplify applying layout transition (#1886)
* Simplify applying layout transition in preparation for bigger layout transition API work

* Change from apply to complete in if layout transitions are involved and _applyLayout: to _setCalculatedLayout: for layout

* Change to applySubnodeInsertions and applySubnodeRemovals

* Change from completeTransition to commitTransition and flip logic around when to trampoline to the main thread for implicit hierarchy management

* More internal API improvements

* Fix merge conflicts

* Rename _layout to _calculatedLayout
2016-07-29 10:52:55 -07:00
Hannah Troisi ff2c47c415 add assertion for ASRelativeDimensionTypePercent value to be between 0-1 (#2009) 2016-07-29 10:38:20 -07:00
Adlai Holler 6a21daa80f [ASInternalHelpers] Use type-generic math (#2006) 2016-07-28 20:44:14 -07:00
Adlai Holler 5ff5a27717 [ASTextKitComponents] Remove unused, somewhat dangerous functions (#2007)
[ASTextKitComponents] Remove Unused Scale Conversion Functions
2016-07-28 20:43:27 -07:00
Yue-Wang-Google 7426c1dd66 Fixed implicit cast for 64-bit devices in ASTextKitComponents.h (#1994) 2016-07-28 17:03:02 -07:00
Hannah Troisi 79e44207e8 Merge pull request #1993 from Yue-Wang-Google/patch-2
[ASRangeController] Fix import misspelling
2016-07-28 15:15:54 -07:00
Yue-Wang-Google d481ce5423 [ASTextNode] Fix ascender to include line height specified in attributed string paragraph style (#1997)
* Fix ASTextNode's ascender to also include the line height specified by paragraph style in the attributed string.

* Merge conflict (original patch is for an old version)
2016-07-28 10:53:48 -07:00
Yue-Wang-Google 93a5c36a39 Fixed typo in ASCollectionViewFlowLayoutInspector.m pertaining to supplementary node layout. (#1996)
Patch from iOS teams at Google Inc.
2016-07-28 10:13:49 -07:00
ricky f0b1f12160 [ASEnvironmentTraitCollection] default user interface idiom to UIUserInterfaceIdiomUnspecified (#1998)
* [ASEnvironmentTraitCollection] default user interface idiom to ASEnvironmentTraitCollection

UIUserInterfaceIdiomUnspecified is -1 so we were actually defaulting our trait collection to UIUserInterfaceIdiomPhone (which is 0).

* Fix a few places where we weren’t using the default method to create the base traits
2016-07-28 10:03:32 -07:00
Yue-Wang-Google b59e368b71 [PATCH] Fix capitalizations in imports. 2016-07-27 14:17:56 -07:00
Yue-Wang-Google 95bf8bbe1f Fix ASTextNode truncation string (#1992)
Initial PR to open source our internal ASDK patch list from Google Inc. :)
2016-07-27 13:18:21 -07:00
Hannah Troisi f5b3a282af Fix Pinterest Xcode 7.3.1 Analyzer Warnings (#1988) 2016-07-27 08:23:16 -07:00
Adlai Holler aeec0b1a14 [ASChangeSetDataController] Enable some assertions (#1984) 2016-07-25 17:28:24 -07:00
Michael Schneider e010cd3d9e Fix compiler warnings in _ASHierarchyChangeSet on 32bit (#1982) 2016-07-25 13:17:10 -07:00
Alice Chang 2bf1b56f55 fixed potential ASPINRemoteImageDownloader crash (#1972) 2016-07-24 16:01:15 -07:00
Adlai Holler a79c69a5f1 [ASWeakSet] Refactor to use NSHashTable (#1976)
[ASWeakSet] Tweak it

[ASWeakSet] Simplify
2016-07-24 15:31:09 -07:00
Levi McCallum 304df12f71 Add recursive description debugging method to ASLayout (#1975)
* Add recursiveDescription debugging method

* Add recursive description implementation

* Add LayoutableObject to ASLayout description
2016-07-24 15:12:53 -07:00
Levi McCallum c6b17ba7bb Add description to ASLayout (#1973)
* Add description to ASLayout

* Constrained size is a size range, print correctly

* Add missing closing bracket
2016-07-23 20:12:26 -07:00
Tim Johnsen a6e03e8d93 Fix issue causing ASPINRemoteImageDownloader to return incorrect progress values. (#1966) 2016-07-23 20:09:58 -07:00
Adlai Holler 7ec6f07953 [General] Remove dead code, check optional protocol selector before calling (#1970) 2016-07-22 13:09:28 -07:00
Michael Schneider 050fb626fa Merge pull request #1965 from maicki/MSFixCrashInsertNilNode
[ASDisplayNode] Don't crash if inserting a nil node
2016-07-21 16:38:16 -07:00
Adlai Holler 3bfa60c445 Move ASDataController+Subclasses.h to fix Swift build 2016-07-21 15:52:24 -07:00
Michael Schneider 9b47a9114a Fix compiler warning in as_smallDescription on 32 bit (#1964) 2016-07-21 14:52:21 -07:00
Michael Schneider 4b9ee3c64d Don't crash if inserting a nil node 2016-07-21 14:41:19 -07:00
Adlai Holler 8cde594de3 [ASDataController] Add validation logic to the change set to throw exceptions on invalid updates (#1894)
[_ASHierarchyChangeSet] Oopsy daisy

[ASDataController] Tweak our update validation

[ASHierarchyChangeSet] Fix bugs

Finish up some stuff

[ASDataController] Put some stuff back

[ASChangeSetDataController] Always use changeset

[ASDataController] Put other stuff back

[_ASHierarchyChangeSet] Use fast enumeration

[_ASHierarchyChangeSet] Fix assertion format strings, return on fail so we don't crash in production

[ASDataController] Store data source item counts as vector rather than NSArray

[ASDataController] Build some tests for the update validation

[ASDataController] Fix issues with update validation

Get rid of new file

[ASDataController] Suppress changeset validation before initial reload

[ASDataController] Make invalid update log vs. exception publicly toggleable
2016-07-21 14:37:51 -07:00
Levi McCallum 0c70bca2bd [ASVideoNode] Fix conditional that prevented local asset loading (#1962)
* Fix conditional that prevented local asset loading

* Allow setting new asset to clear previously set URL
2016-07-21 10:39:31 -07:00
Max Gu 1d4620edce Adding documentation for assetURL in ASVideoNode, and adding a mutex lock for assetURL setter (#1961)
* Adding comment in ASVideoNode.h for the assetURL property

* Adding a mutexlock in setAssetURL in ASVideoNode
2016-07-20 18:40:49 -07:00
Adlai Holler 5723f603c1 Merge pull request #1954 from Xinchi/HLS_issue
Hls issue
2016-07-20 17:56:56 -07:00
Max Gu 6bd287086c Addressing Adlai's comment 2016-07-20 17:33:34 -07:00
Max Gu b8ad8d6cc0 Combine 2 if statements into 1 2016-07-20 17:09:23 -07:00
Max Gu 76303f3799 Setting the internal asset to the player item's asest 2016-07-20 17:03:57 -07:00
Max Gu b04aa2e2bc Removing some unused method 2016-07-20 16:07:17 -07:00
Max Gu f6eaa43315 Adding the new ASVideoNode API that allows for video player item construction with URL 2016-07-20 16:01:14 -07:00