Archives for December 2006
by PJ Doland and Jack Shedd ### The Problem With REL. In [an earlier post][1], we recommended the use of the REL attribute for indicating that content was “not suitable for work.” The REL attribute has obvious benefits: * REL isn’t widely (or even sparsely) implemented. With the notable exception of Google’s use of REL for it’s ‘nofollow’ tag, it is difficult to think of a user-agent that actually does anything with the REL attribute. * REL was designed to specifically indicate a destination anchor’s relation to a source anchor. * REL allows for user-definable types, making it simple to extend. However, there are several problematic issues that might make us question our decision to use the REL attribute as a means of indicating that content is “not suitable for work”: * REL is not a global attribute. It applies only to A elements. Using it elsewhere would be a violation of the specification. * REL, semantically, is an indication of the destination anchor’s properties. The REL attribute does not apply to the content inside the A tags that enclose it. * The attribute selector of the CSS 2.1 specification is not widely supported in web-browsers (i.e IE6). This would make styling the elements problematic. When taken as a whole, we can easily see that our original implementation would be functionally limited to A elements only. This would restrict an author’s ability to style and mark other types of content he might deem “not suitable for work.” ### Have Some Class Numerous commenters pointed out that the CLASS attribute may be a better choice for the NSFW tag. The CLASS attribute has several advantages: * CLASS is a global attribute, applicable to any element. * CLASS is widely supported by browsers as a CSS selector. * CLASS allows for user-definable types, making it simple to extend. However, it has a fairly significant semantic failing: * CLASS indicates qualities pertaining to the content _within_ the tags it extends. It does not extend other attribute values–particularly, the HREF attribute. For the idea to really work well, authors will need a way to mark destination anchors as possibly offensive. If we rely on CLASS alone we fail to be semantically accurate. ### Just Use ‘em Both Imagine a paragraph, much like this paragraph. Within that paragraph we link to a [pornographic][2] website. Before NSFW, the source for the paragraph above would look something like: `Imagine a paragraph, much like this paragraph. Within that paragraph we link to a pornographic website.` Using just the CLASS attribute, we can transform our source into: `Imagine a paragraph, much like this paragraph. Within that paragraph we link to a pornographic website.` The problem lies with the word _pornographic_. The word, itself a child of the A element, isn’t NSFW at all. It’s a perfectly wholesome word. The objectionable portion is the destination anchor of the A element. We need a way to tell our visitor’s user-agent that the concern is the destination link. Using an NSFW REL attribute would do just this. `Imagine a paragraph, much like this paragraph. Within that paragraph we link to a pornographic website.` But limiting our solution to REL is short-sighted. `Imagine a paragraph, much like this paragraph. Within that paragraph we link to a giant penguin cock website.` The phrase “giant penguin cock” is bound to offend _someone_. The destination anchor itself is harmless. Semantically, we want to let our visitor’s user-agent know that within our A element, the user may encounter a word, or phrase, or paragraph, or image, that is NSFW. REL would be the incorrect attribute under that scenario. CLASS would work much better. `Imagine a paragraph, much like this paragraph. Within that paragraph we link to a giant penguin cock website.` And of course, we could also… `Imagine a paragraph, much like this paragraph. Within that paragraph we link to a giant penguin cock website.` Now everything about that element is offensive (and appropriately marked). ### Implementation! Unfortunately, browser developers are often slow to implement new ideas. How can we make use of this impromptu standard now? In the case of inappropriate content, the solution is simple. We can just ask the browser to hide the child elements from the user. We will leave the portion of the layout where those elements would appear blank. This way the user knows that something has been hidden. `.nsfw { visibility:hidden; }` Or, we could force the element to be completely removed from the layout, leaving no indication it ever existed: `.nsfw { display:none }` REL is trickier. The CSS 2.1 specification outlines the syntax for an [attribute selector][3]. In theory, we should be able to write a simple CSS rule much like our CLASS examples above. `*[rel=nsfw] { visibility:hidden; }` `*[rel=nsfw] { display:none }` Safari 2, Firefox, Opera 9 and IE7 all support the above CSS rule. IE6 does not. We’ll need a cheap javascript routine to enable support in IE6.
links for 2006-12-28
-
Best line from Episode 3: “We figure we’ve got about three months before they sue us for using the characters.”
links for 2006-12-26
-
Good to see Kodak acknowledging that APS sucks.
links for 2006-12-23
-
It’s funny because it’s true. Listen through the ending.
links for 2006-12-22
-
I wonder if ZFS will end up replacing HFS+ as the default filesystem.
links for 2006-12-17
-
Before you crack open that Mac Mini to upgrade the RAM, watch one of these.
links for 2006-12-16
-
Very well written. You’ll laugh so hard you’ll cry.
links for 2006-12-14
-
Wherein Wil weighs in over the MacHeist shareware-bundle controversy.
Yes, THAT James Watson
In an interview for this January’s issue of Esquire, James Watson made several interesting remarks.
These remarks can easily be separated into two distinct groups. The first group consists of statements that are interesting because they are fresh and insightful. The second group, by contrast, consists of statements seemingly crafted to convey Mel Gibson batshit-craziness.
From the first group:
I’m basically a libertarian, I don’t want to restrict anyone from doing anything unless it’s going to harm me. I don’t want to pass a law stopping someone from smoking. It’s just too dangerous. You lose the concept of a free society. Since we are genetically so diverse and our brains are so different, we’re going to have different aspirations. The things that will satisfy me won’t satisfy you. On the other hand, if global warming is in any way preventable and it’s likely to come, not doing something would be irresponsible to the future of our society.
From the second group:
Should you be allowed to make an anti-Semitic remark? Yes, because some anti-Semitism is justified. Just like some anti-irish feeling is justified.
Now just to be clear, I would agree that you should be allowed to make anti-Semitic remarks. I just wouldn’t defend a right to free speech by arguing the validity of such statements. Don’t worry though–Watson also has some kind words for the Jews:
I’ve wondered why people aren’t more intelligent. Why isn’t everyone as intelligent as Ashkenazi Jews?
Note his need to exclude Sephardi Jews. Always the geneticist.
Take the Google Challenge
We are here at the Internet, where we’ve secretly replaced the US patent database they usually serve with Google. Let’s see if anyone can tell the difference!
links for 2006-12-06
-
Anatomical models of the skeletal structures of cartoon characters.