Repository: flutter
Issue: BackdropFilter disrupted by non-overlapping empty platform view in Flutter Web
Labels: c: new feature,engine,platform-web,e: web_canvaskit,has reproducible steps,P3,found in release: 2.5,found in release: 2.6,team-web,triaged-web

## Steps to Reproduce

Run the following code:


```
import 'dart:ui';
import 'dart:html';
import 'package:flutter/material.dart';

void main() {
  platformViewRegistry.registerViewFactory(
      'hello-html',
      (int viewId) => IFrameElement()
        ..width = '640'
        ..height = '360'
        ..style.border = 'none');

  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key}) : super(key: key);

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.blue,
      child: Row(
        mainAxisAlignment: MainAxisAlignment.end,
        children: [
          const Expanded(
              child: HtmlElementView(
            viewType: 'hello-html',
          )),
          Container(
            width: 200,
            height: double.infinity,
            color: Colors.white60,
            child: ClipRect(
              child: BackdropFilter(
                  filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
                  child: const SizedBox(width: 100, height: 100)),
            ),
          ),
        ],
      ),
    );
  }
}

```


**Expected results:** <!-- what did you want to see? -->

![without_platform_view](https://user-images.githubusercontent.com/53207771/132922382-2f73ee22-0fc2-4297-a531-3e39d4242843.png)


**Actual results:** <!-- what did you see? -->

![with_platform_view](https://user-images.githubusercontent.com/53207771/132922393-cd9a74b4-7493-4634-884f-723535f9102d.png)

Notice that the panel on the right is much lighter than it should be.  You can confirm this by simply commenting out the following lines in the sample code above:

```
          // const Expanded(
          //     child: HtmlElementView(
          //   viewType: 'hello-html',
          // )),

```

<details>
  <summary>Logs</summary>

<!--
      Run your application with `flutter run --verbose` and attach all the
      log output below between the lines with the backticks. If there is an
      exception, please see if the error message includes enough information
      to explain how to solve the issue.
-->

```
rick@rex:~/development/test$ flutter run --verbose
[  +54 ms] executing: uname -m
[  +30 ms] Exit code 0 from: uname -m
[        ] x86_64
[   +4 ms] executing: [/home/rick/snap/flutter/common/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[   +6 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[        ] a7fb06d6faa2f0ad0da124c79a4eb26ae091baa5
[        ] executing: [/home/rick/snap/flutter/common/flutter/] git tag --points-at a7fb06d6faa2f0ad0da124c79a4eb26ae091baa5
[  +18 ms] Exit code 0 from: git tag --points-at a7fb06d6faa2f0ad0da124c79a4eb26ae091baa5
[        ] 2.5.0-5.3.pre
[   +9 ms] executing: [/home/rick/snap/flutter/common/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[   +6 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/beta
[        ] executing: [/home/rick/snap/flutter/common/flutter/] git ls-remote --get-url origin
[   +3 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[  +73 ms] executing: [/home/rick/snap/flutter/common/flutter/] git rev-parse --abbrev-ref HEAD
[   +6 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] beta
[  +47 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +2 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +45 ms] executing: /home/rick/Android/Sdk/platform-tools/adb devices -l
[  +43 ms] List of devices attached
[   +5 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +61 ms] Multiple devices found:
[  +37 ms] Linux (desktop) • linux  • linux-x64      • Ubuntu 21.04 5.11.0-31-generic
[        ] Chrome (web)    • chrome • web-javascript • Google Chrome 93.0.4577.63
[   +1 ms] [1]: Linux (linux)
[        ] [2]: Chrome (chrome)
[   +1 ms] Please choose one (To quit, press "q/Q")
[        ] : 
[+7929 ms] 2
[  +15 ms] Skipping pub get: version match.
[  +99 ms] Generating
/home/rick/development/test/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
[  +72 ms] Launching lib/main.dart on Chrome in debug mode...

[  +92 ms] Updating assets
[  +64 ms] Waiting for connection from debug service on Chrome...
[  +54 ms] <- reset
[   +6 ms] /home/rick/snap/flutter/common/flutter/bin/cache/dart-sdk/bin/dart --disable-dart-dev
/home/rick/snap/flutter/common/flutter/bin/cache/artifacts/engine/linux-x64/frontend_server.dart.snapshot --sdk-root
/home/rick/snap/flutter/common/flutter/bin/cache/flutter_web_sdk/ --incremental --target=dartdevc --debugger-module-names
--experimental-emit-debug-metadata -DFLUTTER_WEB_AUTO_DETECT=true --output-dill
/tmp/flutter_tools.ITEDCZ/flutter_tool.VCVJOF/app.dill --libraries-spec
file:///home/rick/snap/flutter/common/flutter/bin/cache/flutter_web_sdk/libraries.json --packages
/home/rick/development/test/.dart_tool/package_config.json -Ddart.vm.profile=false -Ddart.vm.product=false --enable-asserts
--track-widget-creation --filesystem-root /tmp/flutter_tools.ITEDCZ/flutter_tools.UZBYAU --filesystem-scheme
org-dartlang-app --initialize-from-dill build/b1b715402d823b7fd5c2b68d2edcb2ce.cache.dill.track.dill --platform
file:///home/rick/snap/flutter/common/flutter/bin/cache/flutter_web_sdk/kernel/flutter_ddc_sdk_sound.dill
--sound-null-safety
[  +11 ms] <- compile org-dartlang-app:/web_entrypoint.dart
[+14455 ms] Waiting for connection from debug service on Chrome... (completed in 14.5s)
[        ] Synced 26.2MB.
[        ] <- accept
[        ] Caching compiled dill
[  +68 ms] Using Google Chrome 93.0.4577.63 

[  +31 ms] executing: uname -m
[   +6 ms] Exit code 0 from: uname -m
[        ] x86_64
[ +171 ms] [CHROME]:
[        ] [CHROME]:DevTools listening on ws://127.0.0.1:37093/devtools/browser/bd50a895-d9be-4c34-88b7-e94f16eb2260
[ +232 ms] DwdsInjector: Received request for entrypoint at http://localhost:40679/main_module.bootstrap.js
[   +7 ms] MetadataProvider: Loading debug metadata...
[  +17 ms] MetadataProvider: Loaded debug metadata (sound null safety)
[   +8 ms] DwdsInjector: Injected debugging metadata for entrypoint at http://localhost:40679/main_module.bootstrap.js
[+1463 ms] ChromeProxyService: Initializing expression compiler for main_module.bootstrap.js with sound null safety: true
[  +88 ms] DevHandler: Debug service listening on ws://127.0.0.1:34111/V7MOneMBIwc=/ws

[  +25 ms] This app is linked to the debug service: ws://127.0.0.1:34111/V7MOneMBIwc=/ws
[  +10 ms] Debug service listening on ws://127.0.0.1:34111/V7MOneMBIwc=/ws
[        ] 💪 Running with sound null safety 💪
[   +3 ms] 🔥  To hot restart changes while running, press "r" or "R".
[        ] For a more detailed help message, press "h". To quit, press "q".
[        ] An Observatory debugger and profiler on Chrome is available at: http://127.0.0.1:34111/V7MOneMBIwc=
[ +435 ms] Activating Dart DevTools...
[ +453 ms] Height of Platform View type: [hello-html] may not be set. Defaulting to `height: 100%`.
                    Set `style.height` to any appropriate value to stop this message.
[        ] Width of Platform View type: [hello-html] may not be set. Defaulting to `width: 100%`.
           Set `style.width` to any appropriate value to stop this message.
[+2730 ms] Activating Dart DevTools... (completed in 3.2s)
[ +428 ms] The Flutter DevTools debugger and profiler on Chrome is available at:
                    http://127.0.0.1:9102?uri=http://127.0.0.1:34111/V7MOneMBIwc=

```

<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->

```
Analyzing test...                                                       

   info • Avoid using web-only libraries outside Flutter web plugin packages • lib/main.dart:2:1 •
          avoid_web_libraries_in_flutter
  error • Undefined name 'platformViewRegistry' • lib/main.dart:6:3 • undefined_identifier

2 issues found. (ran in 1.0s)
```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, 2.5.0-5.3.pre, on Ubuntu 21.04 5.11.0-31-generic, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 4.2)
[✓] Android Studio
[✓] VS Code
[✓] Connected device (2 available)

• No issues found!
```

</details>