Slashdot Mirror


Making IE Standards Compliant

spin2cool writes "Dean Edwards has taken it upon himself to make Internet Explorer W3C compliant. How? Well, it isn't by patching the application, as you might suspect. He's created a stylesheet, dubbed 'IE7' that uses DHTML to load and parse style sheets into a form that IE can understand. Just include the style sheet in your HTML pages, and things should render correctly. The complexity of the CSS transformations is really amazing and shows off the power of this stuff."

46 of 582 comments (clear)

  1. firefox by selderrr · · Score: 4, Informative

    I wish someone would release such a sheet for firefox : /. itself still doen't render correctly on FFox 0.8 under XPpro. As shown here, the left column tends to dribble into the article summary...

    1. Re:firefox by Anonymous Coward · · Score: 1, Informative

      I've had it happen to me before, on this and various other sites. But it's an inconstant effect. Which is strange. I thought it might have had something to do with changing the font-size, but quick infomral testing argues not.

    2. Re:firefox by Xugumad · · Score: 4, Informative

      Downloading the index page, then uploading it to the W3C validator throws an error about being unable to determine character encoding. Forcing character encoding to iso-8859-1 results in 371 errors!

    3. Re:firefox by JimDabell · · Score: 4, Informative

      The SGML definition of HTML 3.2 declares attributes as CDATA.

      Actually, it varies; not all attributes are defined in that way. If you limit your remark to the href attributes of <a> elements, the HTML 4.01 specification defines them to contain CDATA as well. However you are misinterpreting the meaning of CDATA - CDATA includes character entities.

    4. Re:firefox by the+pickle · · Score: 2, Informative

      The "unknown entity" errors aren't bogus; the unescaped ampersand character has NEVER been "legal" in URIs. User-agents have simply auto-escaped them for so long that not escaping them became standard practise.

      Changing all those to &amp; is trivial, yes, but no less necessary for proper validation than an unclosed <b> tag.

      p

    5. Re:firefox by JimDabell · · Score: 3, Informative

      You are wrong. The HTML specification is very clear on the matter.

      to use the URI "http://host/?x=1&y=2" as a linking URI, it must be written <A href="http://host/?x=1&#38;y=2"> or <A href="http://host/?x=1&amp;y=2">.

    6. Re:firefox by Drantin · · Score: 4, Informative

      although: Slashcode has a recent article on the subject...

      --
      Actio personalis moritur cum persona. (Dead men don't sue)
  2. Google cache by Underholdning · · Score: 5, Informative

    Site is already slashdottet. Here's Google's cache of the document.
    So - how are the plans going with implementing a slashdot cache?

    1. Re:Google cache by nautical9 · · Score: 3, Informative
      Unfortunately, some (most?) sites are dynamic in nature, especially concerning advertising. By using the freecache service, a static version of the page gets cached and the same ad would _may_ appear if the site owner is using his own advertising code and not some remote service like google or doubleclick, likely going against the wishes of the website. Or perhaps the content itself requires dynamic code to work properly.

      Although this would be very useful for tiny sites like those hosted on cable connections, but it's hard to tell in advance which sites will be slashdotted.

      And either way, the choice should really be up to the web site owner. I'm sure most would prefer that people see their content versus having their server crushed, but you never know until you ask.

    2. Re:Google cache by Anonymous Coward · · Score: 2, Informative

      And either way, the choice should really be up to the web site owner. I'm sure most would prefer that people see their content versus having their server crushed, but you never know until you ask.

      Read the Slashdot FAQ. It explicitly states that the reason Taco et al. don't email to ask permission in these cases is because they don't want to delay "cool breaking news" for a few hours.

      Seriously, the reason why this poor guy's server (in his kitchen, no less!) is a smoking crater is because the Slashdot editors didn't think we could wait a few hours to see this CSS hack.

  3. Mirror offer by paulproteus · · Score: 1, Informative

    If the author would like to email me at mirror@asheesh.org, I'd be happy to mirror this site. I have more than enough bandwidth to cover it.

    -- Asheesh.

    --
    |/usr/games/fortune
  4. Get firefox. by MooKore+2004 · · Score: 4, Informative

    If you havent already yet, you should of switched from IE to Firefox. It is now my default browser on Windows, and on Windows XP it even puts it as the top Start menu item. It is fast, light, small download (6Mb), Tabbed Browsing, Popup blocking, Download manager, Cute icon and standards compliance are all good reasons to use it. So don't use an ugly hack to transform your pages for IE, put a firefox icon on your site.

    So if you havent downloaded it yet, get it now!. Avalible for Windows, Linux, Mac OS X and more!

  5. Re:Shows the power of IE by ender81b · · Score: 4, Informative

    AFAIK there is no browser available that correctly renders CSS 2.0 -- the entire spec.

    IIRC Moz and Opera do render all of CSS 1.0 correctly and nearly all of CSS 2.0 correctly. But doing some advanced things with CSS 2.0 (especially doing all formatting with it, instead of old table hacks) you really run into problems with both Moz and Opera.

  6. Fixed in nightlies by Jack+Zombie · · Score: 5, Informative

    Use a Mozilla Firefox nightly build, the bug (217369, I think) that caused this problem is fixed in them.

    More major changes since 0.8 here.

    --
    "You should never doubt what nobody is sure about." -- Willy Wonka
    1. Re:Fixed in nightlies by PhilHibbs · · Score: 2, Informative

      So just un-tick the 'Send Referrer' box on the prefbar.

  7. Misleading title : corrects CSS2 selectors only. by androse · · Score: 4, Informative

    The title of the news is misleading : this JS component only corrects some CSS 2 selectors that IE doesn't natively support.

    So it doesn't really make IS standards compliant, it just extends some functionnality. It doesn't, for example, correct the box model of IE5.

    So I'm afraid it doesn't spare us of using CSS hacks to filter out IE.

  8. Re:Kudos, but... by kalidasa · · Score: 4, Informative

    in reality, they can of course by not using closed source software, but for some it seems percieved convenience is more important than freedom, but I digress)

    What this does is allow developers of standards-based sites, which they have under their own control, to provide a stopgap for users who don't understand the issue of standards and so haven't themselves chosen freedom. So your digression doesn't quite match the facts. As a developer, I can choose to make my site work in Mozilla and KHTML - and will - but I can't choose to force my audience to use them. With this, if it works as advertised, I can choose to follow standards and still provide some means for those who have, for whatever reasons, chosen to use a non-free browser to use my content.

  9. Mirror made by paulproteus · · Score: 4, Informative

    I made this mirror based on the Google cache. It has the full source code, as well as the docs he wrote.

    This is temporary, of course.

    --
    |/usr/games/fortune
  10. Re:Useful stylesheets by farlukar · · Score: 5, Informative

    try this one

    --
    Ceci n'est pas une .sig
  11. Re:Shows the power of IE by JimDabell · · Score: 5, Informative

    AFAIK there is no browser available that correctly renders CSS 2.0 -- the entire spec.

    You are right, which is why some of the more esoteric features have been removed from CSS 2 and CSS 2.1 is about to be released.

    However this is a lot different to Internet Explorer 6's situation. There are massive amounts of CSS 2 that simply aren't implemented, such as a whole bunch of selectors and tables.

    The next time you see somebody complaining that CSS layout is hard, remember that there's probably a way to do what they want in a few lines of CSS, but that part of CSS simply doesn't work in Internet Explorer (but does in Mozilla, Konqueror, Opera, etc).

  12. Re:All that's missing by scragz · · Score: 5, Informative
    I wonder if it's possible to implement a DHTML hack for proper PNG support :)
    Check here and here.
  13. Re:All that's missing by JimDabell · · Score: 3, Informative

    I wonder if it's possible to implement a DHTML hack for proper PNG support :)

    To a limited extent, yes.

  14. MOD PARENT UP, SCORE +20 FULL ON TRUE by Anonymous Coward · · Score: 3, Informative

    Oh come on, people, do a View Source for yourselves. Go on, I dare you. Slashdot's HTML is hideous just to look at and horribly out of standards compliance.

  15. Source Code for IE7 htc by EqualSlash · · Score: 5, Informative

    via Google Cache : IE7.htc

  16. partial mirror by daxim · · Score: 2, Informative

    This is only the IE behavior itself. (27 kB)

    Visit the containing directory to see a fix for IE's PNG rendering bug that also works on background PNG images.

  17. Re:MSIE is the standard by Zaiff+Urgulbunger · · Score: 2, Informative

    Just in case you haven't realised, IE5.5 is quite different to both IE5 and IE6. I myself tested a site once using IE5 and IE6 assuming that IE5.5 would be much the same as one of them... but oh no, its got its very own strangeness! And Mac IE is of course different again.

  18. Re:Shows the power of IE by Tweaker_Phreaker · · Score: 2, Informative

    Even if other browsers don't fully support the latest standards, at least they're showing regular progress. IE's renderer hasn't been changed since IE 5.5 around 5 years ago. And even though it's claimed to be fully compliant with CSS 1.0, it has been proven to be otherwise.

  19. Re:They're going to completely rewrite IE? by displaced80 · · Score: 2, Informative

    Offtopic? Oh, come on!

    "who woulda thunk it?"

    thunk -- code that performs a translation or conversion... like the stylesheet?

    Okay... so I'm stretching definitions slightly. But I'll do anything for a pun.

    --
    What's the frequency, Kenneth?
  20. This is a great idea by seldolivaw · · Score: 4, Informative

    The code itself at the moment is 27k, which is kinda hefty for most pages on initial load (though you'd only have to load it once per site). However, it includes loads of comments, which might slim it down to about half that if you stripped them out. And the savings in other code areas by not having to write double-code and browser-detection are probably worth it overall.

    This would certainly make development a lot easier... I look forward to trying it out :-)

  21. Mirror by DeanEdwards22 · · Score: 4, Informative

    Can someone temporarily host my site? some of it is php4. is that ok? mail me at dean@edwards.name and cc 9jack9@msn.com. i can chat on the msn account if necessary. thanks. dean edwards

  22. Re:Misleading title : corrects CSS2 selectors only by Anonymous Coward · · Score: 2, Informative

    The parent post is quite correct. This is basically a hack. A technically proficient, useful hack, but a hack nonetheless.

    I believe (and I can't check as the site is down) that the effect of the stylesheet is to:
    a) scan the stylesheets that come with the document and look for certian types of unsupported selectors
    b) Replace those selectors with ones that IE does understand (i.e. copy the style rules to a new selector)
    c) Scan through the html of the document and look for elements that matched the original (unsupported) selectors
    d) Add a class attribute to the elements that should have matched the old selector that causes it to match the equivilent selector that IE does understand

    e.g. an selector div > p will match p that is a child of div. IE doesn't understand child selectors, so given a rule:
    div > p {font-family:"comic sans ms";}
    the stylesheet will create a rule .uniquename {font-family:"comic sans ms";}
    and given a piece of document that should match like:
    <div>
    <p>
    Isn't IE great!
    </p>
    </div>
    It will be replaced (in memory) by something like:
    <div>
    <p class="uniquename">
    Isn't IE great!
    </p>
    </div>
    This will allow the IE style engine to apply the correct formatting.

  23. Re:Useful stylesheets by kmarius · · Score: 2, Informative

    These kinds of browser checks are the same reason why browsers like Opera needs to fake the User-Agent. This page of yours would also block Opera. Let people use whatever browser they want without blocking them.

    This is what Opera 7.20 uses by default:
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Opera 7.20 [en]

    Because it contains MSIE it fools a lot of scripts, like yours.

  24. Re:Making IE Standards compliant? by I+confirm+I'm+not+a · · Score: 5, Informative

    Just to clarify slightly - IE7 doesn't rely on serving up a different stylesheet, but an additional 'sheet. In other words, if you reference IE7 as your first 'sheet, existing stylesheets for compliant browsers will then render OK in IE.

    If I've read it right you don't even need to sniff (well, at least not in the old-fasioned, java-script or server-side script sense): it's all done through CSS.

    --
    This is where the serious fun begins.
  25. IE used to be advanced. by Anonymous Coward · · Score: 2, Informative

    I remember back then, when Netscape Navigator 4.* was alife, we used to bitch about it in the company. Whatever you wanted to do, dhtml, layers, css and other modern cool stuff, it looked cool in IE but totally failed in NN. We had to include alot of workarounds for NN.

    Today, we have Mozilla, KHTML/Safari and Opera and we can do what ever we want to do, all the modern stuff like CSS 2.0, tableless page layouts and other funky stuff you want to do in the year of 2004. It looks great in all browsers, except IE. Nowadays IE is the bad kid who destroys the party. I hope MS fixes it soon or lets it go the NN 4.* way.... please...

  26. They got a solution for free by Anonymous Coward · · Score: 1, Informative

    Not a while ago there was a post about retooling slashdot with valit html.... all they have to do to use that. it would even look good in lynx or w3m.

    Retooling Slashdot with Web Standards

  27. Mirror by DeanEdwards22 · · Score: 3, Informative

    thanks to all those who have offered to mirror/host my site. i'm currently working on a solution so i should be back up again soon. thanks to Asheesh Laroia there is now a temporary mirror here: http://jhunix.hcf.jhu.edu/~alaroia1/dean/ please note: only the html test files work on this mirror. thanks again. dean edwards

  28. Re:I was expecting another kind of patch by DeanEdwards22 · · Score: 3, Informative

    I've done this too: http://dean.edwards.name/moz-behaviors/ (when my site is back up!)

  29. Standards or just plain common sense? by pooh666 · · Score: 3, Informative

    I know this is not new to a lot of people judgeing by the number of hits I get when searching for solutions. IE's submit button doesn't lock, as many times as you click it, is as many times as it breaks its former connection and makes a new one.

    I can't believe even MS would do something that stupid!!! Since I learned about forms on Netscape, it never occured to me that this problem could exist until I saw it for myself.

    I couldn't care less about DHTML or CSS "compliance" when IE can't even act like a simple web client correctly!!

    Eric

  30. Is Mozilla hiding its' security problems? by darthcamaro · · Score: 2, Informative

    I've always though of IE as being the 'weak link' BUT check out this post on MozillaZine about how RUS-CERT has critized Mozilla's security policy. Supposedly Mozilla doesn't issue regular patches/update/notices to users - security fixes are only incorperated into the 'latest' release ?!?!!

  31. "Official Mirror" by DeanEdwards22 · · Score: 2, Informative

    thanks to Lizard for this mirror:

    http://edwards.furhome.net/

    all html and xml examples should now work.

    thanks again for all the offers for mirrors i've had.

    dean edwards
  32. Re:All that's missing by strech · · Score: 2, Informative

    There are countless implementations that try to fix IE's lack of PNG transparency support, using AlphaImageLoader in some form.

    However, none of them fully work; I've tried pretty much all of them and none of them will work with CSS or Javascript rollovers.

  33. Re:All that's missing by gnu-generation-one · · Score: 2, Informative

    "All that's missing now, is a stylesheet that'll close all remaining security holes..."

    You can make an ethernet adapter for that, which plugs in between your Windows machine and the network or cable modem. Simply take a standard CAT5 lead, cut it in half, and tape the ends shut. Then plug one half into the Windows computer, and the other half into the network.

  34. Re:Useful stylesheets by galaxy300 · · Score: 2, Informative

    Running XP SP1 w/ IE 6 SP 1. Been using FireFox since it was Phoenix 0.2 and hardly ever fire up IE anymore, though...

  35. Re:Shows the power of IE by Anonymous Coward · · Score: 1, Informative

    You do not actually need an entirely different style sheet for IE browsers. You can easily have one style sheet that addresses the differences of Mozilla/Opera/IE.

    You can, for instance, use hacks to feed specific values to IE only: Star HTML Selector Bug [Edwardson Tan]

    There are numerous other such hacks available which exploit browser-specific bugs. There are ways to force IE into using the correct box-model, for instance, among many other things.

    CSS Filters [Dithered.com] is just one place you will find information on such hacks. I prefer to use the CSS-Only hacks, but here are listed some methods incorporating Java Script as well.

    Best of all, mostly all of the very useful CSS hacks validate :) In short, it's actually quite easy to have one style sheet work for multiple browsers, without having to do any sort of detection.

  36. Mirror of IE7 by gessleX · · Score: 3, Informative

    With permission of Dean Edward, I have copied the IE7 information and src download to my webserver for mirroring purposes. http://opensource.worldhuman.net/mirror/IE7

  37. This doesn't work by DeanEdwards22 · · Score: 2, Informative
    use this mirror:

    http://edwards.furhome.net/IE7/

    thanks anyway Casey