4 ms·
A) Using < would cause parsing problems when the stylesheet is embedded in an enclosing HTML document. B) If you think about it, the selector is still functioni
by saurik 15y ago
A) Using < would cause parsing problems when the stylesheet is embedded in an enclosing HTML document. B) If you think about it, the selector is still functioning the same: you are simply moving which node is being "targeted"; I would therefore hope that you could also do "$el + el" to select nodes that came before other nodes. (edit: Reading the linked update to the specification, it seems like the people who wrote it did not see that this would be a useful, beautiful, and arguably important generalization; sigh.)
- bps4484 15y agocould you elaborate on A? What's the problem of using "<" in an enclosing html document that wouldn't also be a problem for ">", which already exists?
- saurik 15y agoI'm confused by your comment: ">" only has special meaning in the context of a tag, or after "]]"; "<" has special meaning meaning anywhere in a document you are not inside of a tag.
- bps4484 15y agothat actually answered my question. I don't know the html spec that well so I didn't know if both "<" and ">" were reserved characters. From what I understand of what you're saying, it's only when ">" comes after a "<" that is has special meaning.
- saurik 15y agoCorrect. From the XML specification (which is easier to obtain than SGML, more prescriptive than HTML4, and capable of being understood by humans in a way the HTML5 "document IE" specification is unable to support), 2.4 "Character Data and Markup" (note the "may" and "MUST"): The ampersand character (&) and the left angle bracket (<) MUST NOT appear in their literal form, except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section. If they are needed elsewhere, they MUST be escaped using either numeric character references or the strings " & " and " < " respectively. The right angle bracket (>) may be represented using the string " > ", and MUST, for compatibility, be escaped using either " > " or a character reference when it appears in the string " ]]> " in content, when that string is not marking the end of a CDATA section.