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

Posted by PJ on Dec 28, 2006 | Comment |

**UPDATE:** The idea expressed below has been significantly improved and a brief spec document and example [is now available][1]. You might, however, still want to read what follows before proceeding to the aforementioned link. Almost two years ago, in an attempt to combat the rising problem of comment spam, [Google unveiled a new HTML attribute][2]: `rel=”nofollow”` By including that attribute in hyperlinks, website administrators direct search engines not to give any credit to the linked content. The attribute is generally applied by most blog software to comment and trackback content before it is posted. This obviously minimizes the incentive for comment spamming as a means of improving a site’s PageRank status. In the same spirit, I am now proposing a new attribute: `rel=”nsfw”` NSFW is an abbreviation often used to indicate that content is “not safe for work.” This new attribute should be applied to tags to indicate that the content is potentially “not safe for work.” The attribute has several exciting implications for content creators and site visitors: 1. Content creators can now apply the attribute to **hyperlinks**. Visitors will be able to configure their browsers to warn them, or stop them, before continuing on to URIs flagged with the attribute. Additionally, search engines will be able to use the proportion of flagged links to a URI as a better means of filtering results. 2. Content creators can now apply the attribute to **image tags**. Visitors will be able to configure their browsers to block display of images flagged with the attribute. 3. Content creators can apply the attribute to **paragraph tags**, **div tags**, or any other **block-level element**. Doing so will indicate that the enclosed content is not safe for work. Visitors will be able to configure their browsers to block display of just the content enclosed by the flagged block-level element. This isn’t about censorship. It is about making us all less likely to accidentally click on a goatse.cx link when our boss is standing behind us. It is also about making us feel more comfortable posting possibly objectionable content by giving visitors a means of easily filtering that content. So who wants to write the first Firefox extension? **ADDITIONAL UPDATE:** Looks like [Chris Granade][3] had the same idea a while back, but his blog post pretty much restricted the idea to hyperlinks instead of all HTML tags. [Here][4] is a Greasemonkey script written by Jeremy Dunck that will block links marked with rel=”nsfw” We still need something more robust that will support other tags in some sensible way. [1]: http://pj.doland.org/archives/041577.php [2]: http://googleblog.blogspot.com/2005/01/preventing-comment-spam.html [3]: http://cgranade.blogspot.com/2006/02/not-safe-for-work-case-for-new.html [4]: http://userscripts.org/scripts/source/3313.user.js

links for 2006-12-26

Posted by PJ on Dec 26, 2006 | Comment |

links for 2006-12-23

Posted by PJ on Dec 23, 2006 | Comment |

links for 2006-12-22

Posted by PJ on Dec 22, 2006 | Comment |

links for 2006-12-17

Posted by PJ on Dec 17, 2006 | Comment |

links for 2006-12-16

Posted by PJ on Dec 16, 2006 | Comment |

links for 2006-12-14

Posted by PJ on Dec 14, 2006 | Comment |

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.

Posted by PJ on Dec 14, 2006 | Comments Off |

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!

Posted by PJ on Dec 14, 2006 | Comments Off |

links for 2006-12-06

Posted by PJ on Dec 6, 2006 | Comment |

  •  
  •