Repository: flutter
Issue: [Web] RenderParagraph.getBoxesForSelection broken test
Labels: a: tests,framework,a: typography,platform-web,P3,team-web,triaged-web

[Skip Audit]
These two tests are broken based on incorrect results from `RenderParagraph.getBoxesForSelection`:

Test:
https://github.com/flutter/flutter/blob/8ed8b06ac5a1028e689d87592543880882a516da/packages/flutter/test/rendering/paragraph_test.dart#L56

Result:
```
03:34 +511 ~23 -2: /tmp/flutter sdk/packages/flutter/test/rendering/paragraph_test.dart: getBoxesForSelection control test [E]                                                                         
  Expected: true
    Actual: <false>
  package:dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 214:49      throw_
  package:test_api                                                                          expect$
  package:flutter_test/src/widget_tester.dart 369:3                                         expect$
  paragraph_test.dart 74:5                                                                  <fn>
  package:test_api                                                                          <fn>
  package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50                <fn>
  package:stack_trace                                                                       <fn>
  package:dart-sdk/lib/async/zone.dart 1198:47                                              _rootRunUnary
  package:dart-sdk/lib/async/zone.dart 1100:19                                              runUnary
  package:dart-sdk/lib/async/future_impl.dart 143:18                                        handleValue
  package:dart-sdk/lib/async/future_impl.dart 696:44                                        handleValueCallback
  package:dart-sdk/lib/async/future_impl.dart 725:32                                        _propagateToListeners
  package:dart-sdk/lib/async/future_impl.dart 393:9                                         <fn>
  package:stack_trace                                                                       <fn>
  package:dart-sdk/lib/async/zone.dart 1190:13                                              _rootRun
  package:dart-sdk/lib/async/zone.dart 1093:19                                              run
  package:dart-sdk/lib/async/zone.dart 997:7                                                runGuarded
  package:dart-sdk/lib/async/zone.dart 1037:23                                              callback
  package:dart-sdk/lib/async/schedule_microtask.dart 41:11                                  _microtaskLoop
  package:dart-sdk/lib/async/schedule_microtask.dart 50:5                                   _startMicrotaskLoop
  package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 166:15               <fn>
  ===== asynchronous gap ===========================
  package:dart-sdk/lib/async/zone.dart 1121:19                                              registerUnaryCallback
  package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 67:19                _async
  package:test_api                                                                          <fn>
  package:dart-sdk/lib/async/zone.dart 1190:13                                              _rootRun
  package:dart-sdk/lib/async/zone.dart 1093:19                                              run
  package:dart-sdk/lib/async/zone.dart 1629:67                                              _runZoned
  package:dart-sdk/lib/async/zone.dart 1550:10                                              runZoned
  package:test_api                                                                          <fn>
  package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54                runBody
  package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:12               _async
  package:test_api                                                                          <fn>
  package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54                runBody
  package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:12               _async
  package:test_api                                                                          <fn>
  package:dart-sdk/lib/async/zone.dart 1190:13                                              _rootRun
  package:dart-sdk/lib/async/zone.dart 1093:19                                              run
  package:dart-sdk/lib/async/zone.dart 1629:67                                              _runZoned
  package:dart-sdk/lib/async/zone.dart 1550:10                                              runZoned
  package:test_api                                                                          <fn>
  package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50                <fn>
  package:stack_trace                                                                       <fn>
  package:dart-sdk/lib/async/zone.dart 1198:47                                              _rootRunUnary
  package:dart-sdk/lib/async/zone.dart 1100:19                                              runUnary
  package:dart-sdk/lib/async/future_impl.dart 143:18                                        handleValue
  package:dart-sdk/lib/async/future_impl.dart 696:44                                        handleValueCallback
  package:dart-sdk/lib/async/future_impl.dart 725:32                                        _propagateToListeners
  package:dart-sdk/lib/async/future_impl.dart 519:7                                         [_complete]
  package:dart-sdk/lib/async/future.dart 175:15                                             <fn>
  package:stack_trace                                                                       <fn>
  package:dart-sdk/lib/async/zone.dart 1182:47                                              _rootRun
  package:dart-sdk/lib/async/zone.dart 1093:19                                              run
  package:dart-sdk/lib/async/zone.dart 997:7                                                runGuarded
  package:dart-sdk/lib/async/zone.dart 1037:23                                              <fn>
  package:stack_trace                                                                       <fn>
  package:dart-sdk/lib/async/zone.dart 1190:13                                              _rootRun
  package:dart-sdk/lib/async/zone.dart 1093:19                                              run
  package:dart-sdk/lib/async/zone.dart 1021:23                                              <fn>
  package:dart-sdk/lib/_internal/js_dev_runtime/private/isolate_helper.dart 48:19           internalCallback
  ===== asynchronous gap ===========================
  package:dart-sdk/lib/async/zone.dart 1121:19                                              registerUnaryCallback
  package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 67:19                _async
  package:test_api                                                                          <fn>
  package:dart-sdk/lib/async/zone.dart 1190:13                                              _rootRun
  package:dart-sdk/lib/async/zone.dart 1093:19                                              run
  package:dart-sdk/lib/async/zone.dart 1629:67                                              _runZoned
  package:dart-sdk/lib/async/zone.dart 1550:10                                              runZoned
  package:stack_trace                                                                       <fn>
  package:dart-sdk/lib/async/zone.dart 1190:13                                              _rootRun
  package:dart-sdk/lib/async/zone.dart 1093:19                                              run
  package:dart-sdk/lib/async/zone.dart 1629:67                                              _runZoned
  package:dart-sdk/lib/async/zone.dart 1550:10                                              runZoned
  package:test_api                                                                          <fn>
  package:dart-sdk/lib/async/zone.dart 1190:13                                              _rootRun
  package:dart-sdk/lib/async/zone.dart 1093:19                                              run
  package:dart-sdk/lib/async/zone.dart 1629:67                                              _runZoned
  package:dart-sdk/lib/async/zone.dart 1550:10                                              runZoned
  package:test_api                                                                          <fn>
  package:dart-sdk/lib/async/zone.dart 1198:47                                              _rootRunUnary
  package:dart-sdk/lib/async/zone.dart 1100:19                                              runUnary
  package:dart-sdk/lib/async/zone.dart 1005:7                                               runUnaryGuarded
  package:dart-sdk/lib/async/stream_impl.dart 357:11                                        [_sendData]
  package:dart-sdk/lib/async/stream_impl.dart 285:7                                         [_add]
  package:dart-sdk/lib/async/stream_controller.dart 808:19                                  [_sendData]
  package:dart-sdk/lib/async/stream_controller.dart 682:7                                   [_add]
  package:dart-sdk/lib/async/stream_controller.dart 624:5                                   add
  package:dart-sdk/lib/async/zone.dart 1206:13                                              _rootRunUnary
  package:dart-sdk/lib/async/zone.dart 1100:19                                              runUnary
  package:dart-sdk/lib/async/zone.dart 1005:7                                               runUnaryGuarded
  package:dart-sdk/lib/async/stream_impl.dart 357:11                                        [_sendData]
  package:dart-sdk/lib/async/stream_impl.dart 285:7                                         [_add]
  package:dart-sdk/lib/async/stream_controller.dart 808:19                                  [_sendData]
  package:dart-sdk/lib/async/stream_controller.dart 682:7                                   [_add]
  package:dart-sdk/lib/async/stream_controller.dart 624:5                                   add
  package:dart-sdk/lib/async/stream_controller.dart 900:13                                  add
  package:stream_channel                                                                    <fn>
  package:dart-sdk/lib/async/zone.dart 1384:10                                              runUnaryGuarded
  package:dart-sdk/lib/async/stream_impl.dart 357:11                                        [_sendData]
  package:dart-sdk/lib/async/stream_impl.dart 285:7                                         [_add]
  package:dart-sdk/lib/async/stream_controller.dart 808:19                                  [_sendData]
  package:dart-sdk/lib/async/stream_controller.dart 682:7                                   [_add]
  package:dart-sdk/lib/async/stream_controller.dart 624:5                                   add
  package:dart-sdk/lib/async/zone.dart 1384:10                                              runUnaryGuarded
  package:dart-sdk/lib/async/stream_impl.dart 357:11                                        [_sendData]
  package:dart-sdk/lib/async/stream_impl.dart 285:7                                         [_add]
  package:dart-sdk/lib/async/stream_controller.dart 808:19                                  [_sendData]
  package:dart-sdk/lib/async/stream_controller.dart 682:7                                   [_add]
  package:dart-sdk/lib/async/stream_controller.dart 624:5                                   add
  package:dart-sdk/lib/async/stream_controller.dart 900:13                                  add
  package:dart-sdk/lib/async/zone.dart 1384:10                                              runUnaryGuarded
  package:dart-sdk/lib/async/stream_impl.dart 357:11                                        [_sendData]
  package:dart-sdk/lib/async/stream_impl.dart 285:7                                         [_add]
  package:dart-sdk/lib/async/stream_controller.dart 808:19                                  [_sendData]
  package:dart-sdk/lib/async/stream_controller.dart 682:7                                   [_add]
  package:dart-sdk/lib/async/stream_controller.dart 624:5                                   add
  package:dart-sdk/lib/async/zone.dart 1384:10                                              runUnaryGuarded
  package:dart-sdk/lib/async/stream_impl.dart 357:11                                        [_sendData]
  package:dart-sdk/lib/async/stream_impl.dart 285:7                                         [_add]
  package:dart-sdk/lib/async/stream_controller.dart 808:19                                  [_sendData]
  package:dart-sdk/lib/async/stream_controller.dart 682:7                                   [_add]
  package:dart-sdk/lib/async/stream_controller.dart 624:5                                   add
  package:dart-sdk/lib/async/stream_controller.dart 900:13                                  add
  package:stream_channel                                                                    add
  paragraph_test.dart.browser_test.dart 52:17                                               <fn>
  package:dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 324:14  _checkAndCall
  package:dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 329:39  dcall
  package:dart-sdk/lib/html/dart2js/html_dart2js.dart 37188:58                              <fn>
```

