-
Notifications
You must be signed in to change notification settings - Fork 6k
[web] Adds allowPlatformDefault for wheel signals. #51566
Conversation
69f2aa3 to
bb1c9bf
Compare
|
I changed this so it doesn't exposea a mutable property, instead it allows the framework to call a new |
|
Here's a slightly different approach that I tried a few months ago: mdebbar@51ec1ee It basically adds a This avoids adding a new method to the |
|
I like not having to add new methods to the Platform Dispatcher, not going to lie :) |
5dcc6ce to
05067ef
Compare
ditman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the simplest I can come up with that could be removed/noop'd without much drama.
|
(PTAL @yjbanov @goderbauer @mdebbar) |
5feb42a to
9f280d3
Compare
|
Adding tests. |
1368ca4 to
e715552
Compare
|
This is finally ready to go, PTAL @mdebbar @goderbauer (optionally, @yjbanov)! |
goderbauer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can live with this dart:ui API. :)
Leaving reviewing the web implementation to others.
goderbauer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for lib/ui
|
|
||
| // An optional function that allows the framework to respond to the event | ||
| // that triggered this PointerData instance. | ||
| final PointerDataRespondCallback? _onRespond; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can inline a function type here without creating a one-off typedef. Is this a guideline or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can inline a function type here without creating a one-off
typedef. Is this a guideline or something?
@kevmoo I went back and forth on this (I originally had this as an inline function type). The Style guide for Flutter repo that @goderbauer linked says this:
Prefer using
typedefs to declare callbacks. Typedefs benefit from having documentation on the type itself and make it easier to read and find common callsites for the signature.
I don't have strong feelings about it (but when we were bikeshedding in parameter name, it was a chore to rename it in several, unconnected parts, and that's when I ended up adding the typedef... it's also nice to be able to add some dartdoc to the typedef).
This reverts commit 69f2aa3.
This reverts commit 05067ef.
Also wires the `respond` method to the actual browser event, to call event.preventDefault when the framework tells us to do so.
Fix outdated comment wrt how the framework flips the _lastWheelEventAllowedDefault variable.
Co-authored-by: Michael Goderbauer <goderbauer@google.com>
290ec95 to
663dafa
Compare
…149785) flutter/engine@f51e0ad...0edca2e 2024-06-06 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[Impeller] Use Skia software renderer to draw stroked text. (#53198)" (flutter/engine#53237) 2024-06-05 jonahwilliams@google.com [Impeller] Use Skia software renderer to draw stroked text. (flutter/engine#53198) 2024-06-05 chinmaygarde@google.com Remove the DBC interpreter flag. (flutter/engine#53204) 2024-06-05 ditman@gmail.com [web] Adds allowPlatformDefault for wheel signals. (flutter/engine#51566) 2024-06-05 jonahwilliams@google.com [Impeller] fix emojis with non-solid color sources. (flutter/engine#53229) 2024-06-05 skia-flutter-autoroll@skia.org Roll Skia from 8448abc95867 to 89570a0a171e (1 revision) (flutter/engine#53236) 2024-06-05 skia-flutter-autoroll@skia.org Roll Dart SDK from f838a9a8d45f to 86b8aacb2609 (1 revision) (flutter/engine#53234) 2024-06-05 flar@google.com [DisplayList] remove legacy DisplayListMatrixClipTracker (flutter/engine#53232) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC matanl@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Adds a function to each 'wheel' DataPacket sent to the framework so it can signal whether to
allowPlatformDefaultor not.The current default is to always
preventDefaulton browser events that get sent to the framework.This PR enables the framework to call a method on the
DataPackets toallowPlatformDefault: true, if the framework won't handle the Signal (signals are handled synchronously on the framework).This lets the engine "wait" for the framework to decide whether to
preventDefaulton awheelevent or not.Issues
Tests
defaultPreventedor not.Demo
Previous approaches
handledbool property toPointerDataPacketthat the framework can write to (brittle)PlatformDispatcherso the framework canacknowledgePointerDatawith aPointerDataResponse(fffffatttt change)acknowledgefunction inPointerDataPacketImportant
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.