Repository: flutter
Issue: [Web][HTML] Issue on web html rendering RTL
Labels: engine,platform-web,e: web_html,has reproducible steps,P2,team-web,triaged-web,found in release: 3.16,found in release: 3.18

### Steps to reproduce

1. Run project with --web-renderer HTML. 
2. This issue occurs specifically when using textDirection: rtl and textAlign: TextAlign.justify.
3. However, no problem is observed when either setting textDirection to ltr or removing textAlign: TextAlign.justify.

### Expected results

The expected behavior is for the text to remain within its designated container without any displacement or disappearance when using textDirection: rtl and textAlign: TextAlign.justify.

![image](https://github.com/flutter/flutter/assets/33370114/410e382d-bbce-4aac-a48e-95b7ddc4bb86)


### Actual results

![image](https://github.com/flutter/flutter/assets/33370114/c443afe8-db68-4a3e-bdf4-5c9b73945675)


### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.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(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> {
  @override
  Widget build(BuildContext context) {
    String text = 'Cannot hit test dasdasdad asdasdasd asd asdas asd asd as';

    return Center(
      child: Column(children: [
        Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            Center(
              child: Container(
                color: Colors.amberAccent,
                child: Text(text,
                    style: const TextStyle(color: Colors.red),
                    textDirection: TextDirection.rtl,
                    textAlign: TextAlign.justify),
              ),
            ),
          ],
        )
      ]),
    );
  }
}

```

</details>



### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[√] Flutter (Channel stable, 3.16.5, on Microsoft Windows [Version 10.0.22621.2861], locale en-US)
    • Flutter version 3.16.5 on channel stable at C:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 78666c8dc5 (8 days ago), 2023-12-19 16:14:14 -0800
    • Engine revision 3f3e560236
    • Dart version 3.2.3
    • DevTools version 2.28.4

[√] Windows Version (Installed version of Windows is version 10 or higher)

[!] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at C:\Users\k3sh\AppData\Local\Android\sdk
    X cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

[√] Chrome - develop for the web
    • CHROME_EXECUTABLE = C:\Program Files\Google\Chrome\Application\chrome.exe

[X] Visual Studio - develop Windows apps
    X Visual Studio not installed; this is necessary to develop Windows apps.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 2022.1)
    • 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 11.0.15+0-b2043.56-9505619)

[√] IntelliJ IDEA Ultimate Edition (version 2023.1)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2023.1
    • Flutter plugin version 74.0.4
    • Dart plugin version 231.9065

[√] VS Code (version 1.82.2)
    • VS Code at C:\Users\k3sh\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.72.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22621.2861]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 120.0.6099.130
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 120.0.2210.91

[√] Network resources
    • All expected network resources are available.


```

</details>