Fix incorrect results from css_usesFlexbox
Summary: With the current implementation, as long as you had set a value on usesFlexbox (YES or NO), it would return YES. This fixes it. Reviewed By: amonshiz Differential Revision: D4124485 fbshipit-source-id: 32fe4ec0109b5c8678a112f9d4295bd17a6f6dc2
This commit is contained in:
committed by
Facebook Github Bot
parent
26e7490fc9
commit
d8662805d5
@@ -46,4 +46,16 @@
|
|||||||
XCTAssertEqual(0, CSSNodeGetInstanceCount());
|
XCTAssertEqual(0, CSSNodeGetInstanceCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)testUsesFlexbox
|
||||||
|
{
|
||||||
|
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
|
XCTAssertFalse([view css_usesFlexbox]);
|
||||||
|
|
||||||
|
[view css_setUsesFlexbox:YES];
|
||||||
|
XCTAssertTrue([view css_usesFlexbox]);
|
||||||
|
|
||||||
|
[view css_setUsesFlexbox:NO];
|
||||||
|
XCTAssertFalse([view css_usesFlexbox]);
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@@ -56,11 +56,8 @@
|
|||||||
|
|
||||||
- (BOOL)css_usesFlexbox
|
- (BOOL)css_usesFlexbox
|
||||||
{
|
{
|
||||||
if (objc_getAssociatedObject(self, @selector(css_usesFlexbox))) {
|
NSNumber *usesFlexbox = objc_getAssociatedObject(self, @selector(css_usesFlexbox));
|
||||||
return YES;
|
return [usesFlexbox boolValue];
|
||||||
} else {
|
|
||||||
return NO;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)css_setDirection:(CSSDirection)direction
|
- (void)css_setDirection:(CSSDirection)direction
|
||||||
|
Reference in New Issue
Block a user