51 Commits

Author SHA1 Message Date
Michael Goderbauer
8e0993eda8
Auto-format Dart code in engine (#160576)
This auto-formats all *.dart files in the `engine` subdirectory and
enforces that these files stay formatted with a presubmit check.
2024-12-19 17:13:07 +00:00
Yegor
f344c4699a [web] allow imports to line-break (flutter/engine#57170)
We are about to `dart format` all the Dart code in the repo, which line-breaks some of our imports.

This PR updates `sdk_rewriter.dart` to support line-broken imports.
2024-12-13 20:42:30 +00:00
Martin Kustermann
d82c365da3 Use dart.library.html to distinguish dart2wasm from dart2js/ddc in conditional imports (flutter/engine#53307)
Users of packages that have specialized code for the VM (which supports
FFI) use conditional imports based on `dart.library.ffi`. We don't want
the VM-specific code to be used for web in dart2wasm.

As a result we're going to make `dart.library.ffi` be false in
conditional imports (as well as in
`const bool.fromEnvironment('dart.library.ffi')`).

Issue https://github.com/dart-lang/sdk/issues/55948
Issue https://github.com/flutter/flutter/issues/149984
2024-06-10 15:58:43 +02:00
David Iglesias
6eacdf2be8 [web] Adds allowPlatformDefault for wheel signals. (flutter/engine#51566)
Adds a function to each 'wheel' DataPacket sent to the framework so it can signal whether to `allowPlatformDefault` or not.

The current default is to always `preventDefault` on browser events that get sent to the framework.

This PR enables the framework to call a method on the `DataPacket`s to `allowPlatformDefault: 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 `preventDefault` on a `wheel` event or not.

## Issues

* Needed for: https://github.com/flutter/flutter/issues/139263

## Tests

* Added unit tests for the feature in the engine repo, veryfing whether the event has had its `defaultPrevented` or not.
* Manually tested in a demo app (see below)

## Demo

* https://dit-multiview-scroll.web.app

<details>
<summary>

## Previous approaches

</summary>

1. Add a `handled` bool property to `PointerDataPacket` that the framework can write to (brittle)
2. Modifications to the `PlatformDispatcher` so the framework can `acknowledgePointerData` with a `PointerDataResponse` (fffffatttt change)
3. `acknowledge` function in `PointerDataPacket`

</details>

> [!IMPORTANT]
> * Related: https://github.com/flutter/flutter/pull/145500

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-06-05 23:25:53 +00:00
Jackson Gardner
2c58573690 Use dart:_wasm constructs to avoid dependence on WebAssembly.Function (flutter/engine#46388)
Use the newly exposed functionality in `dart:_wasm` to fix up two different hacks we have:
1) When creating an image from an image source, use `wasm:import` instead of `@Native` and pass the image source directly as an externref. (Direct wasm binding instead of a JS interop shim, yay).
2) When binding the surface callback, previously we were wrapping the callback in a JS function, and then using `WebAssembly.Function` to create a wasm function wrapper around that. Now, we can create a `WasmFuncRef` that is a direct reference to a dart function and pass that over. Now there are no intermediary JavaScript layers when skwasm calls back to us, and we no longer are dependent on the type reflection flag in Chrome.

This fixes https://github.com/flutter/flutter/issues/134556
2023-09-29 20:52:36 +00:00
Mouad Debbar
3a4677a6d7 [web] Cleanup assertionsEnabled (flutter/engine#41829)
For consistency with the rest of the flutter code, this PR explores the possibility of removing our proprietary `assertionsEnabled`.
2023-05-24 15:08:50 +00:00
joshualitt
e370809b5e [web] Add dart:js_interop_unsafe to SDK. (flutter/engine#41591)
Adds the `dart:js_interop_unsafe` library to the SDK.
2023-05-03 08:38:33 -07:00
Jackson Gardner
439141c38d Skwasm scene (flutter/engine#40330)
Skwasm scene
2023-04-10 17:38:57 +00:00
Jackson Gardner
1a59a35e3c ui_web library (flutter/engine#40608)
`ui_web` library
2023-03-30 23:14:18 +00:00
Michael Goderbauer
a508065bbc Reland "Post 3.0 lint sync (#40394)" (flutter/engine#40688)
Reland "Post 3.0 lint sync (#40394)"
2023-03-28 03:25:02 +00:00
Brandon DeRosier
9e9590a68f Revert "Post 3.0 lint sync (#40394)" (flutter/engine#40687)
This reverts commit 8ba209121d2671b0d202d9731fe67ec5eb1529b4.
2023-03-27 15:45:59 -07:00
Michael Goderbauer
8ba209121d Post 3.0 lint sync (flutter/engine#40394)
Post 3.0 lint sync
2023-03-27 17:15:08 +00:00
Michael Goderbauer
7187bc8e88 Update analyzer for api_conform_test (flutter/engine#40386)
Update analyzer for api_conform_test
2023-03-17 19:15:50 +00:00
Michael Goderbauer
1986d84d6e replace some ._() constructors with class modifiers (flutter/engine#40328)
replace some ._() constructors with class modifiers
2023-03-17 16:18:49 +00:00
joshualitt
be4da063e8 add support for JS types (flutter/engine#40310) 2023-03-17 08:27:53 -07:00
Yegor
e9abb22ba1 Revert "[web] Access engine version to get correct gstatic URL (#40194)" (flutter/engine#40235)
This reverts commit 46682951fe7f61296070c2fdfb673576628bbd89.
2023-03-10 14:46:06 -08:00
Harry Terkelsen
46682951fe [web] Access engine version to get correct gstatic URL (flutter/engine#40194) 2023-03-10 10:16:48 -08:00
LongCatIsLooong
48c413ae2f Add new test font (flutter/engine#39809)
Add new test font
2023-03-03 21:38:01 +00:00
Jackson Gardner
a3dc9e77fb Skwasm Renderer - initial implementation (flutter/engine#39072)
Skwasm Renderer - initial implementation
2023-03-02 00:01:04 +00:00
Tong Mu
c3925d9120 [Web, keyboard] Locale layout mapping (flutter/engine#34625)
* WIP

* WIP: Better debug log

* WIP

* Finish logic (untested)

* Use third_party for layouts

* Update gen

* Fix filtering bugs

* Format

* Fix build

* Add scripts

* Try license

* Copyright

* Rename license

* Use case insensitive

* more lower case

* Sort. Migrate to better types.

* Fix template

* Marshall and unmarshall

* Comments

* Gen types file

* gen json

* engine compilable

* benchmark_detector

* Move github to separate file

* Generate full mapping

* test cases

* Unified dead key

* Correct key

* remove duplicate file

* letter in test cases

* Compile

* int keycode, and fix compile

* Correct gen directory

* Heuristic

* Heuristic benchmark

* Reorganize logical key

* Move to common

* Docs

* Combine into bin

* Remove layout_types

* Rename to locale_keymap

* Rename class

* Rename to heuristicMapper

* Format

* Fix license

* Fix test

* Test license

* Fix tests

* Fix import as

* Fix analyze problem

* Fix license

* Update license pattern

* The MIT license

* License diff

* Fix license

* Update signature

* readme

* fix signature?

* fix signature?

* Fix license count

* Fix build

* Compression

* Fix _eventKeyIsKeyname

* remove gitignore

* Fix nullable

* Fix doc

* Add underscore lead. Make everything lower case. Print by line.

* Better event code encoding

* Signature

* Comment. Change dead key mapping to the last.

* Better digit heuristic. Better _eventKeyIsKeyName

* en-in test

* Remove unnecessary build change

* Better order
2022-11-30 01:28:02 +00:00
Mouad Debbar
9d9401970f [web] Move unicode properties to third_party (flutter/engine#37440)
* [web] Move unicode properties to third_party

* license

* fix license check

* attempt to fix license golden

* more license fixes

* even more license fixes

* add check mode and readme file

* fix licenses + add web_unicode.dart

* build web_unicode as an sdk library

* remove unnecessary variable

* minor fix in license golden

* tool signature
2022-11-22 18:47:11 +00:00
Mouad Debbar
88f0493704 [web] Remove unnecessary code from sdk_rewriter (flutter/engine#36124) 2022-09-30 21:00:53 +00:00
Polina Cherkasova
e0e86ca10b Instrument Image and Picture for leak tracking. (flutter/engine#35274) 2022-09-08 20:13:46 -07:00
Jackson Gardner
3abd78d817 Add stubs for Skwasm renderer (flutter/engine#35748) 2022-09-01 18:36:29 +00:00
Michael Goderbauer
bfd0781318 Analyze all dart code on CI (flutter/engine#35147) 2022-08-05 17:38:05 +00:00
joshualitt
9a9136c045 [web] Changes to support dart:wasm. (flutter/engine#34991) 2022-08-01 10:26:26 -07:00
Michael Goderbauer
cc50c5249c Sync analysis_options.yaml with flutter/flutter (flutter/engine#34986) 2022-07-29 16:41:04 -07:00
Dan Field
f37da53cfb Drop unnecessary @dart annotations (flutter/engine#34760) 2022-07-19 22:07:04 +00:00
joshualitt
7638ac4a52 [web] Remove dependency on dart:js. (flutter/engine#34211) 2022-07-18 14:05:34 -07:00
Jonas Uekötter
0c0252e166 Consolidate method signature for PlatformDispatcher.onError (flutter/engine#34428) 2022-07-07 19:44:04 +00:00
joshualitt
9234984d80 [web] Migrate Flutter Web DOM usage to JS static interop - 44. (flutter/engine#34379) 2022-07-07 10:56:41 -07:00
joshualitt
0c42a323c3 Revert "[web] Migrate Flutter Web DOM usage to JS static interop - 44. (#33380)" (flutter/engine#34375)
This reverts commit 38caaccb069187006063647ed1cecde5277273a0.
2022-06-29 11:51:05 -07:00
joshualitt
38caaccb06 [web] Migrate Flutter Web DOM usage to JS static interop - 44. (flutter/engine#33380) 2022-06-29 10:28:56 -07:00
Yegor
e7c4fcc17d [web] consolidate JS interop code (attempt 2) (flutter/engine#30161)
The original https://github.com/flutter/engine/pull/30007 was reverted
because it broke the framework. Turns out the framework still used the
WebExperiments code, which has been cleaned up in https://github.com/flutter/flutter/pull/94739.

This PR must land after https://github.com/flutter/flutter/pull/94739.

This reverts commit ae31d5a5d82c8091d859c27922e5f52e3a264286.
2021-12-07 09:27:06 -08:00
Jim Graham
ae31d5a5d8 Revert "[web] consolidate JS interop code (#30007)" (flutter/engine#30137)
This reverts commit 01a91d484eab5fae50381ab7c94fcdca9fbb56a9.
2021-12-04 18:54:31 -08:00
Yegor
01a91d484e [web] consolidate JS interop code (flutter/engine#30007)
* Consolidate and check JavaScript access
* Remove all `ignore: implicit_dynamic_function`
* Add `js_access_test.dart` that validates JS access
* Make `engine.dart` an exports-only library
* Fix `sdk_rewriter_test.dart` and `ci/analyze.sh` (they skipped some tests)
2021-12-03 15:46:03 -08:00
Anthony
50adf078fd [Re-land] Add SPIR-V FragmentShader API to painting.dart (flutter/engine#28208)
[Re-land] Add SPIR-V FragmentShader API to painting.dart

- Add a SPIR-V FragmentShader interface in painting.dart
- Create end to end pixel tests for ops supported by the SPIR-V to SkSL transpiler
- The end to end tests also test the c++ fragment shader implementation

Co-authored-by: Christopher Crawford <chriscraws@gmail.com>
2021-08-20 11:24:14 -04:00
Zachary Anderson
e3f282c563 Revert "Add SPIR-V FragmentShader API to painting.dart (#26996)" (flutter/engine#28202)
This reverts commit 1b518619357cc1666a9fca183c9766d1ece16d0f.
2021-08-19 12:38:10 -07:00
Anthony
1b51861935 Add SPIR-V FragmentShader API to painting.dart (flutter/engine#26996)
Add SPIR-V FragmentShader API to painting.dart
2021-08-18 12:58:25 -04:00
Yegor
660d911915 [web] migrate web_sdk to null safety (flutter/engine#26720) 2021-06-11 18:04:02 -07:00
Mouad Debbar
d05c96d8fa [web] Fix some regex issues in the sdk_rewriter (flutter/engine#25866) 2021-05-03 11:10:11 -07:00
Juyeong Lee
8fefd60dda Fix Typos (flutter/engine#19691) 2020-07-31 16:32:58 -07:00
Yegor
30879c3f50 take web_ui to null safety (flutter/engine#19027)
move web_ui to NNBD syntax
2020-06-16 15:28:06 -07:00
Yegor
b457938f23 apply null safety syntax to mobile dart:ui (flutter/engine#18933)
* apply null safety syntax to mobile dart:ui
2020-06-12 12:42:12 -07:00
Jonah Williams
fb6777923d allow ignoring toString, hashCode, and == in api_conform_test (flutter/engine#13907) 2019-11-19 10:21:31 -08:00
Yegor
92407929f4 rename stub_ui to web_ui (flutter/engine#10776)
* rename stub_ui to web_ui

* update licenses
2019-08-09 11:11:20 -07:00
Jonah Williams
07d7550d80 fix Picture.toImage return type check and api conform test. (flutter/engine#9685) 2019-07-06 00:45:07 -07:00
Jonah Williams
6a11211e12 Add checks to constructors and add missing constructor members (flutter/engine#9106) 2019-05-28 13:37:15 -07:00
Jonah Williams
2f4f66c0d7 Fix api conformance check (flutter/engine#8817) 2019-05-02 14:11:37 -07:00
Jonah Williams
2df6e9157a Introduce unit tests and refactor web dart:ui into "package" (flutter/engine#8346) 2019-03-29 14:54:53 -07:00