Repository: flutter
Issue: [web] [canvaskit]Resizing browser window causes black dotted render issue
Labels: engine,platform-windows,platform-web,c: rendering,e: web_canvaskit,has reproducible steps,P2,found in release: 2.0,team-web,triaged-web

## Steps to Reproduce

### Important Factors

- Only been reproducible on a Windows 10 machine, running Chrome/Edge/Firefox/Opera
- Widget tree must contain an `HtmlElementView` to reproduce the issue
- If the `HtmlElementView` widget is removed from the tree based on stateful logic, issue is gone


To reproduce the issue, run the following application:

<details>
  <summary>Application Code</summary>

`main.dart`

```
import 'package:flutter/material.dart';
import 'dart:html';
import 'dart:ui' as ui;

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key}) : super(key: key);
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  void initState() {
    super.initState();
    // register html element
    ui.platformViewRegistry.registerViewFactory(
      'demo-html-viewTypeId',
      (int viewId) => IFrameElement()
        ..srcdoc = '<html><body><p>An embedded webview.</p></body></html>'
        ..style.border = 'none',
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('Black Dot Recreation Demo')),
      body: Center(child: HtmlElementView(viewType: 'demo-html-viewTypeId')),
    );
  }
}
```

`analysis_options.yaml`

```
##
# Silence the following warning:
#   The name 'platformViewRegistry' is being referenced through the prefix 'ui',
#   but it isn't defined in any of the libraries imported using that prefix.
#
#   https://github.com/flutter/flutter/issues/41563
## 
analyzer:
    errors:
      undefined_prefixed_name: ignore
```
</details>

<details>
  <summary>Flutter Doctor Output</summary>

```
[√] Flutter (Channel stable, 2.0.1, on Microsoft Windows [Version 10.0.19042.804], locale en-US)
    • Flutter version 2.0.1 at C:\development\flutter
    • Framework revision c5a4b4029c (6 days ago), 2021-03-04 09:47:48 -0800
    • Engine revision 40441def69
    • Dart version 2.12.0
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at C:\development\android-sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_SDK_ROOT = C:\development\android-sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.
[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[√] Android Studio (version 4.1.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[√] VS Code (version 1.54.1)
    • VS Code at C:\Users\<username>\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.20.0
[√] Connected device (2 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 88.0.4324.190
    • Edge (web)   • edge   • web-javascript • Microsoft Edge 89.0.774.45
• No issues found!
```
</details>


### Expected Results

Resizing the browser window does not alter the appearance of the background color.

### Actual Results
Resizing the browser window causes a black dotted pattern to appear

![before-state](https://user-images.githubusercontent.com/1205855/110682280-5c67f780-81a0-11eb-9223-941d4e835b85.png)

![issue](https://user-images.githubusercontent.com/1205855/110682293-60941500-81a0-11eb-94a8-567ddbf34ac0.png)

https://user-images.githubusercontent.com/1205855/110683584-cdf47580-81a1-11eb-9223-3e02dcaf2038.mp4