I'm developing an application that uses ubiquity-xforms. Previously I had been serving the pages up as text/html with the XHTML 1.0 doctype.
If I switched the mime-type to application/xhtml+xml, I would see a pretty big performance improvement, because the javascript could use the get____NS() functions, instead of what it's doing now (slowly iterating through the entire DOM tree every time it needs to select an element).
But when I tried this, a bunch of my CSS stopped working. I noticed that when I inspected the elements, either in Firebug or in the WebKit Nightly Web Inspector, the point of failure were '.classname' and '#id' css selectors on elements in the XFORMS namespace. I also noticed that in the listed DOM properties for those elements they were lacking both 'id' and 'className' attributes.
My question is, is there a way that I can get the UA to recognize these as classes and ids?
Things I've tried, to no avail:
- specifying the "id" attributes as ID in an inline doctype's ATTLIST
- trying every doctype I could, or no doctype at all
- qualifying the id and class name attributes in the xhtml namespace (ie. xhtml:id)
Here's some sample xhtml. Doesn't work in either Firefox 3.5 or Safari 4 / WebKit Nightly
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms">
<head>
<style type="text/css">
/* <![CDATA[ */
#test {
background-color: red;
}
.testing {
color: blue;
}
/* ]]> */
</style>
</head>
<body>
<xf:group id="test" class="testing">Test</xf:group>
</body>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…