.support property for q element

.support property for q element


The q element is supposed to be rendered with quotation marks around
it, according to the W3C specs:
"Visual user agents must ensure that the content of the Q element is
rendered with delimiting quotation marks. Authors should not put
quotation marks at the beginning and end of the content of a Q
element."
(http://www.w3.org/TR/REC-html40/struct/text.html#h-9.2.2.1)
IE versions before 8 do nothing with the q element, however.
The best way to find out whether the browser renders quotes or not
should probably be to get the CSS 'quotes' property with
getComputedStyle (maybe in combination with getPropertyValue) but
Webkit browsers do not seem to specify any 'quotes' as can be seen at
http://johanolsson.net/blog/?p=18 (also see https://bugs.webkit.org/show_bug.cgi?id=23668)
so I'm not sure if/how it could be done. Currently the main browsers
supporting getComputedStyle at all seem to render q correctly though,
so I myself simply check if the function exists.
The IE equivalent would be the currentStyle function which should work
with the following function, returning true for IE8 and false for
previous versions:
var q = $('q:first');
if ( q . currentStyle )
    s = q.currentStyle;
    for ( prop in s ) {
        if ( prop == 'quotes' ) {
            supportsQuotes = true;
            break;
        }
    }
}
-- Jacob Rask