dart-pad icon indicating copy to clipboard operation
dart-pad copied to clipboard

DartPad makes wrong output when the "Minimum font size" setting used in browser

Open asavchuk opened this issue 4 years ago • 6 comments

Browser: Chrome (latest) Operating system: Windows 10

DartPad in Chrome renders it like

Hello,

import 'package:flutter/material.dart';

void main() => runApp(MaterialApp(home: Scaffold(body: Center(child: MyWidget()))));

class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) => Text('Hello, World!');
}

and for Text('Hello,World!'); it renders

Hello,Worl

Actually it fails until I set fontWeight property for the Text widget. The same works fine in Firefox.

asavchuk avatar Sep 27 '20 08:09 asavchuk

That's really strange. I've never seen that exact behavior before. I jus tried replicating the issue on a Windows desktop, and saw the desired results:

image

Can you provide some additional information?

  • Are there any errors or network failures in the browser logs when you see this take place?
  • Are you using any browser extensions that may be affecting the experience?
  • If you build the same code as a project (using flutter run -d chrome), do you also see this problem?

RedBrogdon avatar Oct 06 '20 16:10 RedBrogdon

There are some errors in browser console:

DevTools failed to load SourceMap: Could not load content for https://storage.googleapis.com/compilation_artifacts/2.10.0/flutter_web.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load SourceMap: Could not load content for https://dartpad.dev/scripts/playground.dart.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load SourceMap: Could not load content for https://dartpad.dev/split.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load SourceMap: Could not load content for https://dartpad.dev/main.dart.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load SourceMap: Could not load content for https://storage.googleapis.com/compilation_artifacts/2.10.0/dart_sdk.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load SourceMap: Could not load content for https://dartpad.dev/main.dart.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
dart_sdk.js:5964 Uncaught Error: Assertion failed: file:///Users/brettmorgan/Documents/GitHub/dart-services/flutter/packages/flutter/lib/src/rendering/mouse_tracking.dart:333:12
(event is PointerAddedEvent) == (lastEvent is PointerRemovedEvent)
is not true
    at Object.throw_ [as throw] (dart_sdk.js:4328)
    at Object.assertFailed (dart_sdk.js:4275)
    at Function._shouldMarkStateDirty (flutter_web.js:410592)
    at mouse_tracking.MouseTracker.new.updateWithEvent (flutter_web.js:410631)
    at binding$.WidgetsFlutterBinding.new.dispatchEvent (flutter_web.js:308488)
    at binding$.WidgetsFlutterBinding.new.[_handlePointerEvent] (flutter_web.js:307238)
    at binding$.WidgetsFlutterBinding.new.[_flushPointerEventQueue] (flutter_web.js:307210)
    at binding$.WidgetsFlutterBinding.new.[_handlePointerDataPacket] (flutter_web.js:307194)
    at Object._invoke1 (dart_sdk.js:175453)
    at _engine.EngineWindow.new.invokeOnPointerDataPacket (dart_sdk.js:171307)
    at _engine.PointerBinding.__.[_onPointerData] (dart_sdk.js:158211)
    at dart_sdk.js:158585
    at dart_sdk.js:158557
    at dart_sdk.js:158310
DartError @ dart_sdk.js:5964
throw_ @ dart_sdk.js:4328
assertFailed @ dart_sdk.js:4275
_shouldMarkStateDirty @ flutter_web.js:410592
updateWithEvent @ flutter_web.js:410631
dispatchEvent @ flutter_web.js:308488
[_handlePointerEvent] @ flutter_web.js:307238
[_flushPointerEventQueue] @ flutter_web.js:307210
[_handlePointerDataPacket] @ flutter_web.js:307194
_invoke1 @ dart_sdk.js:175453
invokeOnPointerDataPacket @ dart_sdk.js:171307
[_onPointerData] @ dart_sdk.js:158211
(anonymous) @ dart_sdk.js:158585
(anonymous) @ dart_sdk.js:158557
(anonymous) @ dart_sdk.js:158310

asavchuk avatar Oct 06 '20 17:10 asavchuk

I've tested it with all the browser extensions switched off — the same result, i.e. the output is wrong.

asavchuk avatar Oct 06 '20 17:10 asavchuk

Not sure how to run it using flutter run -d chrome. When I run it from the project directory I get No devices found with name or id matching 'chrome'

asavchuk avatar Oct 06 '20 17:10 asavchuk

It seems the reason for that behaviour is the browser setting for the minimum font size. For instance, when I used the minimum font size: 15 in Firefox the output was also wrong.

screen screen2

asavchuk avatar Oct 06 '20 18:10 asavchuk

Is the minimum font size setting forcing the wrong output on only DartPad, or is it replicatable when running flutter run -d chrome locally? If it's the later (and I'm guessing it is) then this bug really belongs on https://github.com/flutter/flutter/issues

domesticmouse avatar Oct 13 '20 21:10 domesticmouse

Thanks for the report and various details.

I believe this is a duplicate of https://github.com/dart-lang/dart-pad/issues/1741 which appears resolved.

This could still be occurring but since Flutter and the DartPad frontend have evolved a lot since this issue was created, I'm going to close this as stale. If anyone is still seeing this or similar behavior, please open a new issue with reproduction instructions. Thanks again :)

parlough avatar Jun 17 '24 20:06 parlough