alisx: A demure little moth person, with charcoal fuzz and teal accents. (Default)
Alis ([personal profile] alisx) wrote in [site community profile] dw_suggestions2010-03-22 08:38 am

Support for @import and @font-face

Title:
Support for @import and @font-face

Area:
styles

Summary:
Update the CSS cleaner to support modern CSS, including the @import and @font-face directives.

Description:
The current CSS cleaner is overly-restrictive in what directives it supports, which makes designing modern layouts unnecessarily difficult.

In particular, the @import and @font-face directives should be supported (at the current time they are stripped out). The former allows for clarity and organisation of code for designers (as well as the use of well-known frameworks and reset styles), while the latter is becoming a staple of "Web 2.0" design.

While care still needs to be taken to protect against malicious XSS attacks, the @import and @font-face directives in-and-of themselves wouldn't seem to be any more dangerous to users than, for example, background-url (which can also be used to import foreign data).

Poll #2513 Support for @import and @font-face
Open to: Registered Users, detailed results viewable to: All, participants: 32


This suggestion:

View Answers

Should be implemented as-is.
11 (34.4%)

Should be implemented with changes. (please comment)
1 (3.1%)

Shouldn't be implemented.
0 (0.0%)

(I have no opinion)
20 (62.5%)

(Other: please comment)
0 (0.0%)

foxfirefey: A guy looking ridiculous by doing a fashionable posing with a mouse, slinging the cord over his shoulders. (geek)

[personal profile] foxfirefey 2010-03-22 12:17 am (UTC)(link)
I think font-face is easily doable, and there's a post about best practices here: http://layoutmakers.dreamwidth.org/5590.html

We'll have to make some changes in where the CSS comes up in S2, I think, for the best results.

@import is a lot harder, I think, because the imported CSS can't be directly imported, but has to be redirected through the CSS cleaner. I think it might be possible to do, though, with a bit of work.
mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)

[staff profile] mark 2010-03-22 07:13 am (UTC)(link)
If you can find a way to launch an XSS attack on Dreamwidth, please email me -- I want to talk to you.

As to the CSS cleaner, I was there when it was written. We were having some serious issues with browsers (particularly IE6 with its inability to properly handle JS in many cases) getting repeatedly destroyed by various things that you could do in CSS.

User safety is paramount. I'd rather have a site that isn't super snazzy and yet protect people's privacy and their computers than have one that's got all the latest bells and whistles and have to deal with people getting exploited every day.
denise: Image: Me, facing away from camera, on top of the Castel Sant'Angelo in Rome (Default)

[staff profile] denise 2010-03-22 02:35 pm (UTC)(link)
Trust me, the exploits we're defending against have been repeatedly actualized in the Really Real World on LJ, and there are plenty of people who are still trying them against us.
exor674: Computer Science is my girlfriend (Default)

[personal profile] exor674 2010-03-22 06:42 pm (UTC)(link)
@import would have to go through the cleaner, as described above. Will also have to look into @font-face, make sure there are no known exploits with bad fonts/not fonts/other URIs.

Barring that, I'm +1
mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)

[staff profile] mark 2010-03-22 09:48 pm (UTC)(link)
Most of the exploits ended up with compromised cookies. This can lead to someone impersonating you and deleting your content, pretending to be you, or just invasion of your privacy when they read your protected content.

I'm not a fan of compromising usability either, and sometimes we'll make concessions in that direction if the needs are dire. But when it comes down to it, I still think I'd rather have a safe site.
foxfirefey: A fox colored like flame over an ornately framed globe (Default)

[personal profile] foxfirefey 2010-03-23 06:25 pm (UTC)(link)
@import is not technically impossible! I think we could modify the cleaner to accommodate it by replacing the url with a URL that goes through the cleaner. It might be a little performance hit, but I think it could work.