mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Split the too-large `Semantics` [MRC to ARC migration](https://github.com/flutter/flutter/issues/137801) into two PRs: this one, which refactors, and the next which will actually do the migration. 1. Use properties instead of their backing ivars (except in the usual init, dealloc, getters/setters) 2. For Foundation collections prefer `copy` over `strong`. 3. Dot notation for properties 4. Change `privateSetParent:` to instead use a `readwrite` property in `SemanticsObject ()`. 5. Switch the `semanticsObject` property from `weak` to `retain` to get the synthesized property (keeping it as `weak` is a compilation error in MRC) but I'll swap it back to a `weak` in the ARC migration PR coming next. 6. `SemanticsObjectTest` fails on my machine and passes on CI. Switched the cleaner `CGRectEqualToRect` (and related) checks to instead assert x, y, width, height so we can see the value when it fails: ``` ((CGSizeEqualToSize( scrollView.contentSize, CGSizeMake((w + scrollExtentMax) * effectivelyScale, h * effectivelyScale))) is true) failed ``` becomes: ``` ((scrollView.contentSize.height) equal to (h * effectivelyScale)) failed: ("33.3333333333") is not equal to ("33.333336") ``` Use `XCTAssertEqualWithAccuracy` now that I can see it's a floating point precision issue.