-
-
Notifications
You must be signed in to change notification settings - Fork 230
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
import_css blocks the main thread #296
Labels
Comments
I agree with you. Right now I'm rewriting litebrowser-linux with multithreading support and found the css loading blocks. I'll try to solve this issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To implement the litehtml::document_container::import_css function:
The application has to go out to the network and get the CSS and then at some later time, fill out 'text' with the content. That doesn't work if the network is slow to respond, taking seconds to complete...
A better way of doing it would be to pass a callback for the first parmeter... like:
Then the implementor can go out setup a thread... pass the callback... do the network stuff... get the file... THEN call the callback. Maybe with some extra glue to make it run in the same thread as the caller.
litehtml just waits for the callback and applies the changes. No waiting around.
The text was updated successfully, but these errors were encountered: