Fixed visibility of embedded views in safari (google map, video, camera preview etc) (flutter/engine#35948)
This commit is contained in:
@@ -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, '
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user