-
-
Notifications
You must be signed in to change notification settings - Fork 690
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
[widget audit] toga.WebView #1949
Conversation
c0a230f
to
3d2a333
Compare
3d2a333
to
070cf8f
Compare
bcd28cd
to
ee077d1
Compare
ee077d1
to
aa61547
Compare
The Windows tests are hanging in CI, which I've seen locally as well. And there's one failure on Android which I haven't seen locally:
I'll look into both of these tomorrow, but meanwhile any comments on my last few commits would be welcome. |
@mhsmith I've taken a look a the recent changes, merged with main, and pushed a couple of minor docs tweaks. On the whole, there's nothing alarming here. The changes all made sense... eventually. It took me a while to work out what was going on with the My only questions of substance relate to that decorator:
|
:param on_result: A callback that will be invoked when the JavaScript | ||
completes. It should take one positional argument, which is the | ||
value of the expression. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears our editors are fighting with each other over the line length. Can we standardize on 88 columns for both docstrings and code, as we already have in Briefcase (beeware/briefcase#1200)?
OK, done.
You're right about
That just leaves
The "deferred" branch will always be run by the constructor setting the initial values of The "immediate" branch will be run by those tests which involve |
Based on the log timestamps, which you can display with shift-T, it takes about 30 seconds for the WebView to initialize for the first time on Windows, so I've changed the On Android, CI is still getting intermittent hangs associated with the message "Cannot read property 'innerHTML' of null". I can't reproduce this locally, and making the timeout longer doesn't do anything except make the test hang for longer before it times out. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the tests are now passing, but I've just kicked off a re-run to be extra careful. Assuming that passes too, I'm OK for this to be merged.
Looks good to me. Nice work hunting the CI failures - they're painful to find at the best of times, and the 24 minute runtime for Android tests doesn't help. |
FYI: there's still one intermittent failure in the merged version:
This is because |
Audit of the WebView widget.
Includes a number of backwards incompatible cleanups:
on_key_down
handler; there are better places to catch key input if it is neededget_dom()
method; this wasn't working on any platform since the move to WKWebView, and doesn't appear to be easily implemented using native APIs.evaluate_javascript()
to return an AsyncResult object, and accept anon_result
callback. This makes javascript evaluation similar to dialog handling - in a synchronous context you can throw the javascript over the wall and get a functional callback; in an async context, you can await the result.invoke_javascript()
method. It's now satisfied byevaluate_javascript
file://
URLs, since WKWebview makes them effectively impossible anyway.Audit checklist