[Webkit-unassigned] [Bug 54108] Layout stall waiting for external scripts to load

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 23 13:05:44 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=54108


Silvio <silvio.ventres at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |VERIFIED
         Resolution|WONTFIX                     |REMIND




--- Comment #18 from Silvio <silvio.ventres at gmail.com>  2011-02-23 13:05:44 PST ---
Verified the solution on various websites: it works with no problems with most websites. The only problematic ones are youtube.com and sites which embed youtube movies. Need to check whether it's because of the patch or because of the problems in the current svn code or local flash configuration.

Regarding the general domain-priority patching, a similar solution for image loading can be used to push external-source image/media resources to the end of the queue, making sure tracking-pixels/ads/flash from slow hosts are not making the web browsing miserable.

In any case, here is another proposal, not having to do with domain heuristics:
-
Since the current solution adds a chance of the page not rendering correctly in the end, here's a proposal for a different procedure, which guarantees compliant render output for almost all scripts except ones using document.write.

Instead of deferring externally-hosted scripts, all scripts are considered deferred, and the browser then resolves dependencies via a dependency resolution mechanism:

For each completely loaded script resource:
1. Analyze for function calls and definitions as usual.
2. If all functions are well-defined, the script is executed immediately.
3. Resolve any functions in the "unresolved functions" table using the definitions in the currently-loaded script, and decrement functions_to_be_resolved_until_execution for the scripts using those functions.
4. Schedule any scripts with functions_to_be_resolved_until_execution==0 to run next in queue, and remove them from the awaiting_function_resolution table
5. If undefined function calls are encountered, the function symbols are added into the "unresolved functions" table, and the script is linked to them. Script reference is added to a separate awaiting_function_resolution table with a functions_to_be_resolved_until_execution value specifying the amount of functions to be resolved for script to run, f.e. "8". The script is _not_ executed.

This can also be done with DOM-snapshot rollback mechanism or multithreaded script execution which would probably have lots of race conditions.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list