Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorporate compat info changes into flutter engine #19606

Merged
merged 1 commit into from
Jul 10, 2020

Conversation

srujzs
Copy link
Contributor

@srujzs srujzs commented Jul 8, 2020

Changes related to compatibility info require changes in
Flutter engine libraries. This CL adds null-asserts wherever
necessary to maintain behavior.

Original issue: dart-lang/sdk#41905

No new tests are added. Should I be running other tests besides the ones run by felt test?

Checklist

  • I read the [contributor guide] and followed the process outlined there for submitting PRs.
  • I signed the [CLA].
  • I read and followed the [C++, Objective-C, Java style guides] for the engine.
  • I read the [tree hygiene] wiki page, which explains my responsibilities.
  • [N/A] I updated/added relevant documentation.
  • [No new test failures, but there are existing tests failing] All existing and new tests are passing.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read [handling breaking changes].

  • [Only existing failures persisted] No, no existing tests failed, so this is not a breaking change.

@auto-assign auto-assign bot requested a review from GaryQian July 8, 2020 17:26
@srujzs
Copy link
Contributor Author

srujzs commented Jul 8, 2020

Note that this needs to be submitted along with a manual roll of https://dart-review.googlesource.com/c/sdk/+/153368.

@@ -109,7 +109,7 @@ class ClipboardAPICopyStrategy implements CopyToClipboardStrategy {
@override
Future<bool> setData(String? text) async {
try {
await html.window.navigator.clipboard.writeText(text!);
await html.window.navigator.clipboard!.writeText(text!);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like we no longer need to use _unsafeIsNull on line 95 to check for clipboard presence. Also, I imagine window.navigator.clipboard is a singleton, and so we can store it in a final non-null field, null check it in the initializer once, and remove the null assertions here and below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we still want to check whether it's null in order to determine what "Strategy" class to initialize, right?

I don't think clipboard can be made a singleton since _Clipboard is a private class (unless we declared the field as dynamic).

@@ -45,11 +45,11 @@ class Incrementable extends RoleManager {
_element.setAttribute('role', 'slider');

_element.addEventListener('change', (_) {
if (_element.disabled) {
if (_element.disabled!) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious why this property is nullable. Even the most ancient browsers should have this property, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. Here, it's a limitation of the language: there is a class that extends InputElement that has disabled marked as nullable (probably due to some incompatibility), so this InputElement.disabled needs to also be nullable.

@@ -690,7 +690,7 @@ double _measureSubstring(
final String sub =
start == 0 && end == text.length ? text : text.substring(start, end);
final double width =
_canvasContext.measureText(sub).width + letterSpacing * sub.length as double;
_canvasContext.measureText(sub).width! + letterSpacing * sub.length as double;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surprised that measureText can return null.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We casted a pretty wide net for attributes to make sure we don't accidentally type something as non-nullable and it ends up returning null. It's likely there are some getters that are non-nullable but will most likely never return null. For this case, width is tagged as experimental in the MDN, which is why we default to nullable.

@@ -281,14 +281,14 @@ class EngineWindow extends ui.Window {
static List<ui.Locale> parseBrowserLanguages() {
// TODO(yjbanov): find a solution for IE
final bool languagesFeatureMissing = !js_util.hasProperty(html.window.navigator, 'languages');
if (languagesFeatureMissing || html.window.navigator.languages.isEmpty) {
if (languagesFeatureMissing || html.window.navigator.languages!.isEmpty) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like we don't need the js_util.hasProperty hack on the previous line. We can just null-check window.navigator.languages and remove further null checks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, we can simplify this. Done.

Changes related to compatibility info require changes in
Flutter engine libraries. This CL adds null-asserts wherever
necessary to maintain behavior and adds some small modifications
to handle the change in nullability. Warnings about unnecessary
null assertions are disabled temporarily in this CL as well.

Original issue: dart-lang/sdk#41905
@yjbanov
Copy link
Contributor

yjbanov commented Jul 10, 2020

This PR only contains web_ui changes. The iOS failure must be unrelated. Merging.

@yjbanov yjbanov merged commit f3be9f1 into flutter:master Jul 10, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 13, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 13, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 13, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 14, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 14, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 14, 2020
GaryQian pushed a commit to flutter/flutter that referenced this pull request Jul 14, 2020
* 160b268 Set locale in Linux shell (flutter/engine#19470)

* c479b93 Fix documentation of unset platform view ID (flutter/engine#19320)

* f3ab78d Fix clipboard paste functionality not working (flutter/engine#19489)

* 9345347 Added the ability to set properties in interface builder for FlutterViewController. (flutter/engine#19458)

* 69fdf6d Use identical in hashValues instead of operator== (flutter/engine#19615)

* 3dc8163 [android] Pass synthesized eventType to VirtualDisplay platform views and fix memory leak (flutter/engine#19620)

* b16c47d using text capitalization value in web (flutter/engine#19564)

* 49c0161 Roll Skia from 16bf7d31c819 to 4d48bb35972f (32 revisions) (flutter/engine#19635)

* 2d6afa7 Roll Skia from 4d48bb35972f to 9f821489c9f3 (4 revisions) (flutter/engine#19638)

* 35f59b9 Roll Fuchsia Linux SDK from NC9pp... to 5R9a0... (flutter/engine#19639)

* 53038e2 Roll Fuchsia Mac SDK from iwQCA... to Wym-S... (flutter/engine#19640)

* d9e68f4 Roll Skia from 9f821489c9f3 to f8a6b5b4b0d0 (1 revision) (flutter/engine#19643)

* d329617 Changes to fix build errors in google3. (flutter/engine#19616)

* dd0a6c4 Roll Skia from f8a6b5b4b0d0 to 5160e8caa226 (9 revisions) (flutter/engine#19647)

* d98d539 Manual Roll of Dart dfdc7e45c5...06cb010247 (flutter/engine#19649)

* dfd0727 don't throw error for the new autofill request (flutter/engine#19633)

* 39e98d2 Manual Skia roll to c91db040ad18b9cc3236e342e9acca020eaafd10 (flutter/engine#19650)

* f9acd08 Avoid a copy in EncodeImage (flutter/engine#19504)

* 7e101f1 Roll Fuchsia Linux SDK from 5R9a0... to GOf1K... (flutter/engine#19656)

* f3be9f1 Incorporate compat info changes into flutter engine (flutter/engine#19606)

* 9188ff6 Manual Roll of Dart 707c6404f9...dfdc7e45c5 (flutter/engine#19657)

* cbdd3e2 Roll Fuchsia Mac SDK from Wym-S... to -v4bL... (flutter/engine#19661)

* 6efb152 Roll Dart SDK from 707c6404f969 to 0e25306d3f78 (4 revisions) (flutter/engine#19666)

* 22a440c Roll Dart SDK from 0e25306d3f78 to 6d06476bae6b (1 revision) (flutter/engine#19669)

* 8063923 Roll Fuchsia Linux SDK from GOf1K... to QWI76... (flutter/engine#19671)

* c99deb0 CkPaint uses SkPaint (flutter/engine#19562)

* 015f2ea Use the main bundle if the App bundle is not found (flutter/engine#18749)

* f82d30b Roll Dart SDK from 6d06476bae6b to a9e67d81941a (3 revisions) (flutter/engine#19677)

* 61b2fd2 Roll Fuchsia Mac SDK from -v4bL... to phQJt... (flutter/engine#19681)

* 74b541d Roll Fuchsia Linux SDK from QWI76... to mrlGt... (flutter/engine#19682)

* 25ce3db Roll Skia from c91db040ad18 to e4f36d7ac8f5 (20 revisions) (flutter/engine#19686)

* 162dba1 Roll Skia from e4f36d7ac8f5 to ed15b1c39b8b (1 revision) (flutter/engine#19687)

* f97c38b Roll Fuchsia Mac SDK from phQJt... to kEVc6... (flutter/engine#19688)

* 40c4ee8 Roll Fuchsia Linux SDK from mrlGt... to YfVT0... (flutter/engine#19690)

* ec944b0 Roll Skia from ed15b1c39b8b to 1434ce1aa94d (1 revision) (flutter/engine#19692)

* 7ce988a Roll Skia from 1434ce1aa94d to f64be13cbf84 (2 revisions) (flutter/engine#19695)

* 5f7ca41 Roll Fuchsia Mac SDK from kEVc6... to hRul_... (flutter/engine#19696)

* d24549c Roll Skia from f64be13cbf84 to 041796e60364 (3 revisions) (flutter/engine#19697)

* 617bd88 Roll Dart SDK from a9e67d81941a to fecc8163afc7 (3 revisions) (flutter/engine#19703)

* 8d241e4 [Android] Prevent FlutterRenderer listener from calling JNI after detach (flutter/engine#19558)

* 309e514 Roll Skia from 041796e60364 to d1ce4cb2beb8 (2 revisions) (flutter/engine#19704)

* 211f18e Roll Skia from d1ce4cb2beb8 to 7c1967700b44 (6 revisions) (flutter/engine#19707)

* 0532227 Roll Skia from 7c1967700b44 to 439709a97dfd (8 revisions) (flutter/engine#19712)

* 1e02bfd Support decimal information on the TextInputType (flutter/engine#19664)

* 7a95e32 Linux: Use a hash table to map cursors (flutter/engine#19561)

* df23044 [web] Implement ulps for path ops (flutter/engine#19711)

* 4a3aa4d Fixes typo in android_context_gl.h (flutter/engine#19700)

* 5b966eb Roll Skia from 439709a97dfd to 2604a89d3353 (3 revisions) (flutter/engine#19715)

* d024ae4 [fuchsia] Use memory_requirements_2 extension. (flutter/engine#19678)

* 4392fbf Roll Fuchsia Linux SDK from YfVT0... to 2ct5j... (flutter/engine#19720)

* ab05c79 Roll Fuchsia Mac SDK from hRul_... to ZXLvD... (flutter/engine#19721)

* c05ca7e Roll Dart SDK from fecc8163afc7 to f997d62a6d29 (13 revisions) (flutter/engine#19722)

* ae37971 Remove xcpretty from unit tests to see full output on test failures (flutter/engine#19667)

* 91f80ef Moved to RMSE for image comparison to account for slight variations in golden image tests (flutter/engine#19658)

* 1e23309 Wait for platform view to appear in iOS UI tests (flutter/engine#19725)
Pragya007 pushed a commit to Pragya007/flutter that referenced this pull request Aug 11, 2020
* 160b268 Set locale in Linux shell (flutter/engine#19470)

* c479b93 Fix documentation of unset platform view ID (flutter/engine#19320)

* f3ab78d Fix clipboard paste functionality not working (flutter/engine#19489)

* 9345347 Added the ability to set properties in interface builder for FlutterViewController. (flutter/engine#19458)

* 69fdf6d Use identical in hashValues instead of operator== (flutter/engine#19615)

* 3dc8163 [android] Pass synthesized eventType to VirtualDisplay platform views and fix memory leak (flutter/engine#19620)

* b16c47d using text capitalization value in web (flutter/engine#19564)

* 49c0161 Roll Skia from 16bf7d31c819 to 4d48bb35972f (32 revisions) (flutter/engine#19635)

* 2d6afa7 Roll Skia from 4d48bb35972f to 9f821489c9f3 (4 revisions) (flutter/engine#19638)

* 35f59b9 Roll Fuchsia Linux SDK from NC9pp... to 5R9a0... (flutter/engine#19639)

* 53038e2 Roll Fuchsia Mac SDK from iwQCA... to Wym-S... (flutter/engine#19640)

* d9e68f4 Roll Skia from 9f821489c9f3 to f8a6b5b4b0d0 (1 revision) (flutter/engine#19643)

* d329617 Changes to fix build errors in google3. (flutter/engine#19616)

* dd0a6c4 Roll Skia from f8a6b5b4b0d0 to 5160e8caa226 (9 revisions) (flutter/engine#19647)

* d98d539 Manual Roll of Dart dfdc7e45c5...06cb010247 (flutter/engine#19649)

* dfd0727 don't throw error for the new autofill request (flutter/engine#19633)

* 39e98d2 Manual Skia roll to c91db040ad18b9cc3236e342e9acca020eaafd10 (flutter/engine#19650)

* f9acd08 Avoid a copy in EncodeImage (flutter/engine#19504)

* 7e101f1 Roll Fuchsia Linux SDK from 5R9a0... to GOf1K... (flutter/engine#19656)

* f3be9f1 Incorporate compat info changes into flutter engine (flutter/engine#19606)

* 9188ff6 Manual Roll of Dart 707c6404f9...dfdc7e45c5 (flutter/engine#19657)

* cbdd3e2 Roll Fuchsia Mac SDK from Wym-S... to -v4bL... (flutter/engine#19661)

* 6efb152 Roll Dart SDK from 707c6404f969 to 0e25306d3f78 (4 revisions) (flutter/engine#19666)

* 22a440c Roll Dart SDK from 0e25306d3f78 to 6d06476bae6b (1 revision) (flutter/engine#19669)

* 8063923 Roll Fuchsia Linux SDK from GOf1K... to QWI76... (flutter/engine#19671)

* c99deb0 CkPaint uses SkPaint (flutter/engine#19562)

* 015f2ea Use the main bundle if the App bundle is not found (flutter/engine#18749)

* f82d30b Roll Dart SDK from 6d06476bae6b to a9e67d81941a (3 revisions) (flutter/engine#19677)

* 61b2fd2 Roll Fuchsia Mac SDK from -v4bL... to phQJt... (flutter/engine#19681)

* 74b541d Roll Fuchsia Linux SDK from QWI76... to mrlGt... (flutter/engine#19682)

* 25ce3db Roll Skia from c91db040ad18 to e4f36d7ac8f5 (20 revisions) (flutter/engine#19686)

* 162dba1 Roll Skia from e4f36d7ac8f5 to ed15b1c39b8b (1 revision) (flutter/engine#19687)

* f97c38b Roll Fuchsia Mac SDK from phQJt... to kEVc6... (flutter/engine#19688)

* 40c4ee8 Roll Fuchsia Linux SDK from mrlGt... to YfVT0... (flutter/engine#19690)

* ec944b0 Roll Skia from ed15b1c39b8b to 1434ce1aa94d (1 revision) (flutter/engine#19692)

* 7ce988a Roll Skia from 1434ce1aa94d to f64be13cbf84 (2 revisions) (flutter/engine#19695)

* 5f7ca41 Roll Fuchsia Mac SDK from kEVc6... to hRul_... (flutter/engine#19696)

* d24549c Roll Skia from f64be13cbf84 to 041796e60364 (3 revisions) (flutter/engine#19697)

* 617bd88 Roll Dart SDK from a9e67d81941a to fecc8163afc7 (3 revisions) (flutter/engine#19703)

* 8d241e4 [Android] Prevent FlutterRenderer listener from calling JNI after detach (flutter/engine#19558)

* 309e514 Roll Skia from 041796e60364 to d1ce4cb2beb8 (2 revisions) (flutter/engine#19704)

* 211f18e Roll Skia from d1ce4cb2beb8 to 7c1967700b44 (6 revisions) (flutter/engine#19707)

* 0532227 Roll Skia from 7c1967700b44 to 439709a97dfd (8 revisions) (flutter/engine#19712)

* 1e02bfd Support decimal information on the TextInputType (flutter/engine#19664)

* 7a95e32 Linux: Use a hash table to map cursors (flutter/engine#19561)

* df23044 [web] Implement ulps for path ops (flutter/engine#19711)

* 4a3aa4d Fixes typo in android_context_gl.h (flutter/engine#19700)

* 5b966eb Roll Skia from 439709a97dfd to 2604a89d3353 (3 revisions) (flutter/engine#19715)

* d024ae4 [fuchsia] Use memory_requirements_2 extension. (flutter/engine#19678)

* 4392fbf Roll Fuchsia Linux SDK from YfVT0... to 2ct5j... (flutter/engine#19720)

* ab05c79 Roll Fuchsia Mac SDK from hRul_... to ZXLvD... (flutter/engine#19721)

* c05ca7e Roll Dart SDK from fecc8163afc7 to f997d62a6d29 (13 revisions) (flutter/engine#19722)

* ae37971 Remove xcpretty from unit tests to see full output on test failures (flutter/engine#19667)

* 91f80ef Moved to RMSE for image comparison to account for slight variations in golden image tests (flutter/engine#19658)

* 1e23309 Wait for platform view to appear in iOS UI tests (flutter/engine#19725)
mingwandroid pushed a commit to mingwandroid/flutter that referenced this pull request Sep 6, 2020
* 160b268 Set locale in Linux shell (flutter/engine#19470)

* c479b93 Fix documentation of unset platform view ID (flutter/engine#19320)

* f3ab78d Fix clipboard paste functionality not working (flutter/engine#19489)

* 9345347 Added the ability to set properties in interface builder for FlutterViewController. (flutter/engine#19458)

* 69fdf6d Use identical in hashValues instead of operator== (flutter/engine#19615)

* 3dc8163 [android] Pass synthesized eventType to VirtualDisplay platform views and fix memory leak (flutter/engine#19620)

* b16c47d using text capitalization value in web (flutter/engine#19564)

* 49c0161 Roll Skia from 16bf7d31c819 to 4d48bb35972f (32 revisions) (flutter/engine#19635)

* 2d6afa7 Roll Skia from 4d48bb35972f to 9f821489c9f3 (4 revisions) (flutter/engine#19638)

* 35f59b9 Roll Fuchsia Linux SDK from NC9pp... to 5R9a0... (flutter/engine#19639)

* 53038e2 Roll Fuchsia Mac SDK from iwQCA... to Wym-S... (flutter/engine#19640)

* d9e68f4 Roll Skia from 9f821489c9f3 to f8a6b5b4b0d0 (1 revision) (flutter/engine#19643)

* d329617 Changes to fix build errors in google3. (flutter/engine#19616)

* dd0a6c4 Roll Skia from f8a6b5b4b0d0 to 5160e8caa226 (9 revisions) (flutter/engine#19647)

* d98d539 Manual Roll of Dart dfdc7e45c5...06cb010247 (flutter/engine#19649)

* dfd0727 don't throw error for the new autofill request (flutter/engine#19633)

* 39e98d2 Manual Skia roll to c91db040ad18b9cc3236e342e9acca020eaafd10 (flutter/engine#19650)

* f9acd08 Avoid a copy in EncodeImage (flutter/engine#19504)

* 7e101f1 Roll Fuchsia Linux SDK from 5R9a0... to GOf1K... (flutter/engine#19656)

* f3be9f1 Incorporate compat info changes into flutter engine (flutter/engine#19606)

* 9188ff6 Manual Roll of Dart 707c6404f9...dfdc7e45c5 (flutter/engine#19657)

* cbdd3e2 Roll Fuchsia Mac SDK from Wym-S... to -v4bL... (flutter/engine#19661)

* 6efb152 Roll Dart SDK from 707c6404f969 to 0e25306d3f78 (4 revisions) (flutter/engine#19666)

* 22a440c Roll Dart SDK from 0e25306d3f78 to 6d06476bae6b (1 revision) (flutter/engine#19669)

* 8063923 Roll Fuchsia Linux SDK from GOf1K... to QWI76... (flutter/engine#19671)

* c99deb0 CkPaint uses SkPaint (flutter/engine#19562)

* 015f2ea Use the main bundle if the App bundle is not found (flutter/engine#18749)

* f82d30b Roll Dart SDK from 6d06476bae6b to a9e67d81941a (3 revisions) (flutter/engine#19677)

* 61b2fd2 Roll Fuchsia Mac SDK from -v4bL... to phQJt... (flutter/engine#19681)

* 74b541d Roll Fuchsia Linux SDK from QWI76... to mrlGt... (flutter/engine#19682)

* 25ce3db Roll Skia from c91db040ad18 to e4f36d7ac8f5 (20 revisions) (flutter/engine#19686)

* 162dba1 Roll Skia from e4f36d7ac8f5 to ed15b1c39b8b (1 revision) (flutter/engine#19687)

* f97c38b Roll Fuchsia Mac SDK from phQJt... to kEVc6... (flutter/engine#19688)

* 40c4ee8 Roll Fuchsia Linux SDK from mrlGt... to YfVT0... (flutter/engine#19690)

* ec944b0 Roll Skia from ed15b1c39b8b to 1434ce1aa94d (1 revision) (flutter/engine#19692)

* 7ce988a Roll Skia from 1434ce1aa94d to f64be13cbf84 (2 revisions) (flutter/engine#19695)

* 5f7ca41 Roll Fuchsia Mac SDK from kEVc6... to hRul_... (flutter/engine#19696)

* d24549c Roll Skia from f64be13cbf84 to 041796e60364 (3 revisions) (flutter/engine#19697)

* 617bd88 Roll Dart SDK from a9e67d81941a to fecc8163afc7 (3 revisions) (flutter/engine#19703)

* 8d241e4 [Android] Prevent FlutterRenderer listener from calling JNI after detach (flutter/engine#19558)

* 309e514 Roll Skia from 041796e60364 to d1ce4cb2beb8 (2 revisions) (flutter/engine#19704)

* 211f18e Roll Skia from d1ce4cb2beb8 to 7c1967700b44 (6 revisions) (flutter/engine#19707)

* 0532227 Roll Skia from 7c1967700b44 to 439709a97dfd (8 revisions) (flutter/engine#19712)

* 1e02bfd Support decimal information on the TextInputType (flutter/engine#19664)

* 7a95e32 Linux: Use a hash table to map cursors (flutter/engine#19561)

* df23044 [web] Implement ulps for path ops (flutter/engine#19711)

* 4a3aa4d Fixes typo in android_context_gl.h (flutter/engine#19700)

* 5b966eb Roll Skia from 439709a97dfd to 2604a89d3353 (3 revisions) (flutter/engine#19715)

* d024ae4 [fuchsia] Use memory_requirements_2 extension. (flutter/engine#19678)

* 4392fbf Roll Fuchsia Linux SDK from YfVT0... to 2ct5j... (flutter/engine#19720)

* ab05c79 Roll Fuchsia Mac SDK from hRul_... to ZXLvD... (flutter/engine#19721)

* c05ca7e Roll Dart SDK from fecc8163afc7 to f997d62a6d29 (13 revisions) (flutter/engine#19722)

* ae37971 Remove xcpretty from unit tests to see full output on test failures (flutter/engine#19667)

* 91f80ef Moved to RMSE for image comparison to account for slight variations in golden image tests (flutter/engine#19658)

* 1e23309 Wait for platform view to appear in iOS UI tests (flutter/engine#19725)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants