patch for auto show/hide macro expansion in CSS

Hi,

Instead of using javascript, it can be done in css like this. Tested in IE7
et FF3b4 (I don't have IE6, for it, it would probably need to transform the
<span class="macro"> into a <a class="macro">). It depend on which browser
you want to support...

I put an XHTML doctype in order to get the browser to be in standard mode
(instead of quirk mode).

Regards,

Cédric

Ps: Does the color match those of Xcode? Because I don't really care for
them :expressionless:
Ps2: VS highlight code 'discarded' by the preprocessor in a special color.
Like this:

#if 0
something in a special color
#endif

It is useful when the condition are more complex. Could it be done?

hover-expansion-170408.patch (1.27 KB)

Hi,

I put an XHTML doctype in order to get the browser to be in standard mode
(instead of quirk mode).

I had the impression that XHTML is so 2006 and everyone is using HTML4 these days:

http://hixie.ch/advocacy/xhtml

Main reasons are that Mozilla doesn't (didn't?) render XHTML pages progressively, and that next to no server serves XHTML files as application/xml+xhtml, so they trigger quirks mode.

I might be wrong though.

Nico

I think the goal is to be portable with the latest, standard browsers, while still using the features of certain browsers if it makes life easier and the results prettier (e.g., using the -webkit-* CSS properties for Safari). If HTML4 is more current, than that's probably what we should use, but I am not the expert here. Anyone who knows better on how the HTML should be formatted is more than welcome to submit a patch.

XHTML doctypes are a very fast way to trigger quirks mode in those browser that recognise xhtml (ie. not IE which will
treat the doctype as nonsense and go into quirks mode anyway)

Despite what the XHTML spec may say, xhtml served with a text/html mimetype (needed for IE to even attempt
to display the content) will be treated as html with a bogus doctype -- eg. straight into quirks mode.
For a local file to be detected as xhtml you'll need a .xhtml extension (depending on platform and browser).

In general the HTML5 doctype will trigger standards mode in most browsers (Firefox, IE, Opera, and anything
WebKit based) and that's very simple:
<!doctype html>

--Oliver

Thanks Oliver!

XHTML doctypes are a very fast way to trigger quirks mode in those
browser that recognise xhtml (ie. not IE which will
treat the doctype as nonsense and go into quirks mode anyway)

From my experience, xhtml work well with IE6&7 et FF. The problem of serving

xhtml as text/html is more serious. Anyway I wasn't especially attached to
xhtml, it was just that I copied it from the last webpage I wrote.

In general the HTML5 doctype will trigger standards mode in most
browsers (Firefox, IE, Opera, and anything
WebKit based) and that's very simple:
<!doctype html>

From:
http://en.wikipedia.org/wiki/Quirks_mode

it seem NS6 don't like it and using a html5 doctype for html4 page seem a
little strange.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
"http://www.w3.org/TR/html4/strict.dtd">
or
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
Could be better...

Cédric

XHTML doctypes are a very fast way to trigger quirks mode in those
browser that recognise xhtml (ie. not IE which will
treat the doctype as nonsense and go into quirks mode anyway)

From my experience, xhtml work well with IE6&7 et FF. The problem of serving
xhtml as text/html is more serious. Anyway I wasn't especially attached to
xhtml, it was just that I copied it from the last webpage I wrote.

Ie does not support xhtml -- the only time it will open xhtml is if it is being served with a html mimetype,
which triggers quirks mode in those browser that support it

In general the HTML5 doctype will trigger standards mode in most
browsers (Firefox, IE, Opera, and anything
WebKit based) and that's very simple:
<!doctype html>

From:
http://en.wikipedia.org/wiki/Quirks_mode

it seem NS6 don't like it and using a html5 doctype for html4 page seem a
little strange.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
"http://www.w3.org/TR/html4/strict.dtd">
or
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
Could be better...

However html5 is by and large backwards compatible with html4 -- most of html5 revolves around defining the
handling of the tag soup that is html.

Cédric

--Oliver