Repository: flutter
Issue: Safari on MacOS Sonoma shows white lines in scrollable items and text fields become with a white color when included web ensureSemantics 
Labels: a: accessibility,platform-web,c: rendering,has reproducible steps,browser: safari-macos,P2,team-web,triaged-web,found in release: 3.16,found in release: 3.17

### 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. Update MacOS Sonama (14.0.0 - 14.1.1(latest now) )
2. Go to System Settings -> Appearance
3. Change "Show scroll bars" -> Always (Note: only for scrollbars case)
4. Enable semantics for web -> add RendererBinding.instance.ensureSemantics();
5. Run the application

### Expected results

1. TextFields shown correctly 

### Actual results

1. White lines(Scrollbars) appear 
2. TextFields become with a white foreground

### Code sample

<details><summary>Code sample</summary>

```dart
import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';

void main() {
  runApp(const MyApp());
  runZonedGuarded(() {

    RendererBinding.instance.ensureSemantics();

    return const MyApp();
  }, (error, stack) {});
}

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: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final textEditingController = TextEditingController();

  @override
  void dispose() {
    textEditingController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.black12,
      body: Column(
        mainAxisSize: MainAxisSize.min,
        children: <Widget>[
          Container(
            margin: const EdgeInsets.all(10),
            child: TextField(
              controller: textEditingController,
            ),
          ),
          const Text(
            'Headline',
            style: TextStyle(fontSize: 18),
          ),
          Expanded(
            child: ListView.builder(
              shrinkWrap: true,
              scrollDirection: Axis.horizontal,
              itemCount: 15,
              itemBuilder: (BuildContext context, index) => const Card(
                child: Center(
                  child: Text('Dummy Card Text'),
                ),
              ),
            ),
          ),
          const Text(
            'Demo Headline 2',
            style: TextStyle(fontSize: 18),
          ),
          Expanded(
            child: ListView.builder(
              shrinkWrap: true,
              itemBuilder: (ctx, index) {
                return Card(
                  child: ListTile(
                    title: Text('Motivation $index'),
                    subtitle:
                        const Text('this is a description of the motivation'),
                  ),
                );
              },
            ),
          ),
        ],
      ),
    );
  }
}

```

</details>


### Screenshots or Video

<details>
<summary>Screenshots / Video demonstration</summary>


https://github.com/flutter/flutter/assets/151140159/d2ca6f1c-d57f-4cdd-bd08-7002fccb139e






</details>


### Logs

<details><summary>Logs</summary>

```console
empty
```

</details>


### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.13.8, on macOS 14.1.1 23B81 darwin-arm64, locale en-AM)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0-rc2)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.1)
[✓] VS Code (version 1.84.2)
[✓] Connected device (3 available)
[✓] Network resources

• No issues found!```

</details>