Repository: flutter
Issue: Application fully stucked when use ShaderMask on Web iPhone
Labels: platform-ios,framework,engine,platform-web,c: rendering,e: web_html,has reproducible steps,P2,browser: safari-ios,found in release: 3.10,found in release: 3.12,team-engine,triaged-engine

### Is there an existing issue for this?

- [X] I have searched the [existing issues](https://github.com/flutter/flutter/issues)
- [X] I have read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports)

### Steps to reproduce

1. Add ShaderMask widget to your app (or copy-paste code example)
2. Deploy app to Web
3. Run it in Safari iPhone (in my case iPhone 11 Pro Max iOS 16.5)


NOTE: I deployed this site to my temporary hosting https://knowledge-party.ru. You can check it out just running this site on iPhone.

### Expected results

Application is not fully stucked

### Actual results

Application not responding

### Code sample

<details><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: Scaffold(
        backgroundColor: Colors.black,
        body: const ShaderMaskTest(),
        floatingActionButton: Builder(
          builder: (context) {
            return FloatingActionButton(
              onPressed: () {
                showDialog(
                  context: context,
                  builder: (_) => const Scaffold(
                    body: Center(child: Text('Dialog!')),
                  ),
                );
              },
              child: const Text('+'),
            );
          }
        ),
      ),
    );
  }
}

class ShaderMaskTest extends StatelessWidget {
  const ShaderMaskTest({super.key});

  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        ShaderMask(
          shaderCallback: (rect) {
            const gradientColor = Colors.black;

            return LinearGradient(
              begin: Alignment.topCenter,
              end: Alignment.bottomCenter,
              colors: [
                gradientColor,
                gradientColor.withOpacity(0),
              ],
              stops: const [0.51, 1.0],
            ).createShader(
              Rect.fromLTRB(
                0,
                0,
                rect.width,
                rect.height,
              ),
            );
          },
          blendMode: BlendMode.dstIn,
          child: Image.asset(
            'assets/2.png',
            fit: BoxFit.cover,
          ),
        ),
      ],
    );
  }
}
```

</details>


### Screenshots or Video

<details>
<summary>Screenshots / Video demonstration</summary>

Android behavior: [Samsung Galaxy S20 ](https://knowledge-party.ru/20230606_213610.mp4)
iPhone behavior: [iPhone 11 Pro Max iOS 16.5](https://knowledge-party.ru/IMG_0033.MOV)

</details>


### Logs

<details><summary>Logs</summary>

```console
Sorry no logs :(
```

</details>


### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.10.3, on Microsoft Windows [Version 10.0.19045.2965], locale ru-RU)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.6.2)
[√] Android Studio (version 2022.2)
[√] VS Code (version 1.78.2)
[√] Connected device (3 available)
[√] Network resources

• No issues found!
```

</details>