From 60032dde3903bef083092c4ca9e22d1e53a4c52f Mon Sep 17 00:00:00 2001 From: David Iglesias Teixeira Date: Wed, 9 Dec 2020 17:24:54 -0800 Subject: [PATCH 1/2] Do not reset 'cursor' in PersistedPlatformView. --- .../lib/src/engine/html/platform_view.dart | 1 + .../engine/surface/platform_view_test.dart | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/lib/web_ui/lib/src/engine/html/platform_view.dart b/lib/web_ui/lib/src/engine/html/platform_view.dart index c5bb82a6aa3aa..5987fe2f840d1 100644 --- a/lib/web_ui/lib/src/engine/html/platform_view.dart +++ b/lib/web_ui/lib/src/engine/html/platform_view.dart @@ -44,6 +44,7 @@ class PersistedPlatformView extends PersistedLeafSurface { _styleReset.innerHtml = ''' :host { all: initial; + cursor: inherit; }'''; _shadowRoot.append(_styleReset); final html.Element? platformView = diff --git a/lib/web_ui/test/engine/surface/platform_view_test.dart b/lib/web_ui/test/engine/surface/platform_view_test.dart index c806d67658a78..9bb4bd56c8be3 100644 --- a/lib/web_ui/test/engine/surface/platform_view_test.dart +++ b/lib/web_ui/test/engine/surface/platform_view_test.dart @@ -67,6 +67,18 @@ void testMain() { expect(view.canUpdateAsMatch(anyView), isFalse); }); }); + + group('createElement', () { + test('adds reset to stylesheet', () { + final element = view.createElement(); + _assertShadowRootStylesheetContains(element, 'all: initial;'); + }); + + test('creates element transparent to "cursor" property', () { + final element = view.createElement(); + _assertShadowRootStylesheetContains(element, 'cursor: inherit;'); + }); + }); }); } @@ -86,3 +98,14 @@ Future _createPlatformView(int id, String viewType) { ); return completer.future; } + +void _assertShadowRootStylesheetContains(html.Element element, String rule) { + final shadow = element.shadowRoot; + + expect(shadow, isNotNull); + + final html.StyleElement style = shadow.children.first; + + expect(style, isNotNull); + expect(style.innerHtml, contains(rule)); +} From 1a7410543a9679222ab5ce1132657df0a5e1a727 Mon Sep 17 00:00:00 2001 From: David Iglesias Teixeira Date: Wed, 9 Dec 2020 17:25:15 -0800 Subject: [PATCH 2/2] Document Invalid kernel binary format version felt error solution. --- lib/web_ui/dev/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/web_ui/dev/README.md b/lib/web_ui/dev/README.md index 50c70a54ab722..309ca9a28c80c 100644 --- a/lib/web_ui/dev/README.md +++ b/lib/web_ui/dev/README.md @@ -165,3 +165,17 @@ Some useful links: 2. Browser and driver CIPD [packages](https://chrome-infra-packages.appspot.com/p/flutter_internal) (Note: Access rights are restricted for these packages.) 3. LUCI web [recipe](https://flutter.googlesource.com/recipes/+/refs/heads/master/recipes/web_engine.py) 4. More general reading on CIPD packages [link](https://chromium.googlesource.com/chromium/src.git/+/master/docs/cipd.md#What-is-CIPD) + +## Troubleshooting + +### Can't load Kernel binary: Invalid kernel binary format version. + +Some times `.dart_tool` cache invalidation fails, and you'll end up with a cached version of `felt` that is not compatible with the Dart SDK that you're using. + +In that case, any invocation to `felt` will fail with: + +`Can't load Kernel binary: Invalid kernel binary format version.` + +The solution is to delete the cached `felt.snapshot` files within `engine/src/flutter/lib/web_ui`: + +**`rm .dart_tool/felt.snapshot*`**