This project is archived and is in readonly mode.

#922 ✓invalid
Michael Ficarra

Slick feature/bug detection does not respect w3c standards (with fix)

Reported by Michael Ficarra | June 3rd, 2010 @ 06:45 PM

When doing feature/bug detection, Slick appends a test node to the document.documentElement (commonly <html>). The w3c standards for both html and xhtml do not allow nodes here that are not <head>, <body>, or <frameset>. In addition, only one <head> and one of either <body> or <frameset> is allowed (and required for that matter). I have fixed this on a branch of my fork ( that attempts to append the node to the <body> instead if one exists, and falls back to the original method otherwise. I can send a pull request to anyone who would like it, if that helps.

Comments and changes to this ticket

  • Thomas Aylott

    Thomas Aylott June 9th, 2010 @ 05:13 PM

    • State changed from “new” to “invalid”
    • Assigned user set to “Thomas Aylott”

    Keep in mind that Slick works in SVG documents, XML documents, HTML5 documents, headless DOM-like objects, etc…

    It's none of Slick's business to assume that a specific tag does or doesn't exist in the document. AFAIK it's impossible to have a proper document without a documentElement node. That's the only node that must exist.

    If you do find a real bug, please open a new ticket.

    If you find an error or failure that this is causing then we'll take a look at a better solution. Until then, this is the most tested and error proof solution. This is why we have such an insanely extensive set of specs.


Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket