-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
flutter/engine
#19948Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listc: crashStack traces logged to the consoleStack traces logged to the consoleengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.found in release: 1.21Found to occur in 1.21Found to occur in 1.21has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyWeb applications specificallywaiting for PR to land (fixed)A fix is in flightA fix is in flight
Milestone
Description
Steps to reproduce
Run the following app in Chrome:
import 'dart:ui' show window;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
runApp(
Localizations(
locale: Locale('en', 'US'),
delegates: [
DefaultWidgetsLocalizations.delegate,
DefaultMaterialLocalizations.delegate,
],
child: MediaQuery(
data: MediaQueryData.fromWindow(window),
child: Material(
child: BugReport(
child: TextField(),
),
),
),
),
);
}
class BugReport extends SingleChildRenderObjectWidget {
const BugReport({
Key key,
@required Widget child,
}) : super(key: key, child: child);
@override
RenderObject createRenderObject(BuildContext context) => RenderBugReport();
}
class RenderBugReport extends RenderBox with RenderObjectWithChildMixin<RenderBox> {
@override
void performLayout() {
size = constraints.biggest;
child.layout(constraints);
}
@override
void paint(PaintingContext context, Offset offset) {
context.pushClipRect(needsCompositing, offset, Offset.zero & size, (PaintingContext context, Offset offset) {
Rect clipRect = Rect.fromLTWH(0, 0, size.width, size.height).shift(offset);
context.clipRectAndPaint(clipRect, Clip.hardEdge, clipRect, () {
context.paintChild(child, offset);
});
});
}
}Expected behavior
You expect to see the text field rendered (which is what happens on non-web platforms)
Actual behavior
The following exception is thrown:
The following IndexError was thrown during paint():
RangeError (index): Index out of range: index must not be negative: -1
The relevant error-causing widget was:
BugReport file:///Users/tvolkert/project/sci/apps/payouts/lib/main.dart:21:18
When the exception was thrown, this was the stack:
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 213:49 throw_
dart-sdk/lib/_internal/js_dev_runtime/private/js_array.dart 117:56 removeLast]
lib/_engine/engine/surface/recording_canvas.dart 2110:34 restoreTransformsAndClip
lib/_engine/engine/surface/recording_canvas.dart 228:18 restore
lib/_engine/engine/surface/canvas.dart 47:13 restore
packages/flutter/src/painting/clip.dart 35:12 [_clipAndPaint]
packages/flutter/src/painting/clip.dart 59:5 clipRectAndPaint
packages/payouts/main.dart 51:14 <fn>
packages/flutter/src/rendering/object.dart 398:12 pushLayer
packages/flutter/src/rendering/object.dart 454:7 pushClipRect
packages/payouts/main.dart 49:12 paint
packages/flutter/src/rendering/object.dart 2308:7 [_paintWithContext]
packages/flutter/src/rendering/object.dart 191:12 paintChild
packages/flutter/src/rendering/proxy_box.dart 133:14 paint
packages/flutter/src/material/material.dart 555:11 paint
packages/flutter/src/rendering/object.dart 2308:7 [_paintWithContext]
packages/flutter/src/rendering/object.dart 191:12 paintChild
packages/flutter/src/rendering/proxy_box.dart 133:14 paint
packages/flutter/src/rendering/object.dart 398:12 pushLayer
packages/flutter/src/rendering/proxy_box.dart 1856:14 paint
packages/flutter/src/rendering/object.dart 2308:7 [_paintWithContext]
packages/flutter/src/rendering/object.dart 191:12 paintChild
packages/flutter/src/rendering/proxy_box.dart 133:14 paint
packages/flutter/src/rendering/object.dart 2308:7 [_paintWithContext]
packages/flutter/src/rendering/object.dart 191:12 paintChild
packages/flutter/src/rendering/view.dart 226:14 paint
packages/flutter/src/rendering/object.dart 2308:7 [_paintWithContext]
packages/flutter/src/rendering/object.dart 142:10 _repaintCompositedChild
packages/flutter/src/rendering/object.dart 102:5 repaintCompositedChild
packages/flutter/src/rendering/object.dart 989:29 flushPaint
packages/flutter/src/rendering/binding.dart 406:19 drawFrame
packages/flutter/src/widgets/binding.dart 881:13 drawFrame
packages/flutter/src/rendering/binding.dart 286:5 [_handlePersistentFrameCallback]
packages/flutter/src/scheduler/binding.dart 1117:15 [_invokeFrameCallback]
packages/flutter/src/scheduler/binding.dart 1056:9 handleDrawFrame
packages/flutter/src/scheduler/binding.dart 865:7 <fn>
dart-sdk/lib/_internal/js_dev_runtime/private/isolate_helper.dart 48:19 internalCallback
The following RenderObject was being processed when the exception was fired: RenderBugReport#24222:
needs compositing
creator: BugReport ← DefaultTextStyle ← AnimatedDefaultTextStyle ← _InkFeatures-[GlobalKey#f5e1b ink
renderer] ← NotificationListener<LayoutChangedNotification> ← PhysicalModel ←
AnimatedPhysicalModel ← Material ← MediaQuery ← Directionality ←
_LocalizationsScope-[GlobalKey#f8a9f] ← Semantics ← ⋯
parentData: <none> (can use size)
constraints: BoxConstraints(w=1200.0, h=1294.0)
size: Size(1200.0, 1294.0)
This RenderObject had the following descendants (showing up to depth 5):
child: RenderMouseRegion#0ab03
child: RenderIgnorePointer#44bef
child: RenderSemanticsAnnotations#8fbf0
child: RenderPointerListener#5eb02
child: _RenderDecoration#e514c
════════════════════════════════════════════════════════════════════════════════════════════════════
Additional info
$ flutter doctor -v
[✓] Flutter (Channel master, 1.21.0-2.0.pre.51, on Mac OS X 10.15.3 19D76, locale en-US)
• Flutter version 1.21.0-2.0.pre.51 at /Users/tvolkert/project/flutter/flutter
• Framework revision df542b6831 (4 hours ago), 2020-07-16 18:32:46 -0700
• Engine revision d3b81f19fc
• Dart version 2.9.0 (build 2.9.0-21.0.dev 06183779d7)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/tvolkert/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_212-release-1586-b4-5784211)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.4.1)
• Xcode at /Applications/Xcode_11.4.1.app/Contents/Developer
• Xcode 11.4.1, Build version 11E503a
• CocoaPods version 1.9.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 3.6)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 47.1.1
• Dart plugin version 192.8052
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
[✓] Connected device (3 available)
• macOS (desktop) • macos • darwin-x64 • Mac OS X 10.15.3 19D76
• Web Server (web) • web-server • web-javascript • Flutter Tools
• Chrome (web) • chrome • web-javascript • Google Chrome 83.0.4103.116
• No issues found!
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listc: crashStack traces logged to the consoleStack traces logged to the consoleengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.found in release: 1.21Found to occur in 1.21Found to occur in 1.21has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyWeb applications specificallywaiting for PR to land (fixed)A fix is in flightA fix is in flight