Test: 
https://github.com/flutter/flutter/blob/8ed8b06ac5a1028e689d87592543880882a516da/packages/flutter/test/rendering/paragraph_test.dart#L232

Result:
```
03:35 +512 ~23 -6: /tmp/flutter sdk/packages/flutter/test/rendering/paragraph_test.dart: nested TextSpans in paragraph handle textScaleFactor correctly. [E]                                           
  Expected: <4>
    Actual: <142>
  package:dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 214:49      throw_
  package:test_api                                                                          expect$
  package:flutter_test/src/widget_tester.dart 369:3                                         expect$
  paragraph_test.dart 271:5                                                                 <fn>
  package:test_api                                                                          <fn>
  package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50                <fn>
  package:stack_trace                                                                       <fn>
  package:dart-sdk/lib/async/zone.dart 1198:47                                              _rootRunUnary
  package:dart-sdk/lib/async/zone.dart 1100:19                                              runUnary
  package:dart-sdk/lib/async/future_impl.dart 143:18                                        handleValue
  package:dart-sdk/lib/async/future_impl.dart 696:44                                        handleValueCallback
  package:dart-sdk/lib/async/future_impl.dart 725:32                                        _propagateToListeners
  package:dart-sdk/lib/async/future_impl.dart 393:9                                         <fn>
  package:stack_trace                                                                       <fn>
  package:dart-sdk/lib/async/zone.dart 1190:13                                              _rootRun
  package:dart-sdk/lib/async/zone.dart 1093:19                                              run
  package:dart-sdk/lib/async/zone.dart 997:7                                                runGuarded
  package:dart-sdk/lib/async/zone.dart 1037:23                                              callback
  package:dart-sdk/lib/async/schedule_microtask.dart 41:11                                  _microtaskLoop
  package:dart-sdk/lib/async/schedule_microtask.dart 50:5                                   _startMicrotaskLoop
  package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 166:15               <fn>
  ===== asynchronous gap ===========================
  package:dart-sdk/lib/async/zone.dart 1121:19                                              registerUnaryCallback
  package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 67:19                _async
  package:test_api                                                                          <fn>
  package:dart-sdk/lib/async/zone.dart 1190:13                                              _rootRun
  package:dart-sdk/lib/async/zone.dart 1093:19                                              run
  package:dart-sdk/lib/async/zone.dart 1629:67                                              _runZoned
  package:dart-sdk/lib/async/zone.dart 1550:10                                              runZoned
  package:test_api                                                                          <fn>
  package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54                runBody
  package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:12               _async
  package:test_api                                                                          <fn>
  package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54                runBody
  package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:12               _async
  package:test_api                                                                          <fn>
  package:dart-sdk/lib/async/zone.dart 1190:13                                              _rootRun
  package:dart-sdk/lib/async/zone.dart 1093:19                                              run
  package:dart-sdk/lib/async/zone.dart 1629:67                                              _runZoned
  package:dart-sdk/lib/async/zone.dart 1550:10                                              runZoned
  package:test_api                                                                          <fn>
  package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50                <fn>
  package:stack_trace                                                                       <fn>
  package:dart-sdk/lib/async/zone.dart 1198:47                                              _rootRunUnary
  package:dart-sdk/lib/async/zone.dart 1100:19                                              runUnary
  package:dart-sdk/lib/async/future_impl.dart 143:18                                        handleValue
  package:dart-sdk/lib/async/future_impl.dart 696:44                                        handleValueCallback
  package:dart-sdk/lib/async/future_impl.dart 725:32                                        _propagateToListeners
  package:dart-sdk/lib/async/future_impl.dart 519:7                                         [_complete]
  package:dart-sdk/lib/async/future.dart 175:15                                             <fn>
  package:stack_trace                                                                       <fn>
  package:dart-sdk/lib/async/zone.dart 1182:47                                              _rootRun
  package:dart-sdk/lib/async/zone.dart 1093:19                                              run
  package:dart-sdk/lib/async/zone.dart 997:7                                                runGuarded
  package:dart-sdk/lib/async/zone.dart 1037:23                                              <fn>
  package:stack_trace                                                                       <fn>
  package:dart-sdk/lib/async/zone.dart 1190:13                                              _rootRun
  package:dart-sdk/lib/async/zone.dart 1093:19                                              run
  package:dart-sdk/lib/async/zone.dart 1021:23                                              <fn>
  package:dart-sdk/lib/_internal/js_dev_runtime/private/isolate_helper.dart 48:19           internalCallback
  ===== asynchronous gap ===========================
  package:dart-sdk/lib/async/zone.dart 1121:19                                              registerUnaryCallback
  package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 67:19                _async
  package:test_api                                                                          <fn>
  package:dart-sdk/lib/async/zone.dart 1190:13                                              _rootRun
  package:dart-sdk/lib/async/zone.dart 1093:19                                              run
  package:dart-sdk/lib/async/zone.dart 1629:67                                              _runZoned
  package:dart-sdk/lib/async/zone.dart 1550:10                                              runZoned
  package:stack_trace                                                                       <fn>
  package:dart-sdk/lib/async/zone.dart 1190:13                                              _rootRun
  package:dart-sdk/lib/async/zone.dart 1093:19                                              run
  package:dart-sdk/lib/async/zone.dart 1629:67                                              _runZoned
  package:dart-sdk/lib/async/zone.dart 1550:10                                              runZoned
  package:test_api                                                                          <fn>
  package:dart-sdk/lib/async/zone.dart 1190:13                                              _rootRun
  package:dart-sdk/lib/async/zone.dart 1093:19                                              run
  package:dart-sdk/lib/async/zone.dart 1629:67                                              _runZoned
  package:dart-sdk/lib/async/zone.dart 1550:10                                              runZoned
  package:test_api                                                                          <fn>
  package:dart-sdk/lib/async/zone.dart 1198:47                                              _rootRunUnary
  package:dart-sdk/lib/async/zone.dart 1100:19                                              runUnary
  package:dart-sdk/lib/async/zone.dart 1005:7                                               runUnaryGuarded
  package:dart-sdk/lib/async/stream_impl.dart 357:11                                        [_sendData]
  package:dart-sdk/lib/async/stream_impl.dart 285:7                                         [_add]
  package:dart-sdk/lib/async/stream_controller.dart 808:19                                  [_sendData]
  package:dart-sdk/lib/async/stream_controller.dart 682:7                                   [_add]
  package:dart-sdk/lib/async/stream_controller.dart 624:5                                   add
  package:dart-sdk/lib/async/zone.dart 1206:13                                              _rootRunUnary
  package:dart-sdk/lib/async/zone.dart 1100:19                                              runUnary
  package:dart-sdk/lib/async/zone.dart 1005:7                                               runUnaryGuarded
  package:dart-sdk/lib/async/stream_impl.dart 357:11                                        [_sendData]
  package:dart-sdk/lib/async/stream_impl.dart 285:7                                         [_add]
  package:dart-sdk/lib/async/stream_controller.dart 808:19                                  [_sendData]
  package:dart-sdk/lib/async/stream_controller.dart 682:7                                   [_add]
  package:dart-sdk/lib/async/stream_controller.dart 624:5                                   add
  package:dart-sdk/lib/async/stream_controller.dart 900:13                                  add
  package:stream_channel                                                                    <fn>
  package:dart-sdk/lib/async/zone.dart 1384:10                                              runUnaryGuarded
  package:dart-sdk/lib/async/stream_impl.dart 357:11                                        [_sendData]
  package:dart-sdk/lib/async/stream_impl.dart 285:7                                         [_add]
  package:dart-sdk/lib/async/stream_controller.dart 808:19                                  [_sendData]
  package:dart-sdk/lib/async/stream_controller.dart 682:7                                   [_add]
  package:dart-sdk/lib/async/stream_controller.dart 624:5                                   add
  package:dart-sdk/lib/async/zone.dart 1384:10                                              runUnaryGuarded
  package:dart-sdk/lib/async/stream_impl.dart 357:11                                        [_sendData]
  package:dart-sdk/lib/async/stream_impl.dart 285:7                                         [_add]
  package:dart-sdk/lib/async/stream_controller.dart 808:19                                  [_sendData]
  package:dart-sdk/lib/async/stream_controller.dart 682:7                                   [_add]
  package:dart-sdk/lib/async/stream_controller.dart 624:5                                   add
  package:dart-sdk/lib/async/stream_controller.dart 900:13                                  add
  package:dart-sdk/lib/async/zone.dart 1384:10                                              runUnaryGuarded
  package:dart-sdk/lib/async/stream_impl.dart 357:11                                        [_sendData]
  package:dart-sdk/lib/async/stream_impl.dart 285:7                                         [_add]
  package:dart-sdk/lib/async/stream_controller.dart 808:19                                  [_sendData]
  package:dart-sdk/lib/async/stream_controller.dart 682:7                                   [_add]
  package:dart-sdk/lib/async/stream_controller.dart 624:5                                   add
  package:dart-sdk/lib/async/zone.dart 1384:10                                              runUnaryGuarded
  package:dart-sdk/lib/async/stream_impl.dart 357:11                                        [_sendData]
  package:dart-sdk/lib/async/stream_impl.dart 285:7                                         [_add]
  package:dart-sdk/lib/async/stream_controller.dart 808:19                                  [_sendData]
  package:dart-sdk/lib/async/stream_controller.dart 682:7                                   [_add]
  package:dart-sdk/lib/async/stream_controller.dart 624:5                                   add
  package:dart-sdk/lib/async/stream_controller.dart 900:13                                  add
  package:stream_channel                                                                    add
  paragraph_test.dart.browser_test.dart 52:17                                               <fn>
  package:dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 324:14  _checkAndCall
  package:dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 329:39  dcall
  package:dart-sdk/lib/html/dart2js/html_dart2js.dart 37188:58                              <fn>
```

flutter doctor
```
[✓] Flutter (Channel master, 1.19.0-4.0.pre.42, on Mac OS X 10.15.4 19E287, locale en-US)
    • Flutter version 1.19.0-4.0.pre.42 at /Users/katelovett/github/flutter
    • Framework revision bc8d0f5706 (21 hours ago), 2020-07-06 15:57:59 -0700
    • Engine revision f8bbcc396b
    • Dart version 2.9.0 (build 2.9.0-20.0.dev c190fc3a31)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/katelovett/Library/Android/sdk
    • Platform android-28, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.3.1, Build version 11C505
    • CocoaPods version 1.9.1

[✓] Android Studio (version 3.4)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 36.1.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[✓] VS Code (version 1.45.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.12.1

[✓] Connected device (1 available)
    • iPhone 11 Pro Max (mobile) • A8FFA716-A67B-4468-B92B-F2B61F2306A0 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-3
      (simulator)

• No issues found!
```