diff --git a/engine/src/flutter/ci/licenses_golden/licenses_flutter b/engine/src/flutter/ci/licenses_golden/licenses_flutter index 5bcc7614d1..2ff1090c11 100644 --- a/engine/src/flutter/ci/licenses_golden/licenses_flutter +++ b/engine/src/flutter/ci/licenses_golden/licenses_flutter @@ -3503,6 +3503,7 @@ ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterVie ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterViewTest.mm + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/KeyCodeMap.g.mm + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/KeyCodeMap_Internal.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/NSView+ClipsToBounds.h + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/TestFlutterPlatformView.h + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/TestFlutterPlatformView.mm + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/embedder/embedder.cc + ../../../flutter/LICENSE @@ -6288,6 +6289,7 @@ FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterViewP FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterViewTest.mm FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/KeyCodeMap.g.mm FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/KeyCodeMap_Internal.h +FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/NSView+ClipsToBounds.h FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/TestFlutterPlatformView.h FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/TestFlutterPlatformView.mm FILE: ../../../flutter/shell/platform/darwin/macos/framework/module.modulemap diff --git a/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterMutatorView.mm b/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterMutatorView.mm index 3c079c1a6b..0c5c4af7b3 100644 --- a/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterMutatorView.mm +++ b/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterMutatorView.mm @@ -5,12 +5,13 @@ #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterMutatorView.h" #include - #include #include "flutter/fml/logging.h" #include "flutter/shell/platform/embedder/embedder.h" +#import "flutter/shell/platform/darwin/macos/framework/Source/NSView+ClipsToBounds.h" + @interface FlutterMutatorView () { // Each of these views clips to a CGPathRef. These views, if present, // are nested (first is child of FlutterMutatorView and last is parent of @@ -395,6 +396,7 @@ NSMutableArray* ClipPathFromMutations(CGRect master_clip, const MutationVector& _platformView = platformView; _pathClipViews = [NSMutableArray array]; self.wantsLayer = YES; + self.clipsToBounds = YES; } return self; } diff --git a/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterMutatorViewTest.mm b/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterMutatorViewTest.mm index da734aea67..5699b1480d 100644 --- a/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterMutatorViewTest.mm +++ b/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterMutatorViewTest.mm @@ -6,6 +6,8 @@ #include "third_party/googletest/googletest/include/gtest/gtest.h" +#import "flutter/shell/platform/darwin/macos/framework/Source/NSView+ClipsToBounds.h" + @interface FlutterMutatorView (Private) @property(readonly, nonatomic, nonnull) NSMutableArray* pathClipViews; @@ -96,6 +98,12 @@ TEST(FlutterMutatorViewTest, BasicFrameIsCorrect) { EXPECT_NE(mutatorView.platformViewContainer, nil); } +TEST(FlutterMutatorViewTest, ClipsToBounds) { + NSView* platformView = [[NSView alloc] init]; + FlutterMutatorView* mutatorView = [[FlutterMutatorView alloc] initWithPlatformView:platformView]; + EXPECT_TRUE(mutatorView.clipsToBounds); +} + TEST(FlutterMutatorViewTest, TransformedFrameIsCorrect) { NSView* platformView = [[NSView alloc] init]; FlutterMutatorView* mutatorView = [[FlutterMutatorView alloc] initWithPlatformView:platformView]; diff --git a/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputPlugin.h b/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputPlugin.h index fb099aa113..d5e23c8d5a 100644 --- a/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputPlugin.h +++ b/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputPlugin.h @@ -9,11 +9,6 @@ @class FlutterTextField; -@interface NSView (ClipsToBounds) -// This property is available since macOS 10.9 but only declared in macOS 14 SDK. -@property BOOL clipsToBounds API_AVAILABLE(macos(10.9)); -@end - /** * A plugin to handle text input. * diff --git a/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputPlugin.mm b/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputPlugin.mm index 6a9c948ab5..80e7fb946a 100644 --- a/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputPlugin.mm +++ b/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputPlugin.mm @@ -16,6 +16,7 @@ #import "flutter/shell/platform/darwin/common/framework/Headers/FlutterCodecs.h" #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputSemanticsObject.h" #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterViewController_Internal.h" +#import "flutter/shell/platform/darwin/macos/framework/Source/NSView+ClipsToBounds.h" static NSString* const kTextInputChannel = @"flutter/textinput"; diff --git a/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputPluginTest.mm b/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputPluginTest.mm index 165a4b5bb1..1202813a74 100644 --- a/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputPluginTest.mm +++ b/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputPluginTest.mm @@ -9,6 +9,7 @@ #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputPlugin.h" #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputSemanticsObject.h" #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterViewController_Internal.h" +#import "flutter/shell/platform/darwin/macos/framework/Source/NSView+ClipsToBounds.h" #import #import "flutter/testing/testing.h" diff --git a/engine/src/flutter/shell/platform/darwin/macos/framework/Source/NSView+ClipsToBounds.h b/engine/src/flutter/shell/platform/darwin/macos/framework/Source/NSView+ClipsToBounds.h new file mode 100644 index 0000000000..b4669fbde7 --- /dev/null +++ b/engine/src/flutter/shell/platform/darwin/macos/framework/Source/NSView+ClipsToBounds.h @@ -0,0 +1,10 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import + +@interface NSView (ClipsToBounds) +// This property is available since macOS 10.9 but only declared in macOS 14 SDK. +@property BOOL clipsToBounds API_AVAILABLE(macos(10.9)); +@end