This will allow us to add tooling to do some bundling/minifying of `flutter.js`, which should make this more scalable/extensible long-term.
Also, this removes a few redundant build rules that produce artifacts that the flutter tool doesn't use anymore.
The PR may seem large, but the main changes are simple:
- Introduce a `DomManager` that aims to take over all DOM responsibilities from `FlutterViewEmbedder`.
- Update all references to `flutterViewEmbedder.*domElement*` to `domManager.*domElement*`.
- Describe the general DOM structure of a Flutter View in a doc comment.
Next steps (in future PRs):
- Move all DOM manipulation methods out of `FlutterViewEmbedder` into `DomManager`.
- Move DOM creation logic out of `FlutterViewEmbedder` into `DomManager`.
As part of eliminating the Flutter buildroot
(https://github.com/flutter/flutter/issues/67373), we are moving all
third-party dependencies from //third_party to //flutter/third_party.
Once all third-party dependencies have been migrated, tooling and config
will be moved and the buildroot will be eliminated altogether.
No tests changed because there is no semantic change to this PR. This is
simply relocating a dependency.
This PR relands https://github.com/flutter/engine/pull/44473.
The previous PR was immediately reverted after merging because we found that the PR could cause illegal renders to be skipped on debug builds but crash the app on release builds. This PR makes the `Animator::Render` skip illegal renders as well. This should not be the final shape of this feature, and thus a TODO is added.
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
- Update the pinned version of `test` to the latest published.
- Add support for reading the `source.location` of messages to the JS
interop library.
- Update `host.dart` to support the new communication pattern with the
test frame. See https://github.com/dart-lang/test/issues/2065
- Use `Runtime.edge` for the edge browser. We may deprecate or remove
the constant. Edge is a more appropriate value for this usage.
Testing locally I cant see any impact from this. Its possible the problem this "fixed" was instead fixed by affinity changes and now its no longer necessary.
See https://github.com/flutter/engine/pull/43493 .
- Accept a new `flutterViewId` field in platform view messages.
- Keep transitory support for legacy platform view messages that don't contain `flutterViewId`.
- Default view factories set `width:100%` and `height:100%`.
This fixes https://github.com/flutter/flutter/issues/134045
There were a few different issues here:
* We need to do our own message passing for rendering pictures. The async methods provided by emscripten have their own queue that can drain synchronously, so basically it's not guaranteed to be FIFO with other messages sent to the web worker or main thread.
* When we drop frames, we should only drop intermediate frames, so that when the rendering flurry stops that the frame that is displayed is the last one that was actually requested.
* We need to reset the GL context after lazy image creation, otherwise skia's renderer gets into a bad state for that frame.
- `EmbeddingStrategy` shouldn't own the creation of `HotRestartCacheHandler`.
- Simplify `HotRestartCacheHandler`'s JS-interop by using a `JSArray` directly instead of going through a Dart `List`.
There's no reason (that we know of) to listen to pointer events during the capture phase, so let's listen on the bubble phase.
I couldn't find a reason for listening to pointer events during the capture phase. So let's listen on the bubble phase which is more natural and allows platform views to `stopPropagation` in order to prevent Flutter from receiving an event.
This PR relands part of https://github.com/flutter/engine/pull/45300, which was reverted in https://github.com/flutter/engine/pull/46919 due to performance regression.
Due to how little and trivial production code the original PR touches, I really couldn't figure out the exact line that caused it except through experimentation, which requires changes to be officially landed on the main branch. After this PR lands, I'll immediately fire a performance test.
This PR contains the render rule check performed by `PlatformDispatcher` of the original PR, the remaining changes to production code besides [the part 1](https://github.com/flutter/engine/pull/47062). Since part 1 shows no regression, the changes of this PR is highly likely to be the culprit. Therefore I made some changes: The rule enforcement is no longer performed in release mode, but only in debug mode. This will cause behavior deviation between builds, but since the developer should be able to notice violation in debug mode anyway, I think this design is acceptable.
It is intentional to not contain any unit tests or other changes of the original PR. They will be landed shortly after this PR.
Part of https://github.com/flutter/flutter/issues/136826.
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
When objcopy is used to embed data into a linkable object file, that
object file will only have default bits set in its header for ABI etc..
If the linker doesn't cooperate by ignoring ABI mismatches on object
files without code, then linking will fail. This PR stops using objcopy
to create an object file that embeds icudtl.dat into the Android
embedder, and instead uses the `bin_to_assembly.py` script that we're
already using for Dart VM snapshot data.
Context in https://github.com/llvm/llvm-project/issues/68915
As of right now, there is an indirect link between `flutter/platform_views` messages and `flutterViewEmbedder`, expressed by the callback that's being passed to the `PlatformViewMessageHandler`.
This PR proposed making this relationship clear between `flutter/platform_views` and `implicitView` (i.e. the singleton `window`).
This PR also opens the path for each view to have its own `PlatformViewMessageHandler` instance.
Depends on https://github.com/flutter/engine/pull/46044
Part of https://github.com/flutter/flutter/issues/134443
This patch does the following:
- Updates `flutter_tester` to set up an Impeller rendering context and surface if `--enable-impeller` is set to true, using the Vulkan backend with Swiftshader.
- Updates `run_tests.py` to run all tests except the smoke test (that one really has no rendering impact whatsoever) with and without `--enable-impeller`.
- Updates a few tests to work that were trivial:
- A couple tests needed updated goldens for very minor rendering differences. Filed https://github.com/flutter/flutter/issues/135684 to track using Skia gold for this instead.
- Disabled SKP screenshotting if Impeller is enabled, and updated the test checking that to verify an error is thrown if an SKP is requested.
- The Dart GPU based test now asserts that the gpu context is available if Impeller is enabled, and does not deadlock if run in a single threaded mode.
- We were missing some trace events around `Canvas::SaveLayer` for Impeller as compared to Skia.
- A couple other tests had strict checks about exception messages that are slightly different between Skia and Impeller.
- I've filed bugs for other tests that may require a little more work, and skipped them for now. For FragmentProgram on Vulkan I reused an existing bug.
This is part of my attempt to address https://github.com/flutter/flutter/issues/135693, although @chinmaygarde and I had slightly different ideas about how to do this.
The goals here are:
- Run the Dart unit tests we already have with Impeller enabled.
- Enable running more of the framework tests (including gold tests) with Impeller enabled.
- Run all of these tests via public `dart:ui` API rather than mucking around in C++ internals in the engine.
This switches over to using Chrome for Testing instead of Chromium. This requires some changes from the recipes repo (https://flutter-review.googlesource.com/c/recipes/+/51482) in order to coordinate the change in filestructure on the mac versions.
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
Bumps [webdriver](https://github.com/google/webdriver.dart) from 3.0.2 to 3.0.3.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/google/webdriver.dart/blob/master/CHANGELOG.md">webdriver's changelog</a>.</em></p>
<blockquote>
<h2>3.0.3</h2>
<ul>
<li>Include a content-type header when sending requests from <code>async_html.dart</code>.
The content-type is necessary for compatibility with GeckoDriver 0.27.0 and
newer versions. The content-type header was already being sent in IO clients
for a long time, so only the HTML client had to be updated.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a href="https://github.com/google/webdriver.dart/commits">compare view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
</details>
Skia clamps any gradient stops to values of 0.0 to 1.0. Implement this behavior in Impeller and document it in dart:ui (Framework also needs to be documented). This also matches the w3c gradient behavior: https://www.w3.org/TR/2000/CR-SVG-20000802/pservers.html - almost. We might be slightly off with how we're inserting additional stops for 0.0 and 1.0, but at least its closer.
Fixes https://github.com/flutter/flutter/issues/132792
Bumps [uuid](https://github.com/Daegalus/dart-uuid) from 4.0.0 to 4.1.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/Daegalus/dart-uuid/releases">uuid's releases</a>.</em></p>
<blockquote>
<h1>4.1.0</h1>
<ul>
<li><strong>[BREAKING CHANGE]</strong> In order to enforce lowercase strings in <code>UuidValue</code>, I have made the default const constructor private, and added a <code>fromString</code> factory constructor. Please migrate any direct <code>UuidValue()</code> usage to <code>UuidValue.fromString()</code> or <code>UuidValue.withValidation()</code>.</li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/daegalus/dart-uuid/compare/4.0.0...4.1.0">https://github.com/daegalus/dart-uuid/compare/4.0.0...4.1.0</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/daegalus/dart-uuid/blob/main/CHANGELOG.md">uuid's changelog</a>.</em></p>
<blockquote>
<p>v4.1.0</p>
<ul>
<li><strong>[BREAKING CHANGE]</strong> In order to enforce lowercase strings in <code>UuidValue</code>, I have made the default const constructor private, and added a <code>fromString</code> factory constructor. Please migrate any direct <code>UuidValue()</code> usage to <code>UuidValue.fromString()</code> or <code>UuidValue.withValidation()</code>.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="f4a6b226a2"><code>f4a6b22</code></a> Fix test</li>
<li><a href="897561eeed"><code>897561e</code></a> Update Docs</li>
<li><a href="404a86a32b"><code>404a86a</code></a> Change privatize UuidValue and add new factory constructor.</li>
<li><a href="2c9c74d0fc"><code>2c9c74d</code></a> Pubspec info update</li>
<li>See full diff in <a href="https://github.com/Daegalus/dart-uuid/compare/4.0.0...4.1.0">compare view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
</details>
I have hit this assertion error many times in tests and this message
would be helpful for debugging.
---------
Co-authored-by: Mouad Debbar <mdebbar@google.com>
Bumps [archive](https://github.com/brendan-duncan/archive) from 3.3.9 to 3.4.2.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/brendan-duncan/archive/blob/main/CHANGELOG.md">archive's changelog</a>.</em></p>
<blockquote>
<h2>3.4.2 - September 23, 2023</h2>
<ul>
<li>Add bzip2 decompression for zip files.</li>
</ul>
<h2>3.4.1 - September 23, 2023</h2>
<ul>
<li>Fix for decoding zip64 zip files that have multiple extra fields.</li>
</ul>
<h2>3.4.0 - September 21, 2023</h2>
<ul>
<li>Add Zip64 support to ZipEncoder to allow it to create zip files > 4GB.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="3fe2f348b0"><code>3fe2f34</code></a> Update to 3.4.2</li>
<li><a href="7ebfdfe345"><code>7ebfdfe</code></a> Throw exception for unsupported zip compression methods</li>
<li><a href="2a6c51b6a5"><code>2a6c51b</code></a> Add bzip2 decompression for zip files</li>
<li><a href="3bd14c0a22"><code>3bd14c0</code></a> Update to 3.4.1</li>
<li><a href="e2ae50513d"><code>e2ae505</code></a> Fix for zip files that have multiple extra fields</li>
<li><a href="9171becaa6"><code>9171bec</code></a> Update to 3.4.0</li>
<li><a href="6fdd35c7df"><code>6fdd35c</code></a> Add zip64 support to ZipEncoder to handle files > 4GB; reduce memory for enco...</li>
<li>See full diff in <a href="https://github.com/brendan-duncan/archive/compare/3.3.9...3.4.2">compare view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
</details>