Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 3d55c09

Browse files
Remove unnecessary code
1 parent ced64ca commit 3d55c09

File tree

2 files changed

+4
-40
lines changed

2 files changed

+4
-40
lines changed

shell/platform/darwin/ios/framework/Source/SemanticsObject+UIFocusSystem.mm

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -80,50 +80,14 @@ - (CGRect)frame {
8080
- (NSArray<id<UIFocusItem>>*)focusItemsInRect:(CGRect)rect {
8181
// It seems the iOS focus system rely heavily on this method (instead of
8282
// preferredFocusEnvironments) for directional navigation.
83-
// The order of the items seems to be important, menus and dialogs become
84-
// unreachable via FKA if the returned children are organized
85-
// in hit-test order.
83+
// Whether the item order in the returned array matters is unknown.
8684
//
8785
// Additionally, this method is only supposed to return items within the given
8886
// rect but returning everything in the subtree seems to work fine.
89-
NSMutableArray<SemanticsObject*>* reversedItems =
90-
[[NSMutableArray alloc] initWithCapacity:self.childrenInHitTestOrder.count];
91-
for (NSUInteger i = 0; i < self.childrenInHitTestOrder.count; ++i) {
92-
[reversedItems
93-
addObject:self.childrenInHitTestOrder[self.childrenInHitTestOrder.count - 1 - i]];
94-
}
95-
return reversedItems;
87+
return self.childrenInHitTestOrder;
9688
}
9789

9890
- (id<UICoordinateSpace>)coordinateSpace {
9991
return self.bridge->view();
10092
}
10193
@end
102-
103-
@interface FlutterScrollableSemanticsObject ()
104-
@property(nonatomic, readonly) UIScrollView* scrollView;
105-
@end
106-
107-
@interface FlutterScrollableSemanticsObject (UIFocusItemScrollableContainer) <
108-
UIFocusItemScrollableContainer>
109-
@end
110-
111-
@implementation FlutterScrollableSemanticsObject (UIFocusItemScrollableContainer)
112-
- (CGPoint)contentOffset {
113-
return self.scrollView.contentOffset;
114-
}
115-
116-
- (void)setContentOffset:(CGPoint)contentOffset {
117-
// TODO(LongCatIsLooong): implement. This method is called by the focus engine
118-
// to make the focused content visible in a scroll view when FKA is on.
119-
}
120-
121-
- (CGSize)contentSize {
122-
return self.scrollView.contentSize;
123-
}
124-
125-
- (CGSize)visibleSize {
126-
return self.scrollView.frame.size;
127-
}
128-
129-
@end

shell/platform/darwin/ios/framework/Source/SemanticsObjectTest.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,7 @@ - (void)testUIFocusItemContainerConformance {
12031203
// focusItemsInRect
12041204
NSArray<id<UIFocusItem>>* itemsInRect = [parent focusItemsInRect:CGRectMake(0, 0, 100, 100)];
12051205
XCTAssertEqual(itemsInRect.count, (unsigned long)2);
1206-
XCTAssertEqual(itemsInRect[0], child2);
1207-
XCTAssertEqual(itemsInRect[1], child1);
1206+
XCTAssertTrue([itemsInRect containsObject:child1]);
1207+
XCTAssertTrue([itemsInRect containsObject:child2]);
12081208
}
12091209
@end

0 commit comments

Comments
 (0)