Fixed visibility of embedded views in safari (google map, video, camera preview etc) (flutter/engine#35948)

This commit is contained in:
Oleg
2022-09-29 17:41:15 +01:00
committed by GitHub
parent ed86837855
commit 6d76d00c33
2 changed files with 21 additions and 0 deletions

View File

@@ -322,6 +322,11 @@ class HtmlViewEmbedder {
clipView.style.clipPath = '';
headTransform = Matrix4.identity();
clipView.style.transform = '';
// We need to set width and height for the clipView to cover the
// bounds of the path since Safari seem to incorrectly intersect
// the element bounding rect with the clip path.
clipView.style.width = '100%';
clipView.style.height = '100%';
if (mutator.rect != null) {
final ui.Rect rect = mutator.rect!;
clipView.style.clip = 'rect(${rect.top}px, ${rect.right}px, '

View File

@@ -95,6 +95,22 @@ void testMain() {
.clipPath,
'url("#svgClip1")',
);
expect(
flutterViewEmbedder.sceneElement!
.querySelectorAll('flt-clip')
.single
.style
.width,
'100%',
);
expect(
flutterViewEmbedder.sceneElement!
.querySelectorAll('flt-clip')
.single
.style
.height,
'100%',
);
});
test('correctly transforms platform views', () async {