diff --git a/apps/automated/src/ui/view/view-tests.ios.ts b/apps/automated/src/ui/view/view-tests.ios.ts index 7471c0fdf..72a61afd0 100644 --- a/apps/automated/src/ui/view/view-tests.ios.ts +++ b/apps/automated/src/ui/view/view-tests.ios.ts @@ -77,16 +77,11 @@ export function testBackgroundInternalChangedOnceOnResize() { TKUnit.assertEqual(trackCount(), 1, 'Expected background to be re-applied at most once when the view is laid-out on 0 0 200 200.'); - // Ignore safe area as it may result in re-calculating view frame, thus trigger a size change regardless - layout.iosIgnoreSafeArea = true; - layout.requestLayout(); layout.layout(50, 50, 250, 250); TKUnit.assertEqual(trackCount(), 0, 'Expected background to NOT change when view is laid-out from 0 0 200 200 to 50 50 250 250.'); - layout.iosIgnoreSafeArea = false; - layout.requestLayout(); layout.layout(0, 0, 250, 250); diff --git a/packages/core/ui/core/view/index.ios.ts b/packages/core/ui/core/view/index.ios.ts index 39d3d2f48..fe6658dd6 100644 --- a/packages/core/ui/core/view/index.ios.ts +++ b/packages/core/ui/core/view/index.ios.ts @@ -106,14 +106,13 @@ export class View extends ViewCommon implements ViewDefinition { @profile public layout(left: number, top: number, right: number, bottom: number, setFrame = true): void { - const result = this._setCurrentLayoutBounds(left, top, right, bottom); - let { sizeChanged } = result; + const { boundsChanged, sizeChanged } = this._setCurrentLayoutBounds(left, top, right, bottom); if (setFrame) { this.layoutNativeView(left, top, right, bottom); } - const needsLayout = result.boundsChanged || (this._privateFlags & PFLAG_LAYOUT_REQUIRED) === PFLAG_LAYOUT_REQUIRED; + const needsLayout = boundsChanged || (this._privateFlags & PFLAG_LAYOUT_REQUIRED) === PFLAG_LAYOUT_REQUIRED; if (needsLayout) { let position: Position; @@ -121,14 +120,6 @@ export class View extends ViewCommon implements ViewDefinition { // on iOS 11+ it is possible to have a changed layout frame due to safe area insets // get the frame and adjust the position, so that onLayout works correctly position = IOSHelper.getPositionFromFrame(this.nativeViewProtected.frame); - - if (!sizeChanged) { - // If frame has actually changed, there is the need to update view background and border styles as they depend on native view bounds - // To trigger the needed visual update, mark size as changed - if (position.left !== left || position.top !== top || position.right !== right || position.bottom !== bottom) { - sizeChanged = true; - } - } } else { position = { left, top, right, bottom }; } diff --git a/packages/core/ui/styling/background.ios.ts b/packages/core/ui/styling/background.ios.ts index 01632991a..aa869441a 100644 --- a/packages/core/ui/styling/background.ios.ts +++ b/packages/core/ui/styling/background.ios.ts @@ -9,7 +9,6 @@ import { ImageSource } from '../../image-source'; import type { CSSValue } from '../../css-value/reworkcss-value'; import { parse as cssParse } from '../../css-value/reworkcss-value.js'; import { BoxShadow } from './box-shadow'; -import { Length } from './style-properties'; import { BackgroundClearFlags } from './background-common'; import { ClipPathFunction } from './clip-path-function';