Slashdot HTML 4.01 and CSS
After 8 years of my nasty, crufty, hodge podged together HTML, last night we finally switched over to clean HTML 4.01 with a full complement of CSS. While there are a handful of bugs and some lesser used functionality isn't quite done yet, the transition has gone very smoothly. You can use our sourceforge project page to submit bugs and we'd really appreciate the feedback. Thanks to Tim Vroom for putting the HTML in place, Wes Moran for writing the HTML in the first place, and Pudge for writing the code to convert
900k users, 60k stories, and 13 million comments to comply. And for the brave, download the stylesheet and start experimenting with new themes and designs for Slashdot: some sort of official contest to re-design Slashdot is coming soon, so you can get a head start now.
Response to some reader notes in the forum:
- There are a handful of validation errors. Some will be fixed in the next day or so. Others are external HTML that is out of our hands. We may never toally validate with zero errors. yes we're comfortable with that.
- We're not going to XHTML for the same reasons as above- we control almost all of our HTML, but some of it (like the ads, and imports from other sites) just isn't ours to muck about with. We could go to XHTML, and someday we might, but today we're happy to just get to HTML 4.01 and CSS.
- Light Mode will be back in some form or another. The problem is that light mode served two purposes: Low Bandwidth, and Simplified Design. The later will probably be handled with a CSS theme (we have a handheld theme already). Low Bandwidth is a little trickier, but we will resolve that soon.
- All of our code is beta tested on www.slashcode.com and use.perl.org. Unfortunately there's always a few issues from those tiny tiny sites and the giant bohemoth that is Slashdot itself.
I was wondering if there was going to be a story on this. I noticed the upgrade last night. Let me be the first (post? ha ha) to say, "Good job guys!" Yeah. it took you awhile. But better late than never, eh?
:-)
/team!
And for the brave, download the stylesheet and start experimenting with new themes and designs for Slashdot:
I was just going to ask if we could get a few more CSS styles like we saw in the Beta. Glad to see you're already on top of it.
I did some testing with a FireFox version I *know* contains the infamous "Slashdot bug". (Not sure if it's corrected in recent versions since I normally use Mozilla or Safari.) As far as I can tell from testing, the bug is completely fixed. Considering the upgrades, one would expect this to be the case, but you can never be too sure.
Last but not least, the "Politics" and "Apple" sections look as nice as ever, but I'm afraid that the other sections look worse than ever. Can we turn off the colors for the other sites until better CSS sheets can be made? (Preferrably ones that don't hurt our eyes?) Yeah, the games section has the full treatment too, but I swear that the shades of purple it uses are causing me to go blind.
An alternative solution to turning off the CSS for the other sections is to provide the front page CSS as a style option on all the pages. That way we could simply shut off the crazy colors without pulling the whole "games.slashdot.org/article.pl -> slashdot.org/article.pl" trick.
Well, that's my 3.14159265 cents worth. Again, good job
Javascript + Nintendo DSi = DSiCade
Yes, and for those of us using "Light" slashdot version (it's in "Preferences" - white background etc, _much_ easier to read IMHO) now it looks like a buttload of shit. $(SUBJ). Will it be fixed?
You mean like this site that has been acting as the beta site for Slashdot?
Javascript + Nintendo DSi = DSiCade
Why don't you guys have a formal testing process in place for slashcode?
They do. Beta code gets tested here before it's put on Slashdot. Now the upgrade process often generates quite a few 503s (since Slashdot is actually down during that time), but it's just a temporary problem.
If you're still getting 500s and 503s, try deleting all your cookies that point to "slashdot.org". Sometimes the upgrades have problems with old cookies.
Javascript + Nintendo DSi = DSiCade
These are the ones I could find in the head:
http://images.slashdot.org/base.css
http://images.slashdot.org/comments.css
http://images.slashdot.org/ostgnavbar.css
http://images.slashdot.org/slashdot.css
http://images.slashdot.org/print.css
http://images.slashdot.org/handheld.css
Long signatures suck.
I think you mean Augean stables.
l
http://www.perseus.tufts.edu/Herakles/stables.htm
No but, yeah but, no but...
Wow, this looks NICE. You guys needed to go to CSS for a LONG time.
Now, how 'bout taking a cue from AvantSlash, and making http://slashdot.org/palm actually work nicely?
AvantSlash is horribly broken, now, due to your changes (although I knew it was coming, and so did they.) So, one of two things needs to happen: the guy behind AvantSlash needs to update it, or you guys need to make the Palm site work.
Because.
There are 11 types of people in the world: those who can count in binary, and those who can't.
Most die-hard firefox users will know this, but since Taco threw down the gauntlet, those mere firefox mortals who wish to muck with the CSS and "win a prize!" can take a look at: Jesse Ruderman's page on using local style sheets (good links there) and there's always the style sheet chooser plus add on (yeah, the site's in French and I haven't tried that extension in a while since I use Safari mostly, but it should work).
Mind the gap...
I let someone else explain this one, but basically you should be using html 4.01 and not xhtml unless you really know what you are doing and have good reason to do so.
http://hixie.ch/advocacy/xhtml
"In a time of universal deceit - telling the truth is a revolutionary act." - George Orwell
http://images.slashdot.org/base.css
http://images.slashdot.org/comments.css
http://images.slashdot.org/ostgnavbar.css
http://images.slashdot.org/slashdot.css
http://images.slashdot.org/print.css
http://images.slashdot.org/handheld.css
my sig's at the bottom of the page.
Because XHTML is harder to write, and browsers can render HTML fine anyway, so what's the point? Yes, XHTML makes a cleaner spec if you're starting from nothing, but HTML is a standard that browsers have to be able to render, so XHTML doesn't make things any easier for anyone.
I am trolling
This topic was done to death last time.
Short summary: there are a few compatibility downsides and there's no real point because there's no benefit to using XHTML yet.
Bogtha Bogtha Bogtha
...get the following fixed? When you browse with a threshold that doesn't show all comments, the page numbers to click are completely broken. Sometimes, when I click on the 3rd or 4th page, I _still_ see the first post according to my threshold.
There is actually no way to view all comments in order. I usually resort to clicking a page way later, like the 6th or 7th until I see a comment other than the first. But then I don't know if I missed any.
The pages seem to count all comments regardless of score. The proper way is to count the posts _after_ the threshold is applied.
This has been bugging me _for ages_!
Of course it runs NetBSD. BTC: 1NT7QvbetmANwaMzhpVL6
W3C is perfectly stable, its taking issue with your non-quoted href attributes. Look at error # 12: "an attribute value must be a literal unless it contains only name characters."
As a general rule, quote all attributes, much more future-proof (XHTML requires all attributes be quoted), and much easier on the eyes when using a syntax-highlighting editor. FYI, I downloaded a snippet of your HTML, quoted the attributes, ran it back through the validator, and it validates (save for the lack of a doctype).
Hope this helps.
When in doubt, don't assume the bug is somebody else's fault unless you understand what's going on.
HTML, as you know, lets you omit the delimiting quotes for attribute values sometimes. For example, type=text is valid. However, just because you can omit them sometimes, it doesn't mean you can always omit them. Your page contains the following code:
The validator is saying that you have a closing </a> tag when you don't have an open <a> element. That is correct - you already closed the <a> element.
See, in order to provide us with the shortcut of not having to specify attribute names for some purposes (e.g. <input disabled>), HTML uses an SGML feature known as SHORTTAG NET. However, that's not the only shortcut it provides. It also lets you write <foo>bar</foo> as <foo/bar/.
Of course, I've only heard of one or possibly two browsers that have ever implemented this, so I'm not surprised that you haven't heard of it. In any case, one of the consequences of this shortcut is that you can't use slashes in attribute values unless you quote them - otherwise the parser has no way of knowing whether you are closing the tag or not. So when you write:
That has exactly the same meaning as this:
So, later on, when you try and close your <a> element, the validator rightly complains that there's no open <a> element to close.
If you actually find a real bug in the validator, then feel free to report it. If you had done this with the "bug" you are complaining about, then you would have found the answer to the problem a lot quicker.
It might be worth actually fixing this one, as I've seen some search engine bots trip over on similar things (XHTML-style empty meta elements in HTML documents, etc), so you might be preventing some search engine bots from indexing anything but the front page of your website.
Bogtha Bogtha Bogtha
Version 8.5
Build 7700
Platform Win32
System Windows XP
Mainframe/UNIX Bit Twiddler and long time Windows/Linux Hobbyist.
The Theorem Theorem: If If, Then Then.
I explained the bug. I didn't think I was doing such a bad thing. I will look into updating it with my info.
Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
HTML 4.01 was released on December 24, 1999, so they're not quite here yet...
I am TheRaven on Soylent News
You're in Light Mode. Slashboxes don't appear in Light Mode for obvious reasons (and I believe that's a change from before). Go to Preferences: Homepage and uncheck Light, then save. That should do the trick.
Validate Slashdot's Coral Cache! http://slashdot.org.nyud.net:8090/
:P )
t tp%3A%2F%2Fslashdot.org.nyud.net%3A8090%2F&charset =(detect+automatically)&doctype=Inline&ss=1
..." color="#006666"><b>Search Freshmeat:</b></font><br>
...gif?l,332" width="1" height="1" border="0" alt="">
...idth="1" height="1" border="0" alt="">
:D to keep the errors hidden. muahahahaha.
Anyway here's the Coral Cache of the W3C validating the Coral Cache of Slashdot! (can't get any longer than that
http://validator.w3.org.nyud.net:8090/check?uri=h
And here's the result:
1. Line 18, column 40: there is no attribute "LANGUAGE" .
<script type="text/javascript" language="javascript" src="http://a.as-us.falkag.
2. Line 303, column 25: there is no attribute "ALIGN" .
<div class="ad2" align="center"><!-- ad position 2 -->
3. Line 637, column 11: there is no attribute "SIZE"
<font size="3" color="#006666"><b>Search Freshmeat:</b></font><br>
4. Line 637, column 21: there is no attribute "COLOR" .
<font size="3" color="#006666"><b>Search Freshmeat:</b></font><br>
5. Line 637, column 30: element "FONT" undefined
<font size="3" color="#006666"><b>Search Freshmeat:</b></font><br>
6. Line 637, column 65: document type does not allow element "BR" here; missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV", "ADDRESS" start-tag .
7. Line 638, column 54: document type does not allow element "INPUT" here; missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV", "ADDRESS" start-tag .
<input type="hidden" name="link" value="freshmeat.net">
8. Line 639, column 27: document type does not allow element "INPUT" here; missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV", "ADDRESS" start-tag .
<input type="text" name="q">
9. Line 640, column 6: end tag for "FORM" which is not finished .
</form>
10. Line 641, column 9: there is no attribute "ALIGN" .
<p align="right"><a href="http://freshmeat.net/"><b>More Meat...</b></a>
11. Line 1339, column 78: there is no attribute "BORDER" .
12. Line 1339, column 88: document type does not allow element "IMG" here; missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "DIV", "ADDRESS" start-tag .
13. Line 1340, column 10: end tag for "NOSCRIPT" which is not finished .
</noscript>
(Hmmm weird, the next time i ran the validation it only gave me 12 errors). Anyway, that's all - considering slashdot used to have around 300 errors, this is quite an advancement. The first errors are probably a missing opening <form> tag.
A workaround (tho I don't know how effective) would be replacing the freshmeat data with an IFrame
You don't need an extension for that, you can just put it in userContent.css.
@-moz-document domain(slashdot.org){rules here)
...Though I suppose you could package it as an extension to make it easier to install.
There are 11 types of people in the world: those who can count in binary, and those who can't.
Internet Explorer 6 does not accept application/xml+xhtml documents. Internet Explorer 7 will not accept them.
If you're going to set up your web application to spit out XHTML , except when the client only Accepts: text/html, then you might as well just serve text/html to everyone and ditch the added complexity.
Those are simply empty tags in XHTML, but in HTML4 (and any other SGML application using the Reference Concrete Syntax) they are empty tags followed by ">" characters treated as content. Some browsers get this wrong, but it's not a good idea to rely on it. No matter what W3C claims, it's not really possible to modify a document so a HTML4 parser gives the same DOM as an XML parser--the grammars conflict.
The thing is that Slashdot is now natively readable from within Lynx or Links (only with they put some kind of link on top of the page pointing to the content itself, having to go through 5 pages of menu before actually reaching the content is annoying)
"The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
The plan right now is to have a few large chunks of the site drop in and out for a less bandwidth intensive version. Essentially we strip the site down to what must be here: Less menu items, less boxes on the right. Basically, "Title" "Advertisement" "Stories" "Some Menus And Links". VERY minimal. Get the page down to as few bytes as possible. This We'll probably have a stylesheet too, but mainly this page will just have far fewer bytes of stuff.
Design-wise we can create themes for modern handhelds. A generic theme is already available but it's a real quickee job. But now we can create thinned down look and feel customized for any individual handheld. Of course we don't really have any of these fancy devices ourselves, so hopefully readers will help by designing CSS that does just that.
Pants are still optional, but recommended for you.
"Edit Comment"
:-)
Surely thats a bug. We can't edit comments posted.
No bug. It's not a button, it's the subtitle of the "Post Comment" page. It's referring to the area where you "edit" the "comment" your about to post. See? Makes perfect sense.
Javascript + Nintendo DSi = DSiCade
There is no reason to go to XHTML. Bottom line: most browsers will render it as HTML and not XML, and for those that do render it as XML, we would need to have *perfectly valid* XML or else it would break, and we are not yet at that point, as we still have various invalid things in our source. So there's no reason to bother, not any time soon.
The code can easily handle a switch to XHTML 1.0 Strict, should we someday desire to do that.
We already forced HTML 4.01 strict compliance on comments six months ago. Almost no one noticed.
We already converted 13M comments to valid HTML 4.01 strict. A couple of months ago. No one noticed.
It would be relatively trivial to force XHTML 1.0 strict compliance. I'd flip a switch to force compliance on new content, then rerun the converter for old content. The code's been tested to work for both HTML 4.01 strict and XHTML 1.0 strict (since we allow only a relatively small subset of HTML tags and attributes, this isn't that hard for comments, or even stories, which allows a lot more variety in tags, but everything still fits in the intersection of the two, so it's just a matter of changing a very few number of things, that the code already knows about).
I've read this rant a few times now, and of all of his reasons, none are very compelling.
.toUpperCase() or .toLowerCase() when checking tag names, and you have to be able to detect whether to use namesapace aware functions or not based on which mime type you are using. Also, for sites (like slashdot) that don't use much javascript, this is probably not really an issue.
/>" have very different semantics when parsed as HTML4. So if there was to be a fully compliant HTML4 UA, it would be quite correct to show ">" characters all over the page.
* <script> and <style> elements in XHTML sent as text/html have to be escaped using ridiculously complicated strings.
Or you could refer to external files which you should probably be doing anyways. Besides, it's 2005. Are there still browsers in use that don't recognize the script tag? I haven't run across one in at least five years. Even browseres that don't support JavaScript at least know to ignore the contents of this tag.
* A CSS stylesheet written for an HTML4 document is interpreted slightly differently in an XHTML context (e.g. the element is not magical in XHTML, tag names must be written in lowercase in XHTML). Thus documents change rendering when parsed as XHTML.
Well, the second case is easily solved by writing tag names in lower case anyway. Wow, that was tough. I can't remember ever seeing a non-contrived case where the first was an issue, and even then it could be trivially worked around.
* A DOM-based script written for an HTML4 document has subtly different semantics in an XHTML context...
This is probably his one valid point. I do agree with this one, but also feel that it could be worked around with a little thought if you had a valid reason to use XHTML. Mainly you just need to use
* Scripts that use document.write() will not work in XHTML contexts.
Good! document.write() should have been put out to die years ago.
* Current UAs are, for text/html content, HTML4 user agents (at best) and certainly not XHTML user agents. Therefore if you send them XHTML you are sending them content in a language which is not native to them, and instead relying on their error handling. Since this is not defined in any specification, it may vary from one user agent to the other.
And this is different from sending your document as HTML 4 how?
* XHTML documents that use the "/>" notation, as in "<link
Probably technically true, but I've never seen this "SHORTTAG minimisation" discussed anywhere else, and I can't recall ever having dealt with a UA that treats self closing tags in such a manner.
In short, there are issues to watch out for, but there are a lot of cases when XHTML may be preferable to HTML 4 (e.g. using an XML based content management system), and as the most popular web browser on the internet doesn't handle XHTML when served as application/xhtml+xml (and it has been announced that the next version will not either) and all remotely modern UA's will handle XHTML served as text/html, there are a lot of cases where it doesn't put make sense to put off adoption of XHTML for 2 years or more until the majority of browsers can handle it properly.
That said, HTML 4 is still a perfectly valid alternative, and for a site like Slashdot where there are no compelling reasons to go with XHTML, and a lot of valid reasons for not, I don't see why anybody should complain that the site was done as HTML4+CSS and not XHTML+CSS.
If I don't put anything here, will anyone recognize me anymore?
I hope too much doesn't change with light mode, as it is far more readable than before on my Sidek!ck II. Please keep in mind that this device (aka Danger HipTop2) has no support for javascript or style sheets. CCS will have zero effect on these devices. I didn't have to change any settings, as I already had "light" & "no icons" checked for my home page. I don't see a setting for "handhelds" as indicated in the submission.
- Posted via Danger HipTop2 / T-Mobile Sidek!ck II -
That's because your browser is using Times New Roman, Slashdot doesn't pick a font for article/comment text.
Which is easy to change:
Firefox: Tools > Options, select General(FF1.0)/Content(FF1.5b), Click on Fonts & Colors(FF1.0)/Advanced(FF1.5), and choose Sans Serif as the Proportional Font, You can also choose which Sans Serif font you want below
IE: Tools > Internet Options, General tab, Fonts button, Change the web page font to one of your liking.
Too many zeros, not enough ones
Those character encodings are capable of representing the characters, sure. But browsers aren't uniformly capable of decoding them. Browsers don't support UTF-16 as well as Big5, for example.
If every browser properly implemented Unicode, then sure, it wouldn't be a problem to require UTF-8 or UTF-16. But that's not the reality; browsers are far from perfect.
Bogtha Bogtha Bogtha
No good at all. id is a unique id. Like name. What you want is exactly what class is for. You can have multiple class entries (including undefined ones) so your example would be
.mod_neg1 .Friend
<li class="comment Troll Insightful mod_4 Friend Friend_of_Foe" id="(comment #)">
Then your personal CSS file could have entries like so:
{
display:none;
}
{
font-weight: bold;
}
etc.
HitScan
It would be nice though if there was a site-specific hook to hang a user stylesheet upon, such as <body class="it-slashdot-org slashdot-org">
/ simple-site-signature
Try user javascript if you're using Opera, or Greasemonkey if you're using Firefox. Then use Simple site signatures: http://userjs.org/scripts/general/developer_tools
In a normal browser, that's fine and dandy. However, HTML itself (devoid of CSS) is read and used by other devices. For instance if I am browsing in Lynx, that list makes a huge difference in display and don't even get me started on voice readers and other things.
HTML is not there purely to be used as an anchor for style. It is there to explain what kinds of content a document contains. I mean, why use an h1 - h6 or a p or em or strong? You could simply create contextual style definitions for divs and spans which would, more or less, do everything that other tags do.
I mean really, if HTML was really just there for CSS all you'd need would be , , , , , , , and . You wouldn't even need since you could could just define inline divs.
You've missed the point: the script and style tags are PCDATA in XHTML, not CDATA. That means comments are not ignored, so your HTMLish scripts and styles, hidden in comment tags, will be invisible to an XHTML user agent. If they aren't, it isn't an XHTML user agent.
// <![CDATA[
...
// ]]>
No, I didn't miss the point. I was saying that there's no reason to even use HTML/XML comments in the first place. Hiding scripts in HTML comment tags was a nasty hack to keep browsers that didn't recognize the script or style tags from displaying the contents of the script tag. No browser (that I am aware of) released in the last 8 years requires this nasty hack, but everyone still does it anyway. My point was that all of his nasty escaping is unnecessary. The following will work fine in every browser that I'm aware of:
<script type="text/javascript">
</script>
And if you still want to be paranoid, and you don't believe me that the comments are completely unnecessary, you can (as I stated) just use external files:
<script type="text/javascript" src="foo.js"></script>
If I don't put anything here, will anyone recognize me anymore?
-Dom
The correct mime type for XHTML is application/xhtml+xml. Parsers should also recognize the generic XML mime-types: application/xml and text/xml.
GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
Here's the bug:
Page Threshold = 50 posts
Story has 200 posts, 4 pages
First thread is 101 posts.
Slashdot will show the first thread on pages 1, 2, and 3.
Page 4 will show the last 50 posts
The other 49 and their posts and threads will be invisible unless you go into nested mode.
Whenever I hear the word 'Innovation', I reach for my pistol.