Hacker News new | past | comments | ask | show | jobs | submit login

the developers of WebKit added the prefix -webkit to the experimental stylesheet declarations. This ensured they worked only in WebKit.

No. This ensured that they didn't pollute the global namespace with experimental, partially-implemented ideas. If Mozilla, Opera, and Webkit each make e.g. "rounded-rect" declaration, and one browser takes the width as the first argument while another takes the radius first, then we're screwed. At least having "-moz-rounded-rect" and "-o-rouded-rect" means developers know how their pages will behave in each browser. I agree that the W3C is unacceptably slow, but that doesn't mean prefixes are a terrible idea.




What I still don't understand is why the global namespace isn't used straight away.

You could, for example, just use one line of css for border-radius for all browsers. If one vendor does it differently you use their vendor specific namespace to override it. Surely that makes more sense than having to do a line of css for every vendor?


I support this methodology. Have the globally-namespaced attribute already function, but give the vendor-specific one precedence. That way the developer only has to add vendor-specific declarations for the minority that implements it differently.


But if there's no standard, then how do you know which behavior to expect in the "global" case and which ones should be vendor-specific? And if only one browser experimentally implements a new feature, should you use the vendor-specific namespace for it, or hope that all future implementations in other browsers are the same?


Just to clarify I'm not suggesting there should be no standard, there definitely should be.

However for the initial implementation what's wrong with survival of the fittest? The most popular way will win through, which would most likely become standard. For those browsers that don't implement it in the same way you use their vendor specific namespace instead.

Yes it's likely to be hairy when it's first being put to use if browsers have slightly different implementations but no more so than using an experimental tag in the first place.

The difference appears to me to be that for the next five+ years I could be writing 8 lines of basically the same css for every instance of linear-gradient (and that's assuming we don't get any new browser vendors in the coming years) vs writing 2-4 lines with backwards compatibility or shock maybe even 1 line if I didn't care about older browsers (e.g. http://www.colorzilla.com/gradient-editor/).


Exactly. The vendor prefixes are a compromise. The majority of the time the prefixes are used to implement features which have been proposed (but haven't been ratified) now.


I think if features are standardized, the economy in typing alone will force the vendor-specifics away. Just a phase that (CSS) standards might go through.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: