Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 4f2708b

Browse files
committed
Fix pointer_binding_test in Firefox.
1 parent bd133fa commit 4f2708b

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

lib/web_ui/lib/src/engine/pointer_binding.dart

+4
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,7 @@ class _PointerAdapter extends _BaseAdapter with _WheelEventListenerMixin {
690690
}
691691
}, useCapture: false, checkModifiers: false);
692692

693+
// TODO(dit): This must happen in the glassPane, https://github.com/flutter/flutter/issues/116561
693694
_addPointerEventListener(domWindow, 'pointerup', (DomPointerEvent event) {
694695
final int device = _getPointerId(event);
695696
if (_hasSanitizer(device)) {
@@ -703,6 +704,8 @@ class _PointerAdapter extends _BaseAdapter with _WheelEventListenerMixin {
703704
}
704705
});
705706

707+
// TODO(dit): Synthesize a "cancel" event when 'pointerup' happens outside of the glassPane, https://github.com/flutter/flutter/issues/116561
708+
706709
// A browser fires cancel event if it concludes the pointer will no longer
707710
// be able to generate events (example: device is deactivated)
708711
_addPointerEventListener(glassPaneElement, 'pointercancel', (DomPointerEvent event) {
@@ -1039,6 +1042,7 @@ class _MouseAdapter extends _BaseAdapter with _WheelEventListenerMixin {
10391042
}
10401043
}, useCapture: false);
10411044

1045+
// TODO(dit): This must happen in the glassPane, https://github.com/flutter/flutter/issues/116561
10421046
_addMouseEventListener(domWindow, 'mouseup', (DomMouseEvent event) {
10431047
final List<ui.PointerData> pointerData = <ui.PointerData>[];
10441048
final _SanitizedDetails? sanitizedDetails = _sanitizer.sanitizeUpEvent(buttons: event.buttons?.toInt());

lib/web_ui/test/engine/pointer_binding_test.dart

+7-3
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@ typedef _ContextTestBody<T> = void Function(T);
2323
void _testEach<T extends _BasicEventContext>(
2424
Iterable<T> contexts,
2525
String description,
26-
_ContextTestBody<T> body,
26+
_ContextTestBody<T> body, {
27+
Object? skip,
28+
}
2729
) {
2830
for (final T context in contexts) {
2931
if (context.isSupported) {
3032
test('${context.name} $description', () {
3133
body(context);
32-
});
34+
}, skip: skip);
3335
}
3436
}
3537
}
@@ -867,6 +869,7 @@ void testMain() {
867869

868870
semanticsPlaceholder.remove();
869871
},
872+
skip: isFirefox, // https://bugzilla.mozilla.org/show_bug.cgi?id=1804190
870873
);
871874

872875
// BUTTONED ADAPTERS
@@ -2263,7 +2266,7 @@ void testMain() {
22632266
packets.clear();
22642267

22652268
// Release outside the glasspane.
2266-
domWindow.dispatchEvent(context.primaryUp(
2269+
glassPane.dispatchEvent(context.primaryUp(
22672270
clientX: 1000.0,
22682271
clientY: 2000.0,
22692272
));
@@ -3328,6 +3331,7 @@ class _PointerEventContext extends _BasicEventContext
33283331
String? pointerType,
33293332
}) {
33303333
return createDomPointerEvent('pointerup', <String, dynamic>{
3334+
'bubbles': true,
33313335
'pointerId': pointer,
33323336
'button': button,
33333337
'buttons': buttons,

0 commit comments

Comments
 (0)