What is needed in some ability to identify the extension, so that the user may substitute their own, or may want to cache it instead. This would also improve speed, since it can avoid download it for each separate web page, and can also substitute a native code implementation.
Not bad an idea at all! Hadn't considered bytecodes for layout algorithms, though I guess it would work with regular js as well, and I AFAICS Project Houdini is about providing the necessary core rendering API.
Yet it has WebVM instead of JS. WebVM is a virtual machine similar to JavaVM but with DOM, CSSOM and layout APIs exposed in it as a runtime.
So if some site needs flexbox in its CSS then it can be included as:
If JS then and so on.This would allow a) keep browser small and maintainable and b) open room for innovations in Web technology beyond browser vendors and comities.
As an example: TypeScript can be compiled to WebVM bytecodes instead of JS.