We shouldn't assume the exact format of the assertion string here, as the exact output is slightly different on dart2js vs ddc vs dart2wasm. They should all contain the message text, however.
The Skia APIs I was previously using were returning `-1` for `paragraphGetLineNumberAt` when querying at the end of the string. I changed the implementation to be identical to what CanvasKit and the native Paragraph object are doing.
We need to apply the paragraph style's height to the initial default text style on the stack. I also added a `toString` method for `StrutStyle` so that things are a bit easier to debug.
This fixes https://github.com/flutter/flutter/issues/141639
Most of this was previously unimplemented. It turns out the reason for the hang described in the github issue was that there was a typo in the name of the `getMiterLimit` C function, so if the client actually called that method the Wasm module failed to compile, as it couldn't find an import with the misspelled name.
I had failed to take position affinity into account when calculating word boundaries on skwasm. This brings skwasm's behavior in line with canvaskit's.
At some point, we inherited a change from the repo-level `analysis_options.yaml` that [allowed deprecated](https://github.com/flutter/engine/pull/50575) members to be used. We rely on that analyzer error to prevent `solo: true` from being committed in our tests ([example](c935c3ba36/lib/web_ui/test/ui/line_metrics_test.dart (L179)) of one that slipped recently).
This PR overrides the `deprecated_member_use` error to enable it inside the web engine.
Instead of just returning, if our paragraph builder has empty text, we still need to generate a set of line breaks for skia to use. Otherwise, it will actually cause subtle memory access errors.
Closes https://github.com/dart-lang/sdk/issues/55256d7ce346fba added code to avoid the less performant boxing of JSBoxedDartObject and instead use backend-specific logic to externalize and internalize the UniqueRef until we get a better solution from dart:js_interop. On the JS backends, this relied on casting to and from JSAny, as its representation type is just Object. However, this callback that takes in the UniqueRef as an arg is still typed as accepting JSBoxedDartObject, leading to a cast failure on the JS backends, since the representation type is JSObject.
The fix is to use JSAny. On dart2wasm, this makes no difference, as the underlying representation type does not change.
The previous code here introduced an extra slash. Our test platform was tolerant to this extra slash and essentially ignored it, but this probably won't work for most hosting solutions. I went ahead and added some extra validation to the URL when fetching so that we won't serve URLs that have the double slash in their path, in order to catch this if it regresses again.
The `js_util.jsify()` related code shows up in CPU profile of wonderous.
=> Any `SkwasmObjectWrapper` object invokes this logic in the
constructor and dispose method.
This PR
* makes `DomFinalizationRegistryExtension` accept `JSAny` types instead
of Dart types and internally converting
=> Callsites can call more precise `<>.toJS*` extension methods
=> Will avoids extra type checks on the objects when we can call
`Object.toJSBox` directly
* makes us use a `toJSWrapper` / `fromJSWrapper` which will not delegate to a recursive `jsify()` but simply externalize the wasm gc object
=> We cannot use `Object.toJSBox` due to it being slower to create JS
boxes as it semantically does something different atm (see issue below)
=> Instead use conditional import of `dart:_wasm` which provides the
necessary primitives
=> Similar for going from JS to Dart.
* Avoid converting from Dart object to `JSAny` more than needed
(we did the operation twice for each registration and once for
unregistration)
Issue https://github.com/dart-lang/sdk/issues/55183
Remove the `Tappable` role from the `PrimaryRoleManager.withBasics` constructor. Only add `Tappable` to primary roles that know for sure they need it.
Fixes https://github.com/flutter/flutter/issues/144364
### Motivation of the change:
Both dart and flutter are using fairly outdated gn-sdk without properly maintained. Currently @hjfreyer is working on version'ed IDK / SDK libs which requires changes in gn-sdk to use the right version of the libs in fuchsia/sdk/obj/{arch}-api-{level} rather than the one in the fuchsia/sdk/arch. But current implementation does not support choosing the right version.
### Blocking issue:
The new gn-sdk (in flutter/tools/fuchsia/gn-sdk) generates multiple BUILD.gn files rather than a large BUILD.gn the previous version created. So most of the build rules need to switch from the old `fidl:{api}` build rule to `fidl/{api}` rule. The same change will happen in the dart/sdk, i.e. http://go/dart-reviews/356924. But since the two repos cannot have one single atomic change, changing either side first will cause flutter to break. E.g. the linkage error caused by duplicated symbols will happen if we change the dart/sdk first, since in flutter, it will still refer to the old build rules in the middle.
### Solutions:
Ideally we can create redirect rules in the current `build/fuchsia` buildroot tree to redirect the old rules into the new one, so we can make the change in the flutter first then dart/sdk. But creating the rules is not trivial and will only be used once.
So an alternative solution is
- pause the dart/sdk -> flutter roll
- submit dart/sdk change (http://go/dart-reviews/356924)
- update this change to manually bring the dart/sdk change, namely the `dart_revision` in the DEPS file and signatures in the ci/licences.
- resume the dart/sdk -> flutter roll.
But it requires this change itself to be reviewed first, and I'd like to know your opinion before moving forward.
See corresponding dart/sdk change at http://go/dart-reviews/356924.
### //build/fuchsia/ from buildroot should be removed after this change.
Bug: [b/40935282](https://issues.chromium.org/issues/40935282?pli=1&authuser=0)
FYI: @hjfreyer
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Uses the utility added in https://github.com/flutter/engine/pull/51361
I counted the removal of 58 static casts. There was one addition made to the original utility however. Vulkan HPP was promoting all enums to its own mask type. This in itself is problematic but we got away with it because there was no one else doing this kind of promotion. Till we added our own utility. To avoid polluting the namespace with methods that may cause ambiguity, enums that are masks must explicitly be marked as maskable with `IMPELLER_ENUM_IS_MASK` in the `impeller` namespace.
No change in functionality.
This is a reland of the change moving the emsdk out of the buildroot, but without the removal of `web_dependencies`, since that removal was causing issues with the rollers.
Reverts: flutter/engine#51299
Initiated by: zanderso
Reason for reverting: Blocking the autoroller
Original PR Author: eyebrowsoffire
Reviewed By: {matanlurey}
This change reverts the following previous change:
This migrates the emscripten toolchain into the flutter repo, as well as the fonts for web unit tests. Also, removed the `web_dependencies` thing which is no longer used.
This fixes https://github.com/flutter/flutter/issues/143332
Depends on a buildroot change here: https://github.com/flutter/buildroot/pull/833
* Update documentation for the annotation
* Add `@keepToString` annotation to web's `Locale` class (similar to
non-webs `Locale` class)
Issue https://github.com/flutter/flutter/issues/52759