未验证 提交 50d830a1 编写于 作者: D David Iglesias 提交者: GitHub

[web] Do not reset 'cursor' in PersistedPlatformView. (#22977)

上级 16469661
......@@ -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*`**
......@@ -44,6 +44,7 @@ class PersistedPlatformView extends PersistedLeafSurface {
_styleReset.innerHtml = '''
:host {
all: initial;
cursor: inherit;
}''';
_shadowRoot.append(_styleReset);
final html.Element? platformView =
......
......@@ -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<void> _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));
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册