-
Notifications
You must be signed in to change notification settings - Fork 149
Open
Labels
Description
Simply downloading and injecting a CSS file into the DOM will break fonts and images referenced by a relative URL. This is because relative URLs within a <link>ed stylesheet are resolved against the URL of the CSS resource, but all resources in a <style> element are resolved against the URL of the document.
After downloading and before injecting the CSS, a processing step has to be introduced that scans the document for url("") and @import ""; occurrences and resolves relative paths against the stylesheet's URL.
Depending on URI.absoluteTo() for the heavy lifting may seem convenient, but adds way too much to the file size. The DOM URL interface is not available on iOS 7.
Reactions are currently unavailable