After playing cat-and-mouse with webkit for a year, I'm thinking it's time to throw in the towel.
The Webkit committers keep changing their stylesheet loading algorithm. Each time they do, I have to struggle to find a way to ensure that curl's css! plugin doesn't call back to waiting modules before the associated stylesheet's rules are applied to the document. (Devs may want this feature if they have written code that relies on css rules in order to compute something like element1.offsetHeight + element2.offsetHeight.)
To be clear: we can still detect and wait for *onload* to fire in Webkit browsers. The issue is that in Webkit (and only Webkit) the onload event sometimes fires *before* the css rules have been applied to the document. All other browsers fire onload after the rules have been applied.
To be fair to the Webkit folks, the w3c spec implies that the onload event only needs to wait for the stylesheet to be loaded. Nothing more than that.
I doubt too many people are relying on the rules being applied before the plugin calls back to waiting modules. My reasoning: only 1 person has complained since Aril 2012 when they really started breaking things. I think we can suggest a work-around for people who need to wait for the css rules. One possible work-around is to periodically check if a property of an element in the dom changes to an expected value.
Also: relying only on onload also simplifies the cram css! plugin, as well.
Any objections? Thoughts